pyrofork: utils: Don't append message 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 00fed09311
commit 3622b13a9f
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 = {
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 = {