mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-26 20:07:27 +00:00
Refactor docstrings
This commit is contained in:
parent
715ae14751
commit
0340271b33
@ -434,9 +434,9 @@ class Client(Methods, BaseClient):
|
|||||||
def run(self):
|
def run(self):
|
||||||
"""Start the Client and automatically idle the main script.
|
"""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
|
This is a convenience method that literally just calls :meth:`~Client.start` and :meth:`~Client.idle`. It makes
|
||||||
less verbose, but is not suitable in case you want to run more than one client in a single main script,
|
running a client less verbose, but is not suitable in case you want to run more than one client in a single main
|
||||||
since :meth:`idle` will block.
|
script, since :meth:`~Client.idle` will block.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
@ -472,7 +472,7 @@ class Client(Methods, BaseClient):
|
|||||||
"""Remove a previously-registered update handler.
|
"""Remove a previously-registered update handler.
|
||||||
|
|
||||||
Make sure to provide the right group that the handler was added in. You can use
|
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.
|
pass it directly.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
@ -42,7 +42,7 @@ def create(name: str, func: callable, **kwargs) -> type:
|
|||||||
|
|
||||||
**kwargs (``any``, *optional*):
|
**kwargs (``any``, *optional*):
|
||||||
Any keyword argument you would like to pass. Useful for custom filters that accept parameters (e.g.:
|
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
|
# TODO: unpack kwargs using **kwargs into the dict itself. For Python 3.5+ only
|
||||||
d = {"__call__": func}
|
d = {"__call__": func}
|
||||||
@ -56,7 +56,7 @@ class Filters:
|
|||||||
|
|
||||||
The Filters listed here are intended to be used with the :obj:`MessageHandler` only.
|
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 <Handlers.html>`_ you have to create
|
At the moment, if you want to filter updates coming from different `Handlers <Handlers.html>`_ 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
|
create = create
|
||||||
@ -219,7 +219,7 @@ class Filters:
|
|||||||
The command or list of commands as string the filter should look for.
|
The command or list of commands as string the filter should look for.
|
||||||
Examples: "start", ["start", "help", "settings"]. When a message text containing
|
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*
|
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*):
|
prefix (``str`` | ``list``, *optional*):
|
||||||
A prefix or a list of prefixes as string the filter should look for.
|
A prefix or a list of prefixes as string the filter should look for.
|
||||||
@ -263,7 +263,7 @@ class Filters:
|
|||||||
pattern (``str``):
|
pattern (``str``):
|
||||||
The RegEx pattern as string, it will be applied to the text of a message. When a pattern matches,
|
The RegEx pattern as string, it will be applied to the text of a message. When a pattern matches,
|
||||||
all the `Match Objects <https://docs.python.org/3/library/re.html#match-objects>`_
|
all the `Match Objects <https://docs.python.org/3/library/re.html#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*):
|
flags (``int``, *optional*):
|
||||||
RegEx flags.
|
RegEx flags.
|
||||||
|
@ -21,10 +21,10 @@ from .handler import Handler
|
|||||||
|
|
||||||
class CallbackQueryHandler(Handler):
|
class CallbackQueryHandler(Handler):
|
||||||
"""The CallbackQuery handler class. Used to handle callback queries coming from inline buttons.
|
"""The CallbackQuery handler class. Used to handle callback queries coming from inline buttons.
|
||||||
It is intended to be used with :meth:`add_handler() <pyrogram.Client.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
|
For a nicer way to register this handler, have a look at the
|
||||||
:meth:`on_callback_query() <pyrogram.Client.on_callback_query>` decorator.
|
:meth:`~Client.on_callback_query` decorator.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
callback (``callable``):
|
callback (``callable``):
|
||||||
|
@ -22,10 +22,10 @@ from .handler import Handler
|
|||||||
class DeletedMessagesHandler(Handler):
|
class DeletedMessagesHandler(Handler):
|
||||||
"""The deleted Messages handler class. Used to handle deleted messages coming from any chat
|
"""The deleted Messages handler class. Used to handle deleted messages coming from any chat
|
||||||
(private, group, channel). It is intended to be used with
|
(private, group, channel). It is intended to be used with
|
||||||
:meth:`add_handler() <pyrogram.Client.add_handler>`
|
:meth:`~Client.add_handler`
|
||||||
|
|
||||||
For a nicer way to register this handler, have a look at the
|
For a nicer way to register this handler, have a look at the
|
||||||
:meth:`on_deleted_messages() <pyrogram.Client.on_deleted_messages>` decorator.
|
:meth:`~Client.on_deleted_messages` decorator.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
callback (``callable``):
|
callback (``callable``):
|
||||||
|
@ -21,10 +21,10 @@ from .handler import Handler
|
|||||||
|
|
||||||
class DisconnectHandler(Handler):
|
class DisconnectHandler(Handler):
|
||||||
"""The Disconnect handler class. Used to handle disconnections. It is intended to be used with
|
"""The Disconnect handler class. Used to handle disconnections. It is intended to be used with
|
||||||
:meth:`add_handler() <pyrogram.Client.add_handler>`
|
:meth:~Client.add_handler`
|
||||||
|
|
||||||
For a nicer way to register this handler, have a look at the
|
For a nicer way to register this handler, have a look at the
|
||||||
:meth:`on_disconnect() <pyrogram.Client.on_disconnect>` decorator.
|
:meth:`~Client.on_disconnect` decorator.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
callback (``callable``):
|
callback (``callable``):
|
||||||
|
@ -21,10 +21,10 @@ from .handler import Handler
|
|||||||
|
|
||||||
class InlineQueryHandler(Handler):
|
class InlineQueryHandler(Handler):
|
||||||
"""The InlineQuery handler class. Used to handle inline queries.
|
"""The InlineQuery handler class. Used to handle inline queries.
|
||||||
It is intended to be used with :meth:`add_handler() <pyrogram.Client.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
|
For a nicer way to register this handler, have a look at the
|
||||||
:meth:`on_inline_query() <pyrogram.Client.on_inline_query>` decorator.
|
:meth:`~Client.on_inline_query` decorator.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
callback (``callable``):
|
callback (``callable``):
|
||||||
|
@ -21,11 +21,10 @@ from .handler import Handler
|
|||||||
|
|
||||||
class MessageHandler(Handler):
|
class MessageHandler(Handler):
|
||||||
"""The Message handler class. Used to handle text, media and service messages coming from
|
"""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
|
any chat (private, group, channel). It is intended to be used with :meth:`~Client.add_handler`
|
||||||
:meth:`add_handler() <pyrogram.Client.add_handler>`
|
|
||||||
|
|
||||||
For a nicer way to register this handler, have a look at the
|
For a nicer way to register this handler, have a look at the
|
||||||
:meth:`on_message() <pyrogram.Client.on_message>` decorator.
|
:meth:`~Client.on_message` decorator.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
callback (``callable``):
|
callback (``callable``):
|
||||||
|
@ -22,25 +22,25 @@ from .handler import Handler
|
|||||||
class PollHandler(Handler):
|
class PollHandler(Handler):
|
||||||
"""The Poll handler class. Used to handle polls updates.
|
"""The Poll handler class. Used to handle polls updates.
|
||||||
|
|
||||||
It is intended to be used with :meth:`add_handler() <pyrogram.Client.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
|
For a nicer way to register this handler, have a look at the
|
||||||
:meth:`on_poll() <pyrogram.Client.on_poll>` decorator.
|
:meth:`~Client.on_poll` decorator.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
callback (``callable``):
|
callback (``callable``):
|
||||||
Pass a function that will be called when a new poll update arrives. It takes *(client, poll)*
|
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).
|
as positional arguments (look at the section below for a detailed description).
|
||||||
|
|
||||||
filters (:obj:`Filters <pyrogram.Filters>`):
|
filters (:obj:`Filters`):
|
||||||
Pass one or more filters to allow only a subset of polls to be passed
|
Pass one or more filters to allow only a subset of polls to be passed
|
||||||
in your callback function.
|
in your callback function.
|
||||||
|
|
||||||
Other parameters:
|
Other parameters:
|
||||||
client (:obj:`Client <pyrogram.Client>`):
|
client (:obj:`Client`):
|
||||||
The Client itself, useful when you want to call other API methods inside the poll handler.
|
The Client itself, useful when you want to call other API methods inside the poll handler.
|
||||||
|
|
||||||
poll (:obj:`Poll <pyrogram.Poll>`):
|
poll (:obj:`Poll`):
|
||||||
The received poll.
|
The received poll.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -21,10 +21,10 @@ from .handler import Handler
|
|||||||
|
|
||||||
class RawUpdateHandler(Handler):
|
class RawUpdateHandler(Handler):
|
||||||
"""The Raw Update handler class. Used to handle raw updates. It is intended to be used with
|
"""The Raw Update handler class. Used to handle raw updates. It is intended to be used with
|
||||||
:meth:`add_handler() <pyrogram.Client.add_handler>`
|
:meth:`~Client.add_handler`
|
||||||
|
|
||||||
For a nicer way to register this handler, have a look at the
|
For a nicer way to register this handler, have a look at the
|
||||||
:meth:`on_raw_update() <pyrogram.Client.on_raw_update>` decorator.
|
:meth:`~Client.on_raw_update` decorator.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
callback (``callable``):
|
callback (``callable``):
|
||||||
@ -33,7 +33,7 @@ class RawUpdateHandler(Handler):
|
|||||||
a detailed description).
|
a detailed description).
|
||||||
|
|
||||||
Other Parameters:
|
Other Parameters:
|
||||||
client (:class:`Client`):
|
client (:obj:`Client`):
|
||||||
The Client itself, useful when you want to call other API methods inside the update handler.
|
The Client itself, useful when you want to call other API methods inside the update handler.
|
||||||
|
|
||||||
update (``Update``):
|
update (``Update``):
|
||||||
|
@ -21,10 +21,10 @@ from .handler import Handler
|
|||||||
|
|
||||||
class UserStatusHandler(Handler):
|
class UserStatusHandler(Handler):
|
||||||
"""The UserStatus handler class. Used to handle user status updates (user going online or offline).
|
"""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() <pyrogram.Client.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
|
For a nicer way to register this handler, have a look at the
|
||||||
:meth:`on_user_status() <pyrogram.Client.on_user_status>` decorator.
|
:meth:`~Client.on_user_status` decorator.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
callback (``callable``):
|
callback (``callable``):
|
||||||
|
@ -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
|
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
|
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.
|
using this method – after this the link will become available to the bot via the :meth:`~Client.get_chat`
|
||||||
If your bot needs to generate a new invite link replacing its previous one, use this method again.
|
method. If your bot needs to generate a new invite link replacing its previous one, use this method again.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
chat_id (``int`` | ``str``):
|
chat_id (``int`` | ``str``):
|
||||||
|
@ -51,7 +51,7 @@ class GetChatMembers(BaseClient):
|
|||||||
You can get up to 200 chat members at once.
|
You can get up to 200 chat members at once.
|
||||||
A chat can be either a basic group, a supergroup or a channel.
|
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").
|
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:
|
Parameters:
|
||||||
chat_id (``int`` | ``str``):
|
chat_id (``int`` | ``str``):
|
||||||
|
@ -37,7 +37,7 @@ class GetDialogs(BaseClient):
|
|||||||
"""Get a chunk of the user's dialogs.
|
"""Get a chunk of the user's dialogs.
|
||||||
|
|
||||||
You can get up to 100 dialogs at once.
|
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:
|
Parameters:
|
||||||
offset_date (``int``):
|
offset_date (``int``):
|
||||||
|
@ -47,7 +47,7 @@ class IterChatMembers(BaseClient):
|
|||||||
) -> Generator["pyrogram.ChatMember", None, None]:
|
) -> Generator["pyrogram.ChatMember", None, None]:
|
||||||
"""Iterate through the members of a chat sequentially.
|
"""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
|
from the hassle of setting up boilerplate code. It is useful for getting the whole members list of a chat with
|
||||||
a single call.
|
a single call.
|
||||||
|
|
||||||
|
@ -30,8 +30,9 @@ class IterDialogs(BaseClient):
|
|||||||
) -> Generator["pyrogram.Dialog", None, None]:
|
) -> Generator["pyrogram.Dialog", None, None]:
|
||||||
"""Iterate through a user's dialogs sequentially.
|
"""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
|
This convenience method does the same as repeatedly calling :meth:`~Client.get_dialogs` in a loop, thus saving
|
||||||
the hassle of setting up boilerplate code. It is useful for getting the whole dialogs list with a single call.
|
you from the hassle of setting up boilerplate code. It is useful for getting the whole dialogs list with a
|
||||||
|
single call.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
offset_date (``int``):
|
offset_date (``int``):
|
||||||
|
@ -44,7 +44,7 @@ class SetChatPhoto(BaseClient):
|
|||||||
Unique identifier (int) or username (str) of the target chat.
|
Unique identifier (int) or username (str) of the target chat.
|
||||||
|
|
||||||
photo (``str``):
|
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:
|
Returns:
|
||||||
``bool``: True on success.
|
``bool``: True on success.
|
||||||
|
@ -30,7 +30,7 @@ class UpdateChatUsername(BaseClient):
|
|||||||
) -> bool:
|
) -> bool:
|
||||||
"""Update a channel or a supergroup username.
|
"""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:
|
Parameters:
|
||||||
chat_id (``int`` | ``str``)
|
chat_id (``int`` | ``str``)
|
||||||
|
@ -32,7 +32,7 @@ class OnCallbackQuery(BaseClient):
|
|||||||
) -> callable:
|
) -> callable:
|
||||||
"""Decorator for handling callback queries.
|
"""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:
|
Parameters:
|
||||||
filters (:obj:`Filters`):
|
filters (:obj:`Filters`):
|
||||||
|
@ -32,7 +32,7 @@ class OnDeletedMessages(BaseClient):
|
|||||||
) -> callable:
|
) -> callable:
|
||||||
"""Decorator for handling deleted messages.
|
"""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:
|
Parameters:
|
||||||
filters (:obj:`Filters`):
|
filters (:obj:`Filters`):
|
||||||
|
@ -25,7 +25,7 @@ class OnDisconnect(BaseClient):
|
|||||||
def on_disconnect(self=None) -> callable:
|
def on_disconnect(self=None) -> callable:
|
||||||
"""Decorator for handling disconnections.
|
"""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:
|
def decorator(func: callable) -> Handler:
|
||||||
|
@ -32,7 +32,7 @@ class OnInlineQuery(BaseClient):
|
|||||||
) -> callable:
|
) -> callable:
|
||||||
"""Decorator for handling inline queries.
|
"""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:
|
Parameters:
|
||||||
filters (:obj:`Filters <pyrogram.Filters>`):
|
filters (:obj:`Filters <pyrogram.Filters>`):
|
||||||
|
@ -32,7 +32,7 @@ class OnMessage(BaseClient):
|
|||||||
) -> callable:
|
) -> callable:
|
||||||
"""Decorator for handling messages.
|
"""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:
|
Parameters:
|
||||||
filters (:obj:`Filters`):
|
filters (:obj:`Filters`):
|
||||||
|
@ -32,10 +32,10 @@ class OnPoll(BaseClient):
|
|||||||
) -> callable:
|
) -> callable:
|
||||||
"""Decorator for handling poll updates.
|
"""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:
|
Parameters:
|
||||||
filters (:obj:`Filters <pyrogram.Filters>`):
|
filters (:obj:`Filters`):
|
||||||
Pass one or more filters to allow only a subset of polls to be passed
|
Pass one or more filters to allow only a subset of polls to be passed
|
||||||
in your function.
|
in your function.
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class OnRawUpdate(BaseClient):
|
|||||||
) -> callable:
|
) -> callable:
|
||||||
"""Decorator for handling raw updates.
|
"""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:
|
Parameters:
|
||||||
group (``int``, *optional*):
|
group (``int``, *optional*):
|
||||||
|
@ -31,7 +31,7 @@ class OnUserStatus(BaseClient):
|
|||||||
group: int = 0
|
group: int = 0
|
||||||
) -> callable:
|
) -> callable:
|
||||||
"""Decorator for handling user status updates.
|
"""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:
|
Parameters:
|
||||||
filters (:obj:`Filters`):
|
filters (:obj:`Filters`):
|
||||||
|
@ -77,7 +77,7 @@ class DownloadMedia(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
``str`` | ``None``: On success, the absolute path of the downloaded file is returned, otherwise, in case
|
``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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
@ -41,7 +41,7 @@ class GetHistory(BaseClient):
|
|||||||
"""Retrieve a chunk of the history of a chat.
|
"""Retrieve a chunk of the history of a chat.
|
||||||
|
|
||||||
You can get up to 100 messages at once.
|
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:
|
Parameters:
|
||||||
chat_id (``int`` | ``str``):
|
chat_id (``int`` | ``str``):
|
||||||
|
@ -34,8 +34,9 @@ class IterHistory(BaseClient):
|
|||||||
) -> Generator["pyrogram.Message", None, None]:
|
) -> Generator["pyrogram.Message", None, None]:
|
||||||
"""Iterate through a chat history sequentially.
|
"""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
|
This convenience method does the same as repeatedly calling :meth:`~Client.get_history` in a loop, thus saving
|
||||||
the hassle of setting up boilerplate code. It is useful for getting the whole chat history with a single call.
|
you from the hassle of setting up boilerplate code. It is useful for getting the whole chat history with a
|
||||||
|
single call.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
chat_id (``int`` | ``str``):
|
chat_id (``int`` | ``str``):
|
||||||
|
@ -119,7 +119,7 @@ class SendAnimation(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`Message` | ``None``: On success, the sent animation message is returned, otherwise, in case the upload
|
: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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
@ -121,7 +121,7 @@ class SendAudio(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`Message` | ``None``: On success, the sent audio message is returned, otherwise, in case the upload
|
: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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
@ -107,7 +107,7 @@ class SendDocument(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`Message` | ``None``: On success, the sent document message is returned, otherwise, in case the upload
|
: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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
@ -106,7 +106,7 @@ class SendPhoto(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`Message` | ``None``: On success, the sent photo message is returned, otherwise, in case the upload
|
: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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
@ -91,7 +91,7 @@ class SendSticker(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`Message` | ``None``: On success, the sent sticker message is returned, otherwise, in case the upload
|
: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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
|
@ -123,7 +123,7 @@ class SendVideo(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`Message` | ``None``: On success, the sent video message is returned, otherwise, in case the upload
|
: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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
@ -106,7 +106,7 @@ class SendVideoNote(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`Message` | ``None``: On success, the sent video note message is returned, otherwise, in case the
|
: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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
@ -104,7 +104,7 @@ class SendVoice(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`Message` | ``None``: On success, the sent voice message is returned, otherwise, in case the upload
|
: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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
@ -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
|
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
|
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:
|
Parameters:
|
||||||
username (``str`` | ``None``):
|
username (``str`` | ``None``):
|
||||||
|
@ -92,7 +92,7 @@ class InlineQuery(PyrogramType, Update):
|
|||||||
switch_pm_text: str = "",
|
switch_pm_text: str = "",
|
||||||
switch_pm_parameter: str = ""
|
switch_pm_parameter: str = ""
|
||||||
):
|
):
|
||||||
"""Bound method *answer* of :obj:`InlineQuery <pyrogram.InlineQuery>`.
|
"""Bound method *answer* of :obj:`InlineQuery`.
|
||||||
|
|
||||||
Use this method as a shortcut for:
|
Use this method as a shortcut for:
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ class InlineQuery(PyrogramType, Update):
|
|||||||
inline_query.answer([...])
|
inline_query.answer([...])
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
results (List of :obj:`InlineQueryResult <pyrogram.InlineQueryResult>`):
|
results (List of :obj:`InlineQueryResult`):
|
||||||
A list of results for the inline query.
|
A list of results for the inline query.
|
||||||
|
|
||||||
cache_time (``int``, *optional*):
|
cache_time (``int``, *optional*):
|
||||||
|
@ -34,10 +34,10 @@ class InlineQueryResultArticle(InlineQueryResult):
|
|||||||
title (``str``):
|
title (``str``):
|
||||||
Title for the result.
|
Title for the result.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.InputMessageContent>`):
|
input_message_content (:obj:`InputMessageContent`):
|
||||||
Content of the message to be sent.
|
Content of the message to be sent.
|
||||||
|
|
||||||
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.InlineKeyboardMarkup>`, *optional*):
|
reply_markup (:obj:`InlineKeyboardMarkup`, *optional*):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
url (``str``, *optional*):
|
url (``str``, *optional*):
|
||||||
|
@ -50,10 +50,10 @@ class InlineQueryResultAudio(PyrogramType):
|
|||||||
audio_duration (``int`` ``32-bit``, optional):
|
audio_duration (``int`` ``32-bit``, optional):
|
||||||
Audio duration in seconds.
|
Audio duration in seconds.
|
||||||
|
|
||||||
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
|
input_message_content (:obj:`InputMessageContent`, optional):
|
||||||
Content of the message to be sent instead of the audio.
|
Content of the message to be sent instead of the audio.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -47,10 +47,10 @@ class InlineQueryResultCachedDocument(PyrogramType):
|
|||||||
parse_mode (``str``, optional):
|
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.
|
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 <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
|
input_message_content (:obj:`InputMessageContent`, optional):
|
||||||
Content of the message to be sent instead of the file.
|
Content of the message to be sent instead of the file.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -44,10 +44,10 @@ class InlineQueryResultCachedGif(PyrogramType):
|
|||||||
parse_mode (``str``, optional):
|
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.
|
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 <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
|
input_message_content (:obj:`InputMessageContent`, optional):
|
||||||
Content of the message to be sent instead of the GIF animation.
|
Content of the message to be sent instead of the GIF animation.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -35,10 +35,10 @@ class InlineQueryResultCachedSticker(PyrogramType):
|
|||||||
sticker_file_id (``str``):
|
sticker_file_id (``str``):
|
||||||
A valid file identifier of the sticker.
|
A valid file identifier of the sticker.
|
||||||
|
|
||||||
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
|
input_message_content (:obj:`InputMessageContent`, optional):
|
||||||
Content of the message to be sent instead of the sticker.
|
Content of the message to be sent instead of the sticker.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -44,10 +44,10 @@ class InlineQueryResultCachedVoice(PyrogramType):
|
|||||||
parse_mode (``str``, optional):
|
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.
|
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 <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
|
input_message_content (:obj:`InputMessageContent`, optional):
|
||||||
Content of the message to be sent instead of the voice message.
|
Content of the message to be sent instead of the voice message.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -50,10 +50,10 @@ class InlineQueryResultDocument(PyrogramType):
|
|||||||
description (``str``, optional):
|
description (``str``, optional):
|
||||||
Short description of the result.
|
Short description of the result.
|
||||||
|
|
||||||
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
|
input_message_content (:obj:`InputMessageContent`, optional):
|
||||||
Content of the message to be sent instead of the file.
|
Content of the message to be sent instead of the file.
|
||||||
|
|
||||||
thumb_url (``str``, optional):
|
thumb_url (``str``, optional):
|
||||||
|
@ -35,7 +35,7 @@ class InlineQueryResultGame(PyrogramType):
|
|||||||
game_short_name (``str``):
|
game_short_name (``str``):
|
||||||
Short name of the game.
|
Short name of the game.
|
||||||
|
|
||||||
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -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
|
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in
|
||||||
the media caption.
|
the media caption.
|
||||||
|
|
||||||
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, *optional*):
|
reply_markup (:obj:`InlineKeyboardMarkup`, *optional*):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, *optional*):
|
input_message_content (:obj:`InputMessageContent`, *optional*):
|
||||||
Content of the message to be sent instead of the photo.
|
Content of the message to be sent instead of the photo.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -50,10 +50,10 @@ class InlineQueryResultVenue(PyrogramType):
|
|||||||
foursquare_type (``str``, optional):
|
foursquare_type (``str``, optional):
|
||||||
Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".).
|
Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".).
|
||||||
|
|
||||||
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
|
input_message_content (:obj:`InputMessageContent`, optional):
|
||||||
Content of the message to be sent instead of the venue.
|
Content of the message to be sent instead of the venue.
|
||||||
|
|
||||||
thumb_url (``str``, optional):
|
thumb_url (``str``, optional):
|
||||||
|
@ -62,10 +62,10 @@ class InlineQueryResultVideo(PyrogramType):
|
|||||||
description (``str``, optional):
|
description (``str``, optional):
|
||||||
Short description of the result.
|
Short description of the result.
|
||||||
|
|
||||||
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.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).
|
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).
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -47,10 +47,10 @@ class InlineQueryResultVoice(PyrogramType):
|
|||||||
voice_duration (``int`` ``32-bit``, optional):
|
voice_duration (``int`` ``32-bit``, optional):
|
||||||
Recording duration in seconds.
|
Recording duration in seconds.
|
||||||
|
|
||||||
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
|
reply_markup (:obj:`InlineKeyboardMarkup`, optional):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
|
input_message_content (:obj:`InputMessageContent`, optional):
|
||||||
Content of the message to be sent instead of the voice recording.
|
Content of the message to be sent instead of the voice recording.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -23,7 +23,7 @@ from ..pyrogram_type import PyrogramType
|
|||||||
|
|
||||||
class InputPhoneContact(PyrogramType):
|
class InputPhoneContact(PyrogramType):
|
||||||
"""A Phone Contact to be added in your Telegram address book.
|
"""A Phone Contact to be added in your Telegram address book.
|
||||||
It is intended to be used with :meth:`add_contacts() <pyrogram.Client.add_contacts>`
|
It is intended to be used with :meth:`~Client.add_contacts() <pyrogram.Client.add_contacts>`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
phone (``str``):
|
phone (``str``):
|
||||||
|
@ -834,7 +834,7 @@ class Message(PyrogramType, Update):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, the sent :obj:`Message` is returned.
|
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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
@ -968,7 +968,7 @@ class Message(PyrogramType, Update):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, the sent :obj:`Message` is returned.
|
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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
@ -1294,7 +1294,7 @@ class Message(PyrogramType, Update):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, the sent :obj:`Message` is returned.
|
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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
@ -1686,7 +1686,7 @@ class Message(PyrogramType, Update):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, the sent :obj:`Message` is returned.
|
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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
@ -1864,7 +1864,7 @@ class Message(PyrogramType, Update):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, the sent :obj:`Message` is returned.
|
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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
@ -2094,7 +2094,7 @@ class Message(PyrogramType, Update):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, the sent :obj:`Message` is returned.
|
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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
@ -2216,7 +2216,7 @@ class Message(PyrogramType, Update):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, the sent :obj:`Message` is returned.
|
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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
@ -2332,7 +2332,7 @@ class Message(PyrogramType, Update):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, the sent :obj:`Message` is returned.
|
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:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
@ -2778,9 +2778,8 @@ class Message(PyrogramType, Update):
|
|||||||
Timeout in seconds.
|
Timeout in seconds.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
- The result of :meth:`request_callback_answer() <pyrogram.Client.request_callback_answer>` in case of
|
- The result of :meth:`~Client.request_callback_answer` in case of inline callback button clicks.
|
||||||
inline callback button clicks.
|
- The result of :meth:`~Message.reply()` in case of normal button clicks.
|
||||||
- The result of :meth:`reply() <pyrogram.Message.reply>` in case of normal button clicks.
|
|
||||||
- A string in case the inline button is a URL, a *switch_inline_query* or a
|
- A string in case the inline button is a URL, a *switch_inline_query* or a
|
||||||
*switch_inline_query_current_chat* button.
|
*switch_inline_query_current_chat* button.
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ class Messages(PyrogramType, Update):
|
|||||||
Defaults to False.
|
Defaults to False.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, a :class:`Messages` containing forwarded messages is returned.
|
On success, a :obj:`Messages` containing forwarded messages is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
RPCError: In case of a Telegram RPC error.
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
@ -57,28 +57,28 @@ class Chat(PyrogramType):
|
|||||||
last_name (``str``, *optional*):
|
last_name (``str``, *optional*):
|
||||||
Last name of the other party in a private chat, for private chats.
|
Last name of the other party in a private chat, for private chats.
|
||||||
|
|
||||||
photo (:obj:`ChatPhoto <pyrogram.ChatPhoto>`, *optional*):
|
photo (:obj:`ChatPhoto`, *optional*):
|
||||||
Chat photo. Suitable for downloads only.
|
Chat photo. Suitable for downloads only.
|
||||||
|
|
||||||
description (``str``, *optional*):
|
description (``str``, *optional*):
|
||||||
Bio, for private chats and bots or description for groups, supergroups and channels.
|
Bio, for private chats and bots or description for groups, supergroups and channels.
|
||||||
Returned only in :meth:`get_chat() <pyrogram.Client.get_chat>`.
|
Returned only in :meth:`~Client.get_chat`.
|
||||||
|
|
||||||
invite_link (``str``, *optional*):
|
invite_link (``str``, *optional*):
|
||||||
Chat invite link, for groups, supergroups and channels.
|
Chat invite link, for groups, supergroups and channels.
|
||||||
Returned only in :meth:`get_chat() <pyrogram.Client.get_chat>`.
|
Returned only in :meth:`~Client.get_chat`.
|
||||||
|
|
||||||
pinned_message (:obj:`Message`, *optional*):
|
pinned_message (:obj:`Message`, *optional*):
|
||||||
Pinned message, for groups, supergroups channels and own chat.
|
Pinned message, for groups, supergroups channels and own chat.
|
||||||
Returned only in :meth:`get_chat() <pyrogram.Client.get_chat>`.
|
Returned only in :meth:`~Client.get_chat`.
|
||||||
|
|
||||||
sticker_set_name (``str``, *optional*):
|
sticker_set_name (``str``, *optional*):
|
||||||
For supergroups, name of group sticker set.
|
For supergroups, name of group sticker set.
|
||||||
Returned only in :meth:`get_chat() <pyrogram.Client.get_chat>`.
|
Returned only in :meth:`~Client.get_chat`.
|
||||||
|
|
||||||
can_set_sticker_set (``bool``, *optional*):
|
can_set_sticker_set (``bool``, *optional*):
|
||||||
True, if the group sticker set can be changed by you.
|
True, if the group sticker set can be changed by you.
|
||||||
Returned only in :meth:`get_chat() <pyrogram.Client.get_chat>`.
|
Returned only in :meth:`~Client.get_chat`.
|
||||||
|
|
||||||
members_count (``int``, *optional*):
|
members_count (``int``, *optional*):
|
||||||
Chat members count, for groups, supergroups and channels only.
|
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.
|
The reason why this chat might be unavailable to some users.
|
||||||
This field is available only in case *is_restricted* is True.
|
This field is available only in case *is_restricted* is True.
|
||||||
|
|
||||||
permissions (:obj:`ChatPermissions <pyrogram.ChatPermissions>` *optional*):
|
permissions (:obj:`ChatPermissions` *optional*):
|
||||||
Information about the chat default permissions, for groups and supergroups.
|
Information about the chat default permissions, for groups and supergroups.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user