mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-16 11:02:58 +00:00
🚑️ fix: message parse
This commit is contained in:
parent
8e48f32dce
commit
9211a7d843
@ -379,13 +379,17 @@ class Message(pyrogram.types.Message):
|
||||
replies: int = 1
|
||||
):
|
||||
parsed = await pyrogram.types.Message.old_parse(client, message, users, chats, is_scheduled, replies) # noqa
|
||||
# forum_topic
|
||||
parsed.forum_topic = getattr(message.reply_to, "forum_topic", None)
|
||||
if isinstance(message, pyrogram.raw.types.Message) and message.reply_to \
|
||||
and parsed.forum_topic and not message.reply_to.reply_to_top_id:
|
||||
parsed.reply_to_top_message_id = parsed.reply_to_message_id
|
||||
parsed.reply_to_message_id = None
|
||||
parsed.reply_to_message = None
|
||||
# forum topic
|
||||
if isinstance(message, pyrogram.raw.types.Message):
|
||||
parsed.forum_topic = getattr(message.reply_to, "forum_topic", None)
|
||||
if (
|
||||
message.reply_to
|
||||
and parsed.forum_topic
|
||||
and not message.reply_to.reply_to_top_id
|
||||
):
|
||||
parsed.reply_to_top_message_id = parsed.reply_to_message_id
|
||||
parsed.reply_to_message_id = None
|
||||
parsed.reply_to_message = None
|
||||
# make message.text as message.caption
|
||||
parsed.text = parsed.text or parsed.caption
|
||||
return parsed
|
||||
|
Loading…
Reference in New Issue
Block a user