Skip to content

Commit

Permalink
pyrofork: Add message_thread_id to general topic messages
Browse files Browse the repository at this point in the history
Signed-off-by: wulan17 <wulan17@nusantararom.org>
  • Loading branch information
wulan17 committed Jun 8, 2024
1 parent 57d31fa commit ace0da1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pyrogram/types/messages_and_media/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,9 @@ async def _parse(
else:
parsed_message.message_thread_id = message.reply_to.reply_to_msg_id
parsed_message.is_topic_message = True
elif parsed_message.chat.is_forum and parsed_message.message_thread_id is None:
parsed_message.message_thread_id = 1
parsed_message.is_topic_message = True

return parsed_message

Expand Down Expand Up @@ -1189,6 +1192,11 @@ async def _parse(
parsed_message.topics = msg.topics
except Exception:
pass
elif parsed_message.chat.is_forum and parsed_message.message_thread_id is None:
parsed_message.message_thread_id = 1
parsed_message.is_topic_message = True
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
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
Expand Down

0 comments on commit ace0da1

Please sign in to comment.