Fix messages not having a reply-to-message when they actually do

This commit is contained in:
Dan 2020-12-23 16:18:27 +01:00
parent bec7ef96eb
commit 865f4274c3

View File

@ -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)) parsed_messages.append(await types.Message._parse(client, message, users, chats, replies=0))
if replies: 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())] reply_message_ids = [i[0] for i in filter(lambda x: x[1] is not None, messages_with_replies.items())]
if reply_message_ids: if reply_message_ids: