From db8bea396889f3f4e605a5f4232d0e30387af82a Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 16 Sep 2018 15:45:38 +0200 Subject: [PATCH] Fix getting messages by ID for private chats --- telethon/client/messages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/client/messages.py b/telethon/client/messages.py index 474e7022..0c7a203a 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -800,7 +800,7 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods): # arbitrary chats. Validate these unless ``from_id is None``. for message in r.messages: if isinstance(message, types.MessageEmpty) or ( - from_id and utils.get_peer_id(message.to_id) != from_id): + from_id and message.chat_id != from_id): await yield_(None) else: message._finish_init(self, entities, entity)