From 5a17397fc7020e22d5d60cac98e0331443d6c25d Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 20 Sep 2022 17:54:05 +0200 Subject: [PATCH] Fix events.Album did not have chat in PM Closes #3773. --- telethon/events/album.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/telethon/events/album.py b/telethon/events/album.py index 01b2bbf4..827f1b11 100644 --- a/telethon/events/album.py +++ b/telethon/events/album.py @@ -152,16 +152,8 @@ class Album(EventBuilder): """ def __init__(self, messages): message = messages[0] - if not message.out and isinstance(message.peer_id, types.PeerUser): - # Incoming message (e.g. from a bot) has peer_id=us, and - # from_id=bot (the actual "chat" from a user's perspective). - chat_peer = message.from_id - else: - chat_peer = message.peer_id - - super().__init__(chat_peer=chat_peer, + super().__init__(chat_peer=message.peer_id, msg_id=message.id, broadcast=bool(message.post)) - SenderGetter.__init__(self, message.sender_id) self.messages = messages