diff --git a/pyrogram/utils.py b/pyrogram/utils.py index fc0e9abd..78950917 100644 --- a/pyrogram/utils.py +++ b/pyrogram/utils.py @@ -134,7 +134,10 @@ async def parse_messages( } message_reply_to_story = { - i.id: {'user_id': i.reply_to.user_id, 'story_id': i.reply_to.story_id} + i.id: { + 'user_id': getattr(i.reply_to, 'user_id', None), + 'story_id': getattr(i.reply_to, 'story_id', None) + } for i in messages.messages if not isinstance(i, raw.types.MessageEmpty) and i.reply_to and isinstance(i.reply_to, raw.types.MessageReplyStoryHeader) }