Fixed bugs of /message and now using cached media
This commit is contained in:
@@ -18,11 +18,11 @@ async def cmd_message(app: Client, msg: Message):
|
||||
destination = HoloUser(await find_user(app, query=msg.command[1]))
|
||||
|
||||
if ((msg.text is not None) and (len(msg.text.split()) > 2)):
|
||||
await destination.message(context=msg, text=" ".join(msg.text.split()[2:]), caption=msg.caption, photo=msg.photo, video=msg.video, file=msg.document, adm_context=True)
|
||||
await destination.message(context=msg, text=" ".join(msg.text.split()[2:]), caption=msg.caption, photo=msg.photo, video=msg.video, file=msg.document, voice=msg.voice, animation=msg.animation, adm_context=True)
|
||||
elif ((msg.caption is not None) and (len(msg.caption.split()) > 2)):
|
||||
await destination.message(context=msg, text=msg.text, caption=" ".join(msg.caption.split()[2:]), photo=msg.photo, video=msg.video, file=msg.document, adm_context=True)
|
||||
await destination.message(context=msg, text=msg.text, caption=" ".join(msg.caption.split()[2:]), photo=msg.photo, video=msg.video, file=msg.document, voice=msg.voice, animation=msg.animation, adm_context=True)
|
||||
else:
|
||||
await destination.message(context=msg, text=None, caption=None, photo=msg.photo, video=msg.video, file=msg.document, adm_context=True)
|
||||
await destination.message(context=msg, text=None, caption=None, photo=msg.photo, video=msg.video, file=msg.document, voice=msg.voice, animation=msg.animation, adm_context=True)
|
||||
|
||||
except IndexError:
|
||||
await msg.reply_text(locale("message_invalid_syntax", "message", locale=msg.from_user), quote=should_quote(msg))
|
||||
|
@@ -33,11 +33,11 @@ async def cmd_start(app: Client, msg: Message):
|
||||
try:
|
||||
spoiler = col_spoilers.find_one( {"_id": ObjectId(msg.command[1])} )
|
||||
if spoiler["photo"] is not None:
|
||||
await msg.reply_photo(spoiler["photo"], caption=spoiler["caption"])
|
||||
await msg.reply_document(spoiler["photo"], caption=spoiler["caption"])
|
||||
if spoiler["video"] is not None:
|
||||
await msg.reply_video(spoiler["video"], caption=spoiler["caption"])
|
||||
await msg.reply_cached_media(spoiler["video"], caption=spoiler["caption"])
|
||||
if spoiler["animation"] is not None:
|
||||
await msg.reply_animation(spoiler["animation"], caption=spoiler["caption"])
|
||||
await msg.reply_cached_media(spoiler["animation"], caption=spoiler["caption"])
|
||||
if spoiler["document"] is not None:
|
||||
await msg.reply_document(spoiler["document"], caption=spoiler["caption"])
|
||||
if spoiler["text"] is not None:
|
||||
|
Reference in New Issue
Block a user