Make get_messages return the correct type

This commit is contained in:
Dan 2018-04-16 12:42:31 +02:00
parent d0ddb63830
commit f47f903f7f

View File

@ -3332,4 +3332,21 @@ class Client:
id=message_ids
)
return self.send(rpc)
r = self.send(rpc)
users = {i.id: i for i in r.users}
chats = {i.id: i for i in r.chats}
messages = []
for i in r.messages:
if isinstance(i, types.Message):
parser = message_parser.parse_message
elif isinstance(i, types.MessageService):
parser = message_parser.parse_message_service
else:
continue
messages.append(parser(self, i, users, chats))
return messages