diff --git a/telethon/client/messages.py b/telethon/client/messages.py index 805be4f6..a8a2e983 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -204,6 +204,10 @@ class _MessagesIter(RequestIter): message._finish_init(self.client, entities, self.entity) self.buffer.append(message) + # Not a slice (using offset would return the same, with e.g. SearchGlobal). + if isinstance(r, types.messages.Messages): + return True + # Some channels are "buggy" and may return less messages than # requested (apparently, the messages excluded are, for example, # "not displayable due to local laws").