Fix getting messages by ID for private chats

This commit is contained in:
Lonami Exo 2018-09-16 15:45:38 +02:00
parent 4e07712b04
commit db8bea3968

View File

@ -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)