mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 22:34:52 +00:00
Pyrogram: types: Message: Add error handling and is_topic_message
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
abf1b2fece
commit
ede9af3e00
1 changed files with 7 additions and 3 deletions
|
|
@ -908,12 +908,16 @@ class Message(Object, Update):
|
||||||
else:
|
else:
|
||||||
thread_id = message.reply_to.reply_to_msg_id
|
thread_id = message.reply_to.reply_to_msg_id
|
||||||
parsed_message.message_thread_id = thread_id
|
parsed_message.message_thread_id = thread_id
|
||||||
|
parsed_message.is_topic_message = True
|
||||||
if topics:
|
if topics:
|
||||||
parsed_message.topics = types.ForumTopic._parse(topics[thread_id])
|
parsed_message.topics = types.ForumTopic._parse(topics[thread_id])
|
||||||
else:
|
else:
|
||||||
msg = await client.get_messages(parsed_message.chat.id,message.id)
|
try:
|
||||||
if getattr(msg, "topics"):
|
msg = await client.get_messages(parsed_message.chat.id,message.id)
|
||||||
parsed_message.topics = msg.topics
|
if getattr(msg, "topics"):
|
||||||
|
parsed_message.topics = msg.topics
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
parsed_message.reply_to_message_id = message.reply_to.reply_to_msg_id
|
parsed_message.reply_to_message_id = message.reply_to.reply_to_msg_id
|
||||||
parsed_message.reply_to_top_message_id = message.reply_to.reply_to_top_id
|
parsed_message.reply_to_top_message_id = message.reply_to.reply_to_top_id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue