From 7c48857d0c8625d0626c19e2af7fe00c1823f460 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 18 Mar 2019 17:30:45 +0100 Subject: [PATCH] Update docs for send_file/timeouts and add new known error --- telethon/client/dialogs.py | 15 ++++++++------- telethon/client/messages.py | 8 ++++---- telethon/client/uploads.py | 4 +++- telethon/tl/custom/conversation.py | 4 ++-- telethon_generator/data/errors.csv | 1 + 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/telethon/client/dialogs.py b/telethon/client/dialogs.py index 049a960d..2983c503 100644 --- a/telethon/client/dialogs.py +++ b/telethon/client/dialogs.py @@ -180,15 +180,16 @@ class DialogMethods(UserMethods): The entity with which a new conversation should be opened. timeout (`int` | `float`, optional): - The default timeout *per action* to be used. You may also - override this timeout on a per-method basis. By default each - action can take up to 60 seconds (the value of this timeout). + The default timeout (in seconds) *per action* to be used. You + may also override this timeout on a per-method basis. By + default each action can take up to 60 seconds (the value of + this timeout). total_timeout (`int` | `float`, optional): - The total timeout to use for the whole conversation. This - takes priority over per-action timeouts. After these many - seconds pass, subsequent actions will result in - ``asyncio.TimeoutError``. + The total timeout (in seconds) to use for the whole + conversation. This takes priority over per-action + timeouts. After these many seconds pass, subsequent + actions will result in ``asyncio.TimeoutError``. max_messages (`int`, optional): The maximum amount of messages this conversation will diff --git a/telethon/client/messages.py b/telethon/client/messages.py index 02b0d83c..0bdf128b 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -343,10 +343,10 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods): This parameter will be ignored if it is not an user. wait_time (`int`): - Wait time between different :tl:`GetHistoryRequest`. Use this - parameter to avoid hitting the ``FloodWaitError`` as needed. - If left to ``None``, it will default to 1 second only if - the limit is higher than 3000. + Wait time (in seconds) between different + :tl:`GetHistoryRequest`. Use this parameter to avoid hitting + the ``FloodWaitError`` as needed. If left to ``None``, it will + default to 1 second only if the limit is higher than 3000. ids (`int`, `list`): A single integer ID (or several IDs) for the message that diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py index b8ffed27..6f4edd04 100644 --- a/telethon/client/uploads.py +++ b/telethon/client/uploads.py @@ -130,7 +130,9 @@ class UploadMethods(ButtonMethods, MessageParseMethods, UserMethods): in chunks of 10 if more than 10 are given. caption (`str`, optional): - Optional caption for the sent media message. + Optional caption for the sent media message. When sending an + album, the caption may be a list of strings, which will be + assigned to the files pairwise. force_document (`bool`, optional): If left to ``False`` and the file is a path that ends with diff --git a/telethon/tl/custom/conversation.py b/telethon/tl/custom/conversation.py index 344407fc..e3147803 100644 --- a/telethon/tl/custom/conversation.py +++ b/telethon/tl/custom/conversation.py @@ -123,7 +123,7 @@ class Conversation(ChatGetter): is expected. By default this is the last sent message. timeout (`int` | `float`, optional): - If present, this `timeout` will override the + If present, this `timeout` (in seconds) will override the per-action timeout defined for the conversation. """ return await self._get_message( @@ -161,7 +161,7 @@ class Conversation(ChatGetter): once `condition` is met. timeout (`int`): - The timeout override to use for this operation. + The timeout (in seconds) override to use for this operation. condition (`callable`): The condition callable that checks if an incoming diff --git a/telethon_generator/data/errors.csv b/telethon_generator/data/errors.csv index 5eb22baf..bebc0bca 100644 --- a/telethon_generator/data/errors.csv +++ b/telethon_generator/data/errors.csv @@ -230,6 +230,7 @@ TTL_DAYS_INVALID,400,The provided TTL is invalid TYPES_EMPTY,400,The types field is empty TYPE_CONSTRUCTOR_INVALID,,The type constructor is invalid UNKNOWN_METHOD,500,The method you tried to call cannot be called on non-CDN DCs +UNTIL_DATE_INVALID,400,That date cannot be specified in this request (try using None) URL_INVALID,400,The URL used was invalid (e.g. when answering a callback with an URL that's not t.me/yourbot or your game's URL) USERNAME_INVALID,400,"Nobody is using this username, or the username is unacceptable. If the latter, it must match r""[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]""" USERNAME_NOT_MODIFIED,400,The username is not different from the current username