Fixed reply_document() issue

This commit is contained in:
Profitroll 2023-01-07 00:38:53 +01:00
parent 21bf460b28
commit bcaf80e2e1

View File

@ -33,13 +33,13 @@ async def cmd_start(app: Client, msg: Message):
try: try:
spoiler = col_spoilers.find_one( {"_id": ObjectId(msg.command[1])} ) spoiler = col_spoilers.find_one( {"_id": ObjectId(msg.command[1])} )
if spoiler["photo"] is not None: if spoiler["photo"] is not None:
await msg.reply_document(spoiler["photo"], caption=spoiler["caption"]) await msg.reply_cached_media(spoiler["photo"], caption=spoiler["caption"])
if spoiler["video"] is not None: if spoiler["video"] is not None:
await msg.reply_cached_media(spoiler["video"], caption=spoiler["caption"]) await msg.reply_cached_media(spoiler["video"], caption=spoiler["caption"])
if spoiler["animation"] is not None: if spoiler["animation"] is not None:
await msg.reply_cached_media(spoiler["animation"], caption=spoiler["caption"]) await msg.reply_cached_media(spoiler["animation"], caption=spoiler["caption"])
if spoiler["document"] is not None: if spoiler["document"] is not None:
await msg.reply_document(spoiler["document"], caption=spoiler["caption"]) await msg.reply_cached_media(spoiler["document"], caption=spoiler["caption"])
if spoiler["text"] is not None: if spoiler["text"] is not None:
await msg.reply_text(spoiler["text"]) await msg.reply_text(spoiler["text"])
except InvalidId: except InvalidId: