Added documents support for spoilers
This commit is contained in:
@@ -121,7 +121,12 @@ async def any_stage(app: Client, msg: Message):
|
||||
logWrite(f"Adding animation with id {msg.animation.file_id} to {msg.from_user.id}'s spoiler")
|
||||
ready = True
|
||||
|
||||
if spoiler["photo"] is None and spoiler["video"] is None and spoiler["animation"] is None and spoiler["text"] is None:
|
||||
if msg.document is not None:
|
||||
col_spoilers.find_one_and_update( {"user": msg.from_user.id, "completed": False}, {"$set": {"document": msg.document.file_id, "caption": msg.caption, "completed": True}} )
|
||||
logWrite(f"Adding document with id {msg.document.file_id} to {msg.from_user.id}'s spoiler")
|
||||
ready = True
|
||||
|
||||
if spoiler["photo"] is None and spoiler["video"] is None and spoiler["animation"] is None and spoiler["document"] is None and spoiler["text"] is None:
|
||||
if msg.text is not None:
|
||||
col_spoilers.find_one_and_update( {"user": msg.from_user.id, "completed": False}, {"$set": {"text": msg.text, "completed": True}} )
|
||||
logWrite(f"Adding text '{msg.text}' to {msg.from_user.id}'s spoiler")
|
||||
|
Reference in New Issue
Block a user