Compare commits
2 Commits
a4bbb837d7
...
bcaf80e2e1
Author | SHA1 | Date | |
---|---|---|---|
|
bcaf80e2e1 | ||
|
21bf460b28 |
@@ -124,11 +124,11 @@ class HoloUser():
|
|||||||
|
|
||||||
# Check if any text available and log message sending
|
# Check if any text available and log message sending
|
||||||
if text is not None:
|
if text is not None:
|
||||||
logWrite(f"{context.from_user.id} sent message '{text}' to {self.id}")
|
logWrite(f"{context.from_user.id} sent message '{text}' to {self.id} (source message: {context.id})")
|
||||||
elif caption is not None:
|
elif caption is not None:
|
||||||
logWrite(f"{context.from_user.id} sent message '{caption}' to {self.id}")
|
logWrite(f"{context.from_user.id} sent message '{caption}' to {self.id} (source message: {context.id})")
|
||||||
else:
|
else:
|
||||||
logWrite(f"{context.from_user.id} sent message to {self.id}")
|
logWrite(f"{context.from_user.id} sent message to {self.id} (source message: {context.id})")
|
||||||
|
|
||||||
# Add notices for admin or user
|
# Add notices for admin or user
|
||||||
if text is not None:
|
if text is not None:
|
||||||
@@ -165,7 +165,7 @@ class HoloUser():
|
|||||||
elif file is not None:
|
elif file is not None:
|
||||||
if isinstance(file, Document):
|
if isinstance(file, Document):
|
||||||
file = file.file_id
|
file = file.file_id
|
||||||
new_message = await origin.reply_document(file, caption=caption, quote=True)
|
new_message = await origin.reply_cached_media(file, caption=caption, quote=True)
|
||||||
elif animation is not None:
|
elif animation is not None:
|
||||||
if isinstance(animation, Animation):
|
if isinstance(animation, Animation):
|
||||||
animation = animation.file_id
|
animation = animation.file_id
|
||||||
@@ -190,7 +190,7 @@ class HoloUser():
|
|||||||
elif file is not None:
|
elif file is not None:
|
||||||
if isinstance(file, Document):
|
if isinstance(file, Document):
|
||||||
file = file.file_id
|
file = file.file_id
|
||||||
new_message = await app.send_document(self.id, file, caption=caption)
|
new_message = await app.send_cached_media(self.id, file, caption=caption)
|
||||||
elif animation is not None:
|
elif animation is not None:
|
||||||
if isinstance(animation, Animation):
|
if isinstance(animation, Animation):
|
||||||
animation = animation.file_id
|
animation = animation.file_id
|
||||||
|
@@ -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:
|
||||||
|
Reference in New Issue
Block a user