mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-02 13:34:51 +00:00
Pyrogram: Cleanup
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
e38ceb08cc
commit
86883a3b91
2 changed files with 10 additions and 5 deletions
|
|
@ -891,9 +891,6 @@ class Message(Object, Update):
|
|||
)
|
||||
|
||||
if message.reply_to:
|
||||
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
|
||||
|
||||
if message.reply_to.forum_topic:
|
||||
if message.reply_to.reply_to_top_id:
|
||||
thread_id = message.reply_to.reply_to_top_id
|
||||
|
|
@ -903,6 +900,10 @@ class Message(Object, Update):
|
|||
parsed_message.message_thread_id = thread_id
|
||||
if topics:
|
||||
parsed_message.topics = types.ForumTopic._parse(topics[thread_id])
|
||||
else:
|
||||
msg = await client.get_messages(parsed_message.chat.id,message.id)
|
||||
if getattr(msg, "topics"):
|
||||
parsed_message.topics = msg.topics
|
||||
else:
|
||||
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
|
||||
|
|
|
|||
|
|
@ -130,8 +130,12 @@ async def parse_messages(
|
|||
reply_id = messages_with_replies.get(message.id, None)
|
||||
|
||||
for reply in reply_messages:
|
||||
if reply.id == reply_id and not reply.forum_topic_created:
|
||||
message.reply_to_message = reply
|
||||
if reply.id == reply_id:
|
||||
#if reply.forum_topic_created:
|
||||
# message.reply_to_message_id = None
|
||||
#else:
|
||||
if not reply.forum_topic_created:
|
||||
message.reply_to_message = reply
|
||||
|
||||
return types.List(parsed_messages)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue