From 3622b13a9f622e7791a25037ae54423caf9c39ff Mon Sep 17 00:00:00 2001 From: wulan17 Date: Tue, 25 Mar 2025 22:31:14 +0700 Subject: [PATCH] pyrofork: utils: Don't append message to messages_with_replies if reply_to_msg_id is None Signed-off-by: wulan17 --- pyrogram/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyrogram/utils.py b/pyrogram/utils.py index 06c33a1c..09e3a7ed 100644 --- a/pyrogram/utils.py +++ b/pyrogram/utils.py @@ -123,7 +123,12 @@ async def parse_messages( messages_with_replies = { i.id: i.reply_to.reply_to_msg_id for i in messages.messages - if not isinstance(i, raw.types.MessageEmpty) and i.reply_to and isinstance(i.reply_to, raw.types.MessageReplyHeader) + if ( + not isinstance(i, raw.types.MessageEmpty) + and i.reply_to + and isinstance(i.reply_to, raw.types.MessageReplyHeader) + and i.reply_to.reply_to_msg_id is not None + ) } message_reply_to_story = {