From 0340271b33d98a25ed5ff2e47dfa81b5f36cfde5 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 30 May 2019 15:23:43 +0200 Subject: [PATCH] Refactor docstrings --- pyrogram/client/client.py | 8 +++---- pyrogram/client/filters/filters.py | 8 +++---- .../client/handlers/callback_query_handler.py | 4 ++-- .../handlers/deleted_messages_handler.py | 4 ++-- .../client/handlers/disconnect_handler.py | 4 ++-- .../client/handlers/inline_query_handler.py | 4 ++-- pyrogram/client/handlers/message_handler.py | 5 ++--- pyrogram/client/handlers/poll_handler.py | 10 ++++----- .../client/handlers/raw_update_handler.py | 6 +++--- .../client/handlers/user_status_handler.py | 4 ++-- .../methods/chats/export_chat_invite_link.py | 4 ++-- .../client/methods/chats/get_chat_members.py | 2 +- pyrogram/client/methods/chats/get_dialogs.py | 2 +- .../client/methods/chats/iter_chat_members.py | 2 +- pyrogram/client/methods/chats/iter_dialogs.py | 5 +++-- .../client/methods/chats/set_chat_photo.py | 2 +- .../methods/chats/update_chat_username.py | 2 +- .../methods/decorators/on_callback_query.py | 2 +- .../methods/decorators/on_deleted_messages.py | 2 +- .../methods/decorators/on_disconnect.py | 2 +- .../methods/decorators/on_inline_query.py | 2 +- .../client/methods/decorators/on_message.py | 2 +- pyrogram/client/methods/decorators/on_poll.py | 4 ++-- .../methods/decorators/on_raw_update.py | 2 +- .../methods/decorators/on_user_status.py | 2 +- .../client/methods/messages/download_media.py | 2 +- .../client/methods/messages/get_history.py | 2 +- .../client/methods/messages/iter_history.py | 5 +++-- .../client/methods/messages/send_animation.py | 2 +- .../client/methods/messages/send_audio.py | 2 +- .../client/methods/messages/send_document.py | 2 +- .../client/methods/messages/send_photo.py | 2 +- .../client/methods/messages/send_sticker.py | 2 +- .../client/methods/messages/send_video.py | 2 +- .../methods/messages/send_video_note.py | 2 +- .../client/methods/messages/send_voice.py | 2 +- .../client/methods/users/update_username.py | 2 +- .../client/types/inline_mode/inline_query.py | 4 ++-- .../inline_query_result_article.py | 4 ++-- .../todo/inline_query_result_audio.py | 4 ++-- .../inline_query_result_cached_document.py | 4 ++-- .../todo/inline_query_result_cached_gif.py | 4 ++-- .../inline_query_result_cached_sticker.py | 4 ++-- .../todo/inline_query_result_cached_voice.py | 4 ++-- .../todo/inline_query_result_document.py | 4 ++-- .../todo/inline_query_result_game.py | 2 +- .../todo/inline_query_result_photo.py | 4 ++-- .../todo/inline_query_result_venue.py | 4 ++-- .../todo/inline_query_result_video.py | 4 ++-- .../todo/inline_query_result_voice.py | 4 ++-- .../types/input_media/input_phone_contact.py | 2 +- .../types/messages_and_media/message.py | 21 +++++++++---------- .../types/messages_and_media/messages.py | 2 +- pyrogram/client/types/user_and_chats/chat.py | 14 ++++++------- 54 files changed, 105 insertions(+), 105 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 468413b0..e93e3ff8 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -434,9 +434,9 @@ class Client(Methods, BaseClient): def run(self): """Start the Client and automatically idle the main script. - This is a convenience method that literally just calls :meth:`start` and :meth:`idle`. It makes running a client - less verbose, but is not suitable in case you want to run more than one client in a single main script, - since :meth:`idle` will block. + This is a convenience method that literally just calls :meth:`~Client.start` and :meth:`~Client.idle`. It makes + running a client less verbose, but is not suitable in case you want to run more than one client in a single main + script, since :meth:`~Client.idle` will block. Raises: RPCError: In case of a Telegram RPC error. @@ -472,7 +472,7 @@ class Client(Methods, BaseClient): """Remove a previously-registered update handler. Make sure to provide the right group that the handler was added in. You can use - the return value of the :meth:`add_handler` method, a tuple of (handler, group), and + the return value of the :meth:`~Client.add_handler` method, a tuple of (handler, group), and pass it directly. Parameters: diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index 169193a0..9c80d870 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -42,7 +42,7 @@ def create(name: str, func: callable, **kwargs) -> type: **kwargs (``any``, *optional*): Any keyword argument you would like to pass. Useful for custom filters that accept parameters (e.g.: - :meth:`Filters.command`, :meth:`Filters.regex`). + :meth:`~Filters.command`, :meth:`~Filters.regex`). """ # TODO: unpack kwargs using **kwargs into the dict itself. For Python 3.5+ only d = {"__call__": func} @@ -56,7 +56,7 @@ class Filters: The Filters listed here are intended to be used with the :obj:`MessageHandler` only. At the moment, if you want to filter updates coming from different `Handlers `_ you have to create - your own filters with :meth:`Filters.create` and use them in the same way. + your own filters with :meth:`~Filters.create` and use them in the same way. """ create = create @@ -219,7 +219,7 @@ class Filters: The command or list of commands as string the filter should look for. Examples: "start", ["start", "help", "settings"]. When a message text containing a command arrives, the command itself and its arguments will be stored in the *command* - field of the :class:`Message`. + field of the :obj:`Message`. prefix (``str`` | ``list``, *optional*): A prefix or a list of prefixes as string the filter should look for. @@ -263,7 +263,7 @@ class Filters: pattern (``str``): The RegEx pattern as string, it will be applied to the text of a message. When a pattern matches, all the `Match Objects `_ - are stored in the *matches* field of the :class:`Message` itself. + are stored in the *matches* field of the :obj:`Message` itself. flags (``int``, *optional*): RegEx flags. diff --git a/pyrogram/client/handlers/callback_query_handler.py b/pyrogram/client/handlers/callback_query_handler.py index feb46cb0..9e17296b 100644 --- a/pyrogram/client/handlers/callback_query_handler.py +++ b/pyrogram/client/handlers/callback_query_handler.py @@ -21,10 +21,10 @@ from .handler import Handler class CallbackQueryHandler(Handler): """The CallbackQuery handler class. Used to handle callback queries coming from inline buttons. - It is intended to be used with :meth:`add_handler() ` + It is intended to be used with :meth:`~Client.add_handler` For a nicer way to register this handler, have a look at the - :meth:`on_callback_query() ` decorator. + :meth:`~Client.on_callback_query` decorator. Parameters: callback (``callable``): diff --git a/pyrogram/client/handlers/deleted_messages_handler.py b/pyrogram/client/handlers/deleted_messages_handler.py index f37caaed..b6651fba 100644 --- a/pyrogram/client/handlers/deleted_messages_handler.py +++ b/pyrogram/client/handlers/deleted_messages_handler.py @@ -22,10 +22,10 @@ from .handler import Handler class DeletedMessagesHandler(Handler): """The deleted Messages handler class. Used to handle deleted messages coming from any chat (private, group, channel). It is intended to be used with - :meth:`add_handler() ` + :meth:`~Client.add_handler` For a nicer way to register this handler, have a look at the - :meth:`on_deleted_messages() ` decorator. + :meth:`~Client.on_deleted_messages` decorator. Parameters: callback (``callable``): diff --git a/pyrogram/client/handlers/disconnect_handler.py b/pyrogram/client/handlers/disconnect_handler.py index b9e6350a..1b4801b2 100644 --- a/pyrogram/client/handlers/disconnect_handler.py +++ b/pyrogram/client/handlers/disconnect_handler.py @@ -21,10 +21,10 @@ from .handler import Handler class DisconnectHandler(Handler): """The Disconnect handler class. Used to handle disconnections. It is intended to be used with - :meth:`add_handler() ` + :meth:~Client.add_handler` For a nicer way to register this handler, have a look at the - :meth:`on_disconnect() ` decorator. + :meth:`~Client.on_disconnect` decorator. Parameters: callback (``callable``): diff --git a/pyrogram/client/handlers/inline_query_handler.py b/pyrogram/client/handlers/inline_query_handler.py index 98a25652..dbd86df7 100644 --- a/pyrogram/client/handlers/inline_query_handler.py +++ b/pyrogram/client/handlers/inline_query_handler.py @@ -21,10 +21,10 @@ from .handler import Handler class InlineQueryHandler(Handler): """The InlineQuery handler class. Used to handle inline queries. - It is intended to be used with :meth:`add_handler() ` + It is intended to be used with :meth:`~Client.add_handler` For a nicer way to register this handler, have a look at the - :meth:`on_inline_query() ` decorator. + :meth:`~Client.on_inline_query` decorator. Parameters: callback (``callable``): diff --git a/pyrogram/client/handlers/message_handler.py b/pyrogram/client/handlers/message_handler.py index 10fff479..ea091ca4 100644 --- a/pyrogram/client/handlers/message_handler.py +++ b/pyrogram/client/handlers/message_handler.py @@ -21,11 +21,10 @@ from .handler import Handler class MessageHandler(Handler): """The Message handler class. Used to handle text, media and service messages coming from - any chat (private, group, channel). It is intended to be used with - :meth:`add_handler() ` + any chat (private, group, channel). It is intended to be used with :meth:`~Client.add_handler` For a nicer way to register this handler, have a look at the - :meth:`on_message() ` decorator. + :meth:`~Client.on_message` decorator. Parameters: callback (``callable``): diff --git a/pyrogram/client/handlers/poll_handler.py b/pyrogram/client/handlers/poll_handler.py index 9e97f2ac..d46fb5be 100644 --- a/pyrogram/client/handlers/poll_handler.py +++ b/pyrogram/client/handlers/poll_handler.py @@ -22,25 +22,25 @@ from .handler import Handler class PollHandler(Handler): """The Poll handler class. Used to handle polls updates. - It is intended to be used with :meth:`add_handler() ` + It is intended to be used with :meth:`~Client.add_handler` For a nicer way to register this handler, have a look at the - :meth:`on_poll() ` decorator. + :meth:`~Client.on_poll` decorator. Parameters: callback (``callable``): Pass a function that will be called when a new poll update arrives. It takes *(client, poll)* as positional arguments (look at the section below for a detailed description). - filters (:obj:`Filters `): + filters (:obj:`Filters`): Pass one or more filters to allow only a subset of polls to be passed in your callback function. Other parameters: - client (:obj:`Client `): + client (:obj:`Client`): The Client itself, useful when you want to call other API methods inside the poll handler. - poll (:obj:`Poll `): + poll (:obj:`Poll`): The received poll. """ diff --git a/pyrogram/client/handlers/raw_update_handler.py b/pyrogram/client/handlers/raw_update_handler.py index f54d59b6..485c6339 100644 --- a/pyrogram/client/handlers/raw_update_handler.py +++ b/pyrogram/client/handlers/raw_update_handler.py @@ -21,10 +21,10 @@ from .handler import Handler class RawUpdateHandler(Handler): """The Raw Update handler class. Used to handle raw updates. It is intended to be used with - :meth:`add_handler() ` + :meth:`~Client.add_handler` For a nicer way to register this handler, have a look at the - :meth:`on_raw_update() ` decorator. + :meth:`~Client.on_raw_update` decorator. Parameters: callback (``callable``): @@ -33,7 +33,7 @@ class RawUpdateHandler(Handler): a detailed description). Other Parameters: - client (:class:`Client`): + client (:obj:`Client`): The Client itself, useful when you want to call other API methods inside the update handler. update (``Update``): diff --git a/pyrogram/client/handlers/user_status_handler.py b/pyrogram/client/handlers/user_status_handler.py index 1250cb19..9b39aab6 100644 --- a/pyrogram/client/handlers/user_status_handler.py +++ b/pyrogram/client/handlers/user_status_handler.py @@ -21,10 +21,10 @@ from .handler import Handler class UserStatusHandler(Handler): """The UserStatus handler class. Used to handle user status updates (user going online or offline). - It is intended to be used with :meth:`add_handler() ` + It is intended to be used with :meth:`~Client.add_handler` For a nicer way to register this handler, have a look at the - :meth:`on_user_status() ` decorator. + :meth:`~Client.on_user_status` decorator. Parameters: callback (``callable``): diff --git a/pyrogram/client/methods/chats/export_chat_invite_link.py b/pyrogram/client/methods/chats/export_chat_invite_link.py index a223a000..26263d53 100644 --- a/pyrogram/client/methods/chats/export_chat_invite_link.py +++ b/pyrogram/client/methods/chats/export_chat_invite_link.py @@ -35,8 +35,8 @@ class ExportChatInviteLink(BaseClient): Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link - using this method – after this the link will become available to the bot via the :meth:`get_chat` method. - If your bot needs to generate a new invite link replacing its previous one, use this method again. + using this method – after this the link will become available to the bot via the :meth:`~Client.get_chat` + method. If your bot needs to generate a new invite link replacing its previous one, use this method again. Parameters: chat_id (``int`` | ``str``): diff --git a/pyrogram/client/methods/chats/get_chat_members.py b/pyrogram/client/methods/chats/get_chat_members.py index 10f76dcf..1c966f36 100644 --- a/pyrogram/client/methods/chats/get_chat_members.py +++ b/pyrogram/client/methods/chats/get_chat_members.py @@ -51,7 +51,7 @@ class GetChatMembers(BaseClient): You can get up to 200 chat members at once. A chat can be either a basic group, a supergroup or a channel. You must be admin to retrieve the members list of a channel (also known as "subscribers"). - For a more convenient way of getting chat members see :meth:`iter_chat_members`. + For a more convenient way of getting chat members see :meth:`~Client.iter_chat_members`. Parameters: chat_id (``int`` | ``str``): diff --git a/pyrogram/client/methods/chats/get_dialogs.py b/pyrogram/client/methods/chats/get_dialogs.py index 948a7642..8d5baa15 100644 --- a/pyrogram/client/methods/chats/get_dialogs.py +++ b/pyrogram/client/methods/chats/get_dialogs.py @@ -37,7 +37,7 @@ class GetDialogs(BaseClient): """Get a chunk of the user's dialogs. You can get up to 100 dialogs at once. - For a more convenient way of getting a user's dialogs see :meth:`iter_dialogs`. + For a more convenient way of getting a user's dialogs see :meth:`~Client.iter_dialogs`. Parameters: offset_date (``int``): diff --git a/pyrogram/client/methods/chats/iter_chat_members.py b/pyrogram/client/methods/chats/iter_chat_members.py index 330eed7b..961f6d98 100644 --- a/pyrogram/client/methods/chats/iter_chat_members.py +++ b/pyrogram/client/methods/chats/iter_chat_members.py @@ -47,7 +47,7 @@ class IterChatMembers(BaseClient): ) -> Generator["pyrogram.ChatMember", None, None]: """Iterate through the members of a chat sequentially. - This convenience method does the same as repeatedly calling :meth:`get_chat_members` in a loop, thus saving you + This convenience method does the same as repeatedly calling :meth:`~Client.get_chat_members` in a loop, thus saving you from the hassle of setting up boilerplate code. It is useful for getting the whole members list of a chat with a single call. diff --git a/pyrogram/client/methods/chats/iter_dialogs.py b/pyrogram/client/methods/chats/iter_dialogs.py index 976a49df..e7fb7330 100644 --- a/pyrogram/client/methods/chats/iter_dialogs.py +++ b/pyrogram/client/methods/chats/iter_dialogs.py @@ -30,8 +30,9 @@ class IterDialogs(BaseClient): ) -> Generator["pyrogram.Dialog", None, None]: """Iterate through a user's dialogs sequentially. - This convenience method does the same as repeatedly calling :meth:`get_dialogs` in a loop, thus saving you from - the hassle of setting up boilerplate code. It is useful for getting the whole dialogs list with a single call. + This convenience method does the same as repeatedly calling :meth:`~Client.get_dialogs` in a loop, thus saving + you from the hassle of setting up boilerplate code. It is useful for getting the whole dialogs list with a + single call. Parameters: offset_date (``int``): diff --git a/pyrogram/client/methods/chats/set_chat_photo.py b/pyrogram/client/methods/chats/set_chat_photo.py index 79cceb7e..2baa29fe 100644 --- a/pyrogram/client/methods/chats/set_chat_photo.py +++ b/pyrogram/client/methods/chats/set_chat_photo.py @@ -44,7 +44,7 @@ class SetChatPhoto(BaseClient): Unique identifier (int) or username (str) of the target chat. photo (``str``): - New chat photo. You can pass a :class:`Photo` id or a file path to upload a new photo. + New chat photo. You can pass a :obj:`Photo` id or a file path to upload a new photo. Returns: ``bool``: True on success. diff --git a/pyrogram/client/methods/chats/update_chat_username.py b/pyrogram/client/methods/chats/update_chat_username.py index de5015ea..d06cda61 100644 --- a/pyrogram/client/methods/chats/update_chat_username.py +++ b/pyrogram/client/methods/chats/update_chat_username.py @@ -30,7 +30,7 @@ class UpdateChatUsername(BaseClient): ) -> bool: """Update a channel or a supergroup username. - To update your own username (for users only, not bots) you can use :meth:`update_username`. + To update your own username (for users only, not bots) you can use :meth:`~Client.update_username`. Parameters: chat_id (``int`` | ``str``) diff --git a/pyrogram/client/methods/decorators/on_callback_query.py b/pyrogram/client/methods/decorators/on_callback_query.py index b76655fb..5057f59f 100644 --- a/pyrogram/client/methods/decorators/on_callback_query.py +++ b/pyrogram/client/methods/decorators/on_callback_query.py @@ -32,7 +32,7 @@ class OnCallbackQuery(BaseClient): ) -> callable: """Decorator for handling callback queries. - This does the same thing as :meth:`add_handler` using the :class:`CallbackQueryHandler`. + This does the same thing as :meth:`~Client.add_handler` using the :obj:`CallbackQueryHandler`. Parameters: filters (:obj:`Filters`): diff --git a/pyrogram/client/methods/decorators/on_deleted_messages.py b/pyrogram/client/methods/decorators/on_deleted_messages.py index 7637e6eb..53457b55 100644 --- a/pyrogram/client/methods/decorators/on_deleted_messages.py +++ b/pyrogram/client/methods/decorators/on_deleted_messages.py @@ -32,7 +32,7 @@ class OnDeletedMessages(BaseClient): ) -> callable: """Decorator for handling deleted messages. - This does the same thing as :meth:`add_handler` using the :class:`DeletedMessagesHandler`. + This does the same thing as :meth:`~Client.add_handler` using the :obj:`DeletedMessagesHandler`. Parameters: filters (:obj:`Filters`): diff --git a/pyrogram/client/methods/decorators/on_disconnect.py b/pyrogram/client/methods/decorators/on_disconnect.py index 9305808e..b195ac54 100644 --- a/pyrogram/client/methods/decorators/on_disconnect.py +++ b/pyrogram/client/methods/decorators/on_disconnect.py @@ -25,7 +25,7 @@ class OnDisconnect(BaseClient): def on_disconnect(self=None) -> callable: """Decorator for handling disconnections. - This does the same thing as :meth:`add_handler` using the :class:`DisconnectHandler`. + This does the same thing as :meth:`~Client.add_handler` using the :obj:`DisconnectHandler`. """ def decorator(func: callable) -> Handler: diff --git a/pyrogram/client/methods/decorators/on_inline_query.py b/pyrogram/client/methods/decorators/on_inline_query.py index 58837398..ee7175eb 100644 --- a/pyrogram/client/methods/decorators/on_inline_query.py +++ b/pyrogram/client/methods/decorators/on_inline_query.py @@ -32,7 +32,7 @@ class OnInlineQuery(BaseClient): ) -> callable: """Decorator for handling inline queries. - This does the same thing as :meth:`add_handler` using the :class:`InlineQueryHandler`. + This does the same thing as :meth:`~Client.add_handler` using the :obj:`InlineQueryHandler`. Parameters: filters (:obj:`Filters `): diff --git a/pyrogram/client/methods/decorators/on_message.py b/pyrogram/client/methods/decorators/on_message.py index f590fd12..0f5c836c 100644 --- a/pyrogram/client/methods/decorators/on_message.py +++ b/pyrogram/client/methods/decorators/on_message.py @@ -32,7 +32,7 @@ class OnMessage(BaseClient): ) -> callable: """Decorator for handling messages. - This does the same thing as :meth:`add_handler` using the :class:`MessageHandler`. + This does the same thing as :meth:`~Client.add_handler` using the :obj:`MessageHandler`. Parameters: filters (:obj:`Filters`): diff --git a/pyrogram/client/methods/decorators/on_poll.py b/pyrogram/client/methods/decorators/on_poll.py index de1c1d3d..7442858d 100644 --- a/pyrogram/client/methods/decorators/on_poll.py +++ b/pyrogram/client/methods/decorators/on_poll.py @@ -32,10 +32,10 @@ class OnPoll(BaseClient): ) -> callable: """Decorator for handling poll updates. - This does the same thing as :meth:`add_handler` using the :class:`PollHandler`. + This does the same thing as :meth:`~Client.add_handler` using the :obj:`PollHandler`. Parameters: - filters (:obj:`Filters `): + filters (:obj:`Filters`): Pass one or more filters to allow only a subset of polls to be passed in your function. diff --git a/pyrogram/client/methods/decorators/on_raw_update.py b/pyrogram/client/methods/decorators/on_raw_update.py index 53a0f4cf..e03402ca 100644 --- a/pyrogram/client/methods/decorators/on_raw_update.py +++ b/pyrogram/client/methods/decorators/on_raw_update.py @@ -30,7 +30,7 @@ class OnRawUpdate(BaseClient): ) -> callable: """Decorator for handling raw updates. - This does the same thing as :meth:`add_handler` using the :class:`RawUpdateHandler`. + This does the same thing as :meth:`~Client.add_handler` using the :obj:`RawUpdateHandler`. Parameters: group (``int``, *optional*): diff --git a/pyrogram/client/methods/decorators/on_user_status.py b/pyrogram/client/methods/decorators/on_user_status.py index e7db7b74..bcdcf024 100644 --- a/pyrogram/client/methods/decorators/on_user_status.py +++ b/pyrogram/client/methods/decorators/on_user_status.py @@ -31,7 +31,7 @@ class OnUserStatus(BaseClient): group: int = 0 ) -> callable: """Decorator for handling user status updates. - This does the same thing as :meth:`add_handler` using the :class:`UserStatusHandler`. + This does the same thing as :meth:`~Client.add_handler` using the :obj:`UserStatusHandler`. Parameters: filters (:obj:`Filters`): diff --git a/pyrogram/client/methods/messages/download_media.py b/pyrogram/client/methods/messages/download_media.py index bba5afd5..88c9c2d9 100644 --- a/pyrogram/client/methods/messages/download_media.py +++ b/pyrogram/client/methods/messages/download_media.py @@ -77,7 +77,7 @@ class DownloadMedia(BaseClient): Returns: ``str`` | ``None``: On success, the absolute path of the downloaded file is returned, otherwise, in case - the download failed or was deliberately stopped with :meth:`stop_transmission`, None is returned. + the download failed or was deliberately stopped with :meth:`~Client.stop_transmission`, None is returned. Raises: RPCError: In case of a Telegram RPC error. diff --git a/pyrogram/client/methods/messages/get_history.py b/pyrogram/client/methods/messages/get_history.py index 3933e729..c0810474 100644 --- a/pyrogram/client/methods/messages/get_history.py +++ b/pyrogram/client/methods/messages/get_history.py @@ -41,7 +41,7 @@ class GetHistory(BaseClient): """Retrieve a chunk of the history of a chat. You can get up to 100 messages at once. - For a more convenient way of getting a chat history see :meth:`iter_history`. + For a more convenient way of getting a chat history see :meth:`~Client.iter_history`. Parameters: chat_id (``int`` | ``str``): diff --git a/pyrogram/client/methods/messages/iter_history.py b/pyrogram/client/methods/messages/iter_history.py index 218dd7f5..57da3da5 100644 --- a/pyrogram/client/methods/messages/iter_history.py +++ b/pyrogram/client/methods/messages/iter_history.py @@ -34,8 +34,9 @@ class IterHistory(BaseClient): ) -> Generator["pyrogram.Message", None, None]: """Iterate through a chat history sequentially. - This convenience method does the same as repeatedly calling :meth:`get_history` in a loop, thus saving you from - the hassle of setting up boilerplate code. It is useful for getting the whole chat history with a single call. + This convenience method does the same as repeatedly calling :meth:`~Client.get_history` in a loop, thus saving + you from the hassle of setting up boilerplate code. It is useful for getting the whole chat history with a + single call. Parameters: chat_id (``int`` | ``str``): diff --git a/pyrogram/client/methods/messages/send_animation.py b/pyrogram/client/methods/messages/send_animation.py index 458e3b5f..8a4ec7bd 100644 --- a/pyrogram/client/methods/messages/send_animation.py +++ b/pyrogram/client/methods/messages/send_animation.py @@ -119,7 +119,7 @@ class SendAnimation(BaseClient): Returns: :obj:`Message` | ``None``: On success, the sent animation message is returned, otherwise, in case the upload - is deliberately stopped with :meth:`stop_transmission`, None is returned. + is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned. Raises: RPCError: In case of a Telegram RPC error. diff --git a/pyrogram/client/methods/messages/send_audio.py b/pyrogram/client/methods/messages/send_audio.py index 1c8f7ec5..7b218a66 100644 --- a/pyrogram/client/methods/messages/send_audio.py +++ b/pyrogram/client/methods/messages/send_audio.py @@ -121,7 +121,7 @@ class SendAudio(BaseClient): Returns: :obj:`Message` | ``None``: On success, the sent audio message is returned, otherwise, in case the upload - is deliberately stopped with :meth:`stop_transmission`, None is returned. + is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned. Raises: RPCError: In case of a Telegram RPC error. diff --git a/pyrogram/client/methods/messages/send_document.py b/pyrogram/client/methods/messages/send_document.py index ff523303..da012b2c 100644 --- a/pyrogram/client/methods/messages/send_document.py +++ b/pyrogram/client/methods/messages/send_document.py @@ -107,7 +107,7 @@ class SendDocument(BaseClient): Returns: :obj:`Message` | ``None``: On success, the sent document message is returned, otherwise, in case the upload - is deliberately stopped with :meth:`stop_transmission`, None is returned. + is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned. Raises: RPCError: In case of a Telegram RPC error. diff --git a/pyrogram/client/methods/messages/send_photo.py b/pyrogram/client/methods/messages/send_photo.py index 5e7cb35d..c1fd33d8 100644 --- a/pyrogram/client/methods/messages/send_photo.py +++ b/pyrogram/client/methods/messages/send_photo.py @@ -106,7 +106,7 @@ class SendPhoto(BaseClient): Returns: :obj:`Message` | ``None``: On success, the sent photo message is returned, otherwise, in case the upload - is deliberately stopped with :meth:`stop_transmission`, None is returned. + is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned. Raises: RPCError: In case of a Telegram RPC error. diff --git a/pyrogram/client/methods/messages/send_sticker.py b/pyrogram/client/methods/messages/send_sticker.py index 6a3d2b4b..4f7a99ff 100644 --- a/pyrogram/client/methods/messages/send_sticker.py +++ b/pyrogram/client/methods/messages/send_sticker.py @@ -91,7 +91,7 @@ class SendSticker(BaseClient): Returns: :obj:`Message` | ``None``: On success, the sent sticker message is returned, otherwise, in case the upload - is deliberately stopped with :meth:`stop_transmission`, None is returned. + is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned. Raises: RPCError: In case of a Telegram RPC error. """ diff --git a/pyrogram/client/methods/messages/send_video.py b/pyrogram/client/methods/messages/send_video.py index dc9229e8..4e1201fc 100644 --- a/pyrogram/client/methods/messages/send_video.py +++ b/pyrogram/client/methods/messages/send_video.py @@ -123,7 +123,7 @@ class SendVideo(BaseClient): Returns: :obj:`Message` | ``None``: On success, the sent video message is returned, otherwise, in case the upload - is deliberately stopped with :meth:`stop_transmission`, None is returned. + is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned. Raises: RPCError: In case of a Telegram RPC error. diff --git a/pyrogram/client/methods/messages/send_video_note.py b/pyrogram/client/methods/messages/send_video_note.py index 9372dd9a..7bb8803b 100644 --- a/pyrogram/client/methods/messages/send_video_note.py +++ b/pyrogram/client/methods/messages/send_video_note.py @@ -106,7 +106,7 @@ class SendVideoNote(BaseClient): Returns: :obj:`Message` | ``None``: On success, the sent video note message is returned, otherwise, in case the - pload is deliberately stopped with :meth:`stop_transmission`, None is returned. + pload is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned. Raises: RPCError: In case of a Telegram RPC error. diff --git a/pyrogram/client/methods/messages/send_voice.py b/pyrogram/client/methods/messages/send_voice.py index 759a5421..9dace1e0 100644 --- a/pyrogram/client/methods/messages/send_voice.py +++ b/pyrogram/client/methods/messages/send_voice.py @@ -104,7 +104,7 @@ class SendVoice(BaseClient): Returns: :obj:`Message` | ``None``: On success, the sent voice message is returned, otherwise, in case the upload - is deliberately stopped with :meth:`stop_transmission`, None is returned. + is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned. Raises: RPCError: In case of a Telegram RPC error. diff --git a/pyrogram/client/methods/users/update_username.py b/pyrogram/client/methods/users/update_username.py index 65b86174..002dbf75 100644 --- a/pyrogram/client/methods/users/update_username.py +++ b/pyrogram/client/methods/users/update_username.py @@ -31,7 +31,7 @@ class UpdateUsername(BaseClient): This method only works for users, not bots. Bot usernames must be changed via Bot Support or by recreating them from scratch using BotFather. To update a channel or supergroup username you can use - :meth:`update_chat_username`. + :meth:`~Client.update_chat_username`. Parameters: username (``str`` | ``None``): diff --git a/pyrogram/client/types/inline_mode/inline_query.py b/pyrogram/client/types/inline_mode/inline_query.py index 4d1c9a16..1985a0c0 100644 --- a/pyrogram/client/types/inline_mode/inline_query.py +++ b/pyrogram/client/types/inline_mode/inline_query.py @@ -92,7 +92,7 @@ class InlineQuery(PyrogramType, Update): switch_pm_text: str = "", switch_pm_parameter: str = "" ): - """Bound method *answer* of :obj:`InlineQuery `. + """Bound method *answer* of :obj:`InlineQuery`. Use this method as a shortcut for: @@ -109,7 +109,7 @@ class InlineQuery(PyrogramType, Update): inline_query.answer([...]) Parameters: - results (List of :obj:`InlineQueryResult `): + results (List of :obj:`InlineQueryResult`): A list of results for the inline query. cache_time (``int``, *optional*): diff --git a/pyrogram/client/types/inline_mode/inline_query_result_article.py b/pyrogram/client/types/inline_mode/inline_query_result_article.py index 8543eb4c..ad0be9e4 100644 --- a/pyrogram/client/types/inline_mode/inline_query_result_article.py +++ b/pyrogram/client/types/inline_mode/inline_query_result_article.py @@ -34,10 +34,10 @@ class InlineQueryResultArticle(InlineQueryResult): title (``str``): Title for the result. - input_message_content (:obj:`InputMessageContent `): + input_message_content (:obj:`InputMessageContent`): Content of the message to be sent. - reply_markup (:obj:`InlineKeyboardMarkup `, *optional*): + reply_markup (:obj:`InlineKeyboardMarkup`, *optional*): Inline keyboard attached to the message. url (``str``, *optional*): diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_audio.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_audio.py index 0ef30b20..6ca0478a 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_audio.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_audio.py @@ -50,10 +50,10 @@ class InlineQueryResultAudio(PyrogramType): audio_duration (``int`` ``32-bit``, optional): Audio duration in seconds. - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, optional): + input_message_content (:obj:`InputMessageContent`, optional): Content of the message to be sent instead of the audio. """ diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_document.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_document.py index e2873638..ad6cb9af 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_document.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_document.py @@ -47,10 +47,10 @@ class InlineQueryResultCachedDocument(PyrogramType): parse_mode (``str``, optional): Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, optional): + input_message_content (:obj:`InputMessageContent`, optional): Content of the message to be sent instead of the file. """ diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_gif.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_gif.py index 8b523dbd..1c836f20 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_gif.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_gif.py @@ -44,10 +44,10 @@ class InlineQueryResultCachedGif(PyrogramType): parse_mode (``str``, optional): Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, optional): + input_message_content (:obj:`InputMessageContent`, optional): Content of the message to be sent instead of the GIF animation. """ diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_sticker.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_sticker.py index 06944deb..4711cd72 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_sticker.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_sticker.py @@ -35,10 +35,10 @@ class InlineQueryResultCachedSticker(PyrogramType): sticker_file_id (``str``): A valid file identifier of the sticker. - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, optional): + input_message_content (:obj:`InputMessageContent`, optional): Content of the message to be sent instead of the sticker. """ diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_voice.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_voice.py index 3f8bb6a3..3091cf65 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_voice.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_voice.py @@ -44,10 +44,10 @@ class InlineQueryResultCachedVoice(PyrogramType): parse_mode (``str``, optional): Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, optional): + input_message_content (:obj:`InputMessageContent`, optional): Content of the message to be sent instead of the voice message. """ diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_document.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_document.py index 148ec01d..a95dd2e9 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_document.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_document.py @@ -50,10 +50,10 @@ class InlineQueryResultDocument(PyrogramType): description (``str``, optional): Short description of the result. - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, optional): + input_message_content (:obj:`InputMessageContent`, optional): Content of the message to be sent instead of the file. thumb_url (``str``, optional): diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_game.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_game.py index faebacea..98654463 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_game.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_game.py @@ -35,7 +35,7 @@ class InlineQueryResultGame(PyrogramType): game_short_name (``str``): Short name of the game. - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. """ diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_photo.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_photo.py index 3412b3f4..db6b9090 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_photo.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_photo.py @@ -54,10 +54,10 @@ class InlineQueryResultPhoto(PyrogramType): Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. - reply_markup (:obj:`InlineKeyboardMarkup `, *optional*): + reply_markup (:obj:`InlineKeyboardMarkup`, *optional*): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, *optional*): + input_message_content (:obj:`InputMessageContent`, *optional*): Content of the message to be sent instead of the photo. """ diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_venue.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_venue.py index 1dee9509..51ee8ae7 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_venue.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_venue.py @@ -50,10 +50,10 @@ class InlineQueryResultVenue(PyrogramType): foursquare_type (``str``, optional): Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".). - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, optional): + input_message_content (:obj:`InputMessageContent`, optional): Content of the message to be sent instead of the venue. thumb_url (``str``, optional): diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_video.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_video.py index 22d810e1..c8e27f79 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_video.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_video.py @@ -62,10 +62,10 @@ class InlineQueryResultVideo(PyrogramType): description (``str``, optional): Short description of the result. - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, optional): + input_message_content (:obj:`InputMessageContent`, optional): Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video). """ diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_voice.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_voice.py index 73d7fb1d..23cc741f 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_voice.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_voice.py @@ -47,10 +47,10 @@ class InlineQueryResultVoice(PyrogramType): voice_duration (``int`` ``32-bit``, optional): Recording duration in seconds. - reply_markup (:obj:`InlineKeyboardMarkup `, optional): + reply_markup (:obj:`InlineKeyboardMarkup`, optional): Inline keyboard attached to the message. - input_message_content (:obj:`InputMessageContent `, optional): + input_message_content (:obj:`InputMessageContent`, optional): Content of the message to be sent instead of the voice recording. """ diff --git a/pyrogram/client/types/input_media/input_phone_contact.py b/pyrogram/client/types/input_media/input_phone_contact.py index 0b6353b7..c1627516 100644 --- a/pyrogram/client/types/input_media/input_phone_contact.py +++ b/pyrogram/client/types/input_media/input_phone_contact.py @@ -23,7 +23,7 @@ from ..pyrogram_type import PyrogramType class InputPhoneContact(PyrogramType): """A Phone Contact to be added in your Telegram address book. - It is intended to be used with :meth:`add_contacts() ` + It is intended to be used with :meth:`~Client.add_contacts() ` Parameters: phone (``str``): diff --git a/pyrogram/client/types/messages_and_media/message.py b/pyrogram/client/types/messages_and_media/message.py index f8d161c2..c3a12f3e 100644 --- a/pyrogram/client/types/messages_and_media/message.py +++ b/pyrogram/client/types/messages_and_media/message.py @@ -834,7 +834,7 @@ class Message(PyrogramType, Update): Returns: On success, the sent :obj:`Message` is returned. - In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead. + In case the upload is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned instead. Raises: RPCError: In case of a Telegram RPC error. @@ -968,7 +968,7 @@ class Message(PyrogramType, Update): Returns: On success, the sent :obj:`Message` is returned. - In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead. + In case the upload is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned instead. Raises: RPCError: In case of a Telegram RPC error. @@ -1294,7 +1294,7 @@ class Message(PyrogramType, Update): Returns: On success, the sent :obj:`Message` is returned. - In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead. + In case the upload is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned instead. Raises: RPCError: In case of a Telegram RPC error. @@ -1686,7 +1686,7 @@ class Message(PyrogramType, Update): Returns: On success, the sent :obj:`Message` is returned. - In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead. + In case the upload is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned instead. Raises: RPCError: In case of a Telegram RPC error. @@ -1864,7 +1864,7 @@ class Message(PyrogramType, Update): Returns: On success, the sent :obj:`Message` is returned. - In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead. + In case the upload is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned instead. Raises: RPCError: In case of a Telegram RPC error. @@ -2094,7 +2094,7 @@ class Message(PyrogramType, Update): Returns: On success, the sent :obj:`Message` is returned. - In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead. + In case the upload is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned instead. Raises: RPCError: In case of a Telegram RPC error. @@ -2216,7 +2216,7 @@ class Message(PyrogramType, Update): Returns: On success, the sent :obj:`Message` is returned. - In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead. + In case the upload is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned instead. Raises: RPCError: In case of a Telegram RPC error. @@ -2332,7 +2332,7 @@ class Message(PyrogramType, Update): Returns: On success, the sent :obj:`Message` is returned. - In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead. + In case the upload is deliberately stopped with :meth:`~Client.stop_transmission`, None is returned instead. Raises: RPCError: In case of a Telegram RPC error. @@ -2778,9 +2778,8 @@ class Message(PyrogramType, Update): Timeout in seconds. Returns: - - The result of :meth:`request_callback_answer() ` in case of - inline callback button clicks. - - The result of :meth:`reply() ` in case of normal button clicks. + - The result of :meth:`~Client.request_callback_answer` in case of inline callback button clicks. + - The result of :meth:`~Message.reply()` in case of normal button clicks. - A string in case the inline button is a URL, a *switch_inline_query* or a *switch_inline_query_current_chat* button. diff --git a/pyrogram/client/types/messages_and_media/messages.py b/pyrogram/client/types/messages_and_media/messages.py index 379830be..f94f1951 100644 --- a/pyrogram/client/types/messages_and_media/messages.py +++ b/pyrogram/client/types/messages_and_media/messages.py @@ -146,7 +146,7 @@ class Messages(PyrogramType, Update): Defaults to False. Returns: - On success, a :class:`Messages` containing forwarded messages is returned. + On success, a :obj:`Messages` containing forwarded messages is returned. Raises: RPCError: In case of a Telegram RPC error. diff --git a/pyrogram/client/types/user_and_chats/chat.py b/pyrogram/client/types/user_and_chats/chat.py index 10cc10a7..e260d8cd 100644 --- a/pyrogram/client/types/user_and_chats/chat.py +++ b/pyrogram/client/types/user_and_chats/chat.py @@ -57,28 +57,28 @@ class Chat(PyrogramType): last_name (``str``, *optional*): Last name of the other party in a private chat, for private chats. - photo (:obj:`ChatPhoto `, *optional*): + photo (:obj:`ChatPhoto`, *optional*): Chat photo. Suitable for downloads only. description (``str``, *optional*): Bio, for private chats and bots or description for groups, supergroups and channels. - Returned only in :meth:`get_chat() `. + Returned only in :meth:`~Client.get_chat`. invite_link (``str``, *optional*): Chat invite link, for groups, supergroups and channels. - Returned only in :meth:`get_chat() `. + Returned only in :meth:`~Client.get_chat`. pinned_message (:obj:`Message`, *optional*): Pinned message, for groups, supergroups channels and own chat. - Returned only in :meth:`get_chat() `. + Returned only in :meth:`~Client.get_chat`. sticker_set_name (``str``, *optional*): For supergroups, name of group sticker set. - Returned only in :meth:`get_chat() `. + Returned only in :meth:`~Client.get_chat`. can_set_sticker_set (``bool``, *optional*): True, if the group sticker set can be changed by you. - Returned only in :meth:`get_chat() `. + Returned only in :meth:`~Client.get_chat`. members_count (``int``, *optional*): Chat members count, for groups, supergroups and channels only. @@ -87,7 +87,7 @@ class Chat(PyrogramType): The reason why this chat might be unavailable to some users. This field is available only in case *is_restricted* is True. - permissions (:obj:`ChatPermissions ` *optional*): + permissions (:obj:`ChatPermissions` *optional*): Information about the chat default permissions, for groups and supergroups. """