diff --git a/telethon/events/newmessage.py b/telethon/events/newmessage.py index c5efaedc..7f2d3483 100644 --- a/telethon/events/newmessage.py +++ b/telethon/events/newmessage.py @@ -203,14 +203,7 @@ class NewMessage(EventBuilder): """ def __init__(self, message): self.__dict__['_init'] = False - 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)) self.pattern_match = None