pyrofork: utils: Don't append to messages to messages_with_replies if reply_to_msg_id is None

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2025-03-25 22:31:14 +07:00
parent dc05f2b791
commit bce191c3fd
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -123,7 +123,12 @@ async def parse_messages(
messages_with_replies = { messages_with_replies = {
i.id: i.reply_to.reply_to_msg_id i.id: i.reply_to.reply_to_msg_id
for i in messages.messages 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 = { message_reply_to_story = {