From e3991fadd583aea31b5da8b5ef8210da87b52a91 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 27 Feb 2019 09:37:12 +0100 Subject: [PATCH] Fix updating offset --- telethon/client/messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon/client/messages.py b/telethon/client/messages.py index 2ace90ed..7dc81ae7 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -173,10 +173,10 @@ class _MessagesIter(RequestIter): if len(r.messages) < self.request.limit: self.left = len(result) - # Get the first message that's not empty (in some rare cases + # Get the last message that's not empty (in some rare cases # it can happen that the last message is :tl:`MessageEmpty`) if result: - self._update_offset(result[0]) + self._update_offset(result[-1]) else: # There are some cases where all the messages we get start # being empty. This can happen on migrated mega-groups if