2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Fix index out of range for new messages

This commit is contained in:
Dan 2018-04-30 19:21:58 +02:00
parent a7650c457d
commit bfe6632de4

View File

@ -860,15 +860,18 @@ class Client:
) )
) )
self.dispatcher.updates.put(( if diff.new_messages:
types.UpdateNewMessage( self.dispatcher.updates.put((
message=diff.new_messages[0], types.UpdateNewMessage(
pts=updates.pts, message=diff.new_messages[0],
pts_count=updates.pts_count pts=updates.pts,
), pts_count=updates.pts_count
diff.users, ),
diff.chats diff.users,
)) diff.chats
))
else:
self.dispatcher.updates.put((diff.other_updates[0], [], []))
elif isinstance(updates, types.UpdateShort): elif isinstance(updates, types.UpdateShort):
self.dispatcher.updates.put((updates.update, [], [])) self.dispatcher.updates.put((updates.update, [], []))
except Exception as e: except Exception as e: