From 865f4274c3d9d945a436f7d239f65f01bf78dcb8 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 23 Dec 2020 16:18:27 +0100 Subject: [PATCH] Fix messages not having a reply-to-message when they actually do --- pyrogram/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/utils.py b/pyrogram/utils.py index 43b7b5a0..9f80591d 100644 --- a/pyrogram/utils.py +++ b/pyrogram/utils.py @@ -91,7 +91,7 @@ async def parse_messages(client, messages: "raw.types.messages.Messages", replie parsed_messages.append(await types.Message._parse(client, message, users, chats, replies=0)) if replies: - messages_with_replies = {i.id: getattr(i, "reply_to_msg_id", None) for i in messages.messages} + messages_with_replies = {i.id: i.reply_to.reply_to_msg_id for i in messages.messages if i.reply_to} reply_message_ids = [i[0] for i in filter(lambda x: x[1] is not None, messages_with_replies.items())] if reply_message_ids: