diff --git a/modules/handlers/everything.py b/modules/handlers/everything.py index db22879..c1b2da6 100644 --- a/modules/handlers/everything.py +++ b/modules/handlers/everything.py @@ -6,6 +6,7 @@ from pyrogram.client import Client from classes.holo_user import HoloUser from modules.utils import configGet, logWrite, locale, all_locales from modules.database import col_messages, col_spoilers +from bson import ObjectId async def message_involved(msg: Message) -> bool: message = col_messages.find_one({"destination.id": msg.reply_to_message.id, "destination.chat": msg.reply_to_message.chat.id}) @@ -95,6 +96,8 @@ async def any_stage(app: Client, msg: Message): return if msg.text != "-": col_spoilers.find_one_and_update( {"user": msg.from_user.id, "completed": False}, {"$set": {"description": msg.text, "completed": True}} ) + else: + col_spoilers.find_one_and_update( {"user": msg.from_user.id, "completed": False}, {"$set": {"description": None, "completed": True}} ) logWrite(f"Adding description '{msg.text}' to {msg.from_user.id}'s spoiler") await msg.reply_text(locale("spoiler_using_description", "message", locale=msg.from_user).format(msg.text), reply_markup=ReplyKeyboardRemove()) await msg.reply_text(locale("spoiler_ready", "message", locale=msg.from_user), quote=False, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("spoiler_send", "button", locale=msg.from_user), switch_inline_query=f"spoiler:{spoiler['_id'].__str__()}")]]))