Merge pull request #50 from eyMarv/patch-2

fix AttributeError: 'PeerUser' object has no attribute 'channel_id'
This commit is contained in:
2024-03-02 21:48:13 +07:00 committed by GitHub
commit 282f512fed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1143,9 +1143,9 @@ class Message(Object, Update):
parsed_message.reply_to_top_message_id = message.reply_to.reply_to_top_id
else:
parsed_message.reply_to_story_id = message.reply_to.story_id
if isinstance(message.reply_to, raw.types.PeerUser):
if isinstance(message.reply_to.peer, raw.types.PeerUser):
parsed_message.reply_to_story_user_id = message.reply_to.peer.user_id
elif isinstance(message.reply_to, raw.types.PeerChat):
elif isinstance(message.reply_to.peer, raw.types.PeerChat):
parsed_message.reply_to_story_chat_id = utils.get_channel_id(message.reply_to.peer.chat_id)
else:
parsed_message.reply_to_story_chat_id = utils.get_channel_id(message.reply_to.peer.channel_id)