From 9322c37a94626b6f564086612b955c3538eef715 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 28 Jun 2019 20:44:06 +0200 Subject: [PATCH] Document iteration order --- telethon/client/chats.py | 6 ++++++ telethon/client/dialogs.py | 6 ++++++ telethon/client/messages.py | 3 +++ 3 files changed, 15 insertions(+) diff --git a/telethon/client/chats.py b/telethon/client/chats.py index 7f5f804c..7d0db511 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -359,6 +359,8 @@ class ChatMethods: """ Iterator over the participants belonging to the specified chat. + The order is unspecified. + Arguments entity (`entity`): The entity from which to retrieve the participants list. @@ -470,6 +472,8 @@ class ChatMethods: """ Iterator over the admin log for the specified channel. + The default order is from the most recent event to to the oldest. + Note that you must be an administrator of it to use this method. If none of the filters are present (i.e. they all are ``None``), @@ -613,6 +617,8 @@ class ChatMethods: """ Iterator over a user's profile photos or a chat's photos. + The order is from the most recent photo to the oldest. + Arguments entity (`entity`): The entity from which to get the profile or chat photos. diff --git a/telethon/client/dialogs.py b/telethon/client/dialogs.py index 2fa2780b..ee57d82e 100644 --- a/telethon/client/dialogs.py +++ b/telethon/client/dialogs.py @@ -127,6 +127,10 @@ class DialogMethods: """ Iterator over the dialogs (open conversations/subscribed channels). + The order is the same as the one seen in official applications + (first pinned, them from those with the most recent message to + those with the oldest message). + Arguments limit (`int` | `None`): How many dialogs to be retrieved as maximum. Can be set to @@ -227,6 +231,8 @@ class DialogMethods: """ Iterator over all open draft messages. + The order is unspecified. + Yields Instances of `Draft `. diff --git a/telethon/client/messages.py b/telethon/client/messages.py index 12732ec6..1edfb6bd 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -315,6 +315,9 @@ class MessageMethods: """ Iterator over the messages for the given chat. + The default order is from newest to oldest, but this + behaviour can be changed with the `reverse` parameter. + If either `search`, `filter` or `from_user` are provided, :tl:`messages.Search` will be used instead of :tl:`messages.getHistory`.