mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Add usable-by labels for methods
This commit is contained in:
parent
8077eb4130
commit
bb44f36247
@ -46,6 +46,8 @@ class Invoke:
|
||||
:obj:`functions <pyrogram.api.functions>` (i.e: a Telegram API method you wish to use which is not
|
||||
available yet in the Client class as an easy-to-use method).
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
query (``RawFunction``):
|
||||
The API Schema function filled with proper arguments.
|
||||
|
@ -42,6 +42,8 @@ class ResolvePeer:
|
||||
:obj:`functions <pyrogram.api.functions>` (i.e: a Telegram API method you wish to use which is not
|
||||
available yet in the Client class as an easy-to-use method).
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
peer_id (``int`` | ``str``):
|
||||
The peer id you want to extract the InputPeer from.
|
||||
|
@ -53,6 +53,8 @@ class SaveFile:
|
||||
:obj:`functions <pyrogram.api.functions>` (i.e: a Telegram API method you wish to use which is not
|
||||
available yet in the Client class as an easy-to-use method).
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
path (``str`` | ``BinaryIO``):
|
||||
The path of the file you want to upload that exists on your local machine or a binary file-like object
|
||||
|
@ -27,6 +27,8 @@ class AcceptTermsOfService:
|
||||
) -> bool:
|
||||
"""Accept the given terms of service.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
terms_of_service_id (``str``):
|
||||
The terms of service identifier.
|
||||
|
@ -33,6 +33,8 @@ class CheckPassword:
|
||||
) -> "types.User":
|
||||
"""Check your Two-Step Verification password and log in.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
password (``str``):
|
||||
Your Two-Step Verification password.
|
||||
|
@ -30,6 +30,8 @@ class GetPasswordHint:
|
||||
) -> str:
|
||||
"""Get your Two-Step Verification password hint.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Returns:
|
||||
``str``: On success, the password hint as string is returned.
|
||||
"""
|
||||
|
@ -33,6 +33,8 @@ class LogOut:
|
||||
When you log out, the current client is stopped and the storage session deleted.
|
||||
No more API calls can be made until you start the client and re-authorize again.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Returns:
|
||||
``bool``: On success, True is returned.
|
||||
|
||||
|
@ -32,6 +32,8 @@ class RecoverPassword:
|
||||
) -> "types.User":
|
||||
"""Recover your password with a recovery code and log in.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
recovery_code (``str``):
|
||||
The recovery code sent via email.
|
||||
|
@ -36,6 +36,8 @@ class ResendCode:
|
||||
The type of the code to be re-sent is specified in the *next_type* attribute of the
|
||||
:obj:`~pyrogram.types.SentCode` object returned by :meth:`send_code`.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
phone_number (``str``):
|
||||
Phone number in international format (includes the country prefix).
|
||||
|
@ -34,6 +34,8 @@ class SendCode:
|
||||
) -> "types.SentCode":
|
||||
"""Send the confirmation code to the given phone number.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
phone_number (``str``):
|
||||
Phone number in international format (includes the country prefix).
|
||||
|
@ -30,6 +30,8 @@ class SendRecoveryCode:
|
||||
) -> str:
|
||||
"""Send a code to your email to recover your password.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Returns:
|
||||
``str``: On success, the hidden email pattern is returned and a recovery code is sent to that email.
|
||||
|
||||
|
@ -35,6 +35,8 @@ class SignIn:
|
||||
) -> Union["types.User", "types.TermsOfService", bool]:
|
||||
"""Authorize a user in Telegram with a valid confirmation code.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
phone_number (``str``):
|
||||
Phone number in international format (includes the country prefix).
|
||||
|
@ -34,6 +34,8 @@ class SignInBot:
|
||||
) -> "types.User":
|
||||
"""Authorize a bot using its bot token generated by BotFather.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
bot_token (``str``):
|
||||
The bot token generated by BotFather
|
||||
|
@ -35,6 +35,8 @@ class SignUp:
|
||||
) -> "types.User":
|
||||
"""Register a new user in Telegram.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
phone_number (``str``):
|
||||
Phone number in international format (includes the country prefix).
|
||||
|
@ -32,6 +32,8 @@ class AnswerCallbackQuery:
|
||||
"""Send answers to callback queries sent from inline keyboards.
|
||||
The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
callback_query_id (``str``):
|
||||
Unique identifier for the query to be answered.
|
||||
|
@ -39,6 +39,8 @@ class AnswerInlineQuery:
|
||||
|
||||
A maximum of 50 results per query is allowed.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
inline_query_id (``str``):
|
||||
Unique identifier for the answered query.
|
||||
|
@ -30,6 +30,8 @@ class AnswerWebAppQuery:
|
||||
"""Set the result of an interaction with a `Web App <https://core.telegram.org/bots/webapps>`_ and send a
|
||||
corresponding message on behalf of the user to the chat from which the query originated.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
web_app_query_id (``str``):
|
||||
Unique identifier for the answered query.
|
||||
|
@ -32,6 +32,8 @@ class DeleteBotCommands:
|
||||
The commands passed will overwrite any command set previously.
|
||||
This method can be used by the own bot only.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
scope (:obj:`~pyrogram.types.BotCommandScope`, *optional*):
|
||||
An object describing the scope of users for which the commands are relevant.
|
||||
|
@ -34,6 +34,8 @@ class GetBotCommands:
|
||||
The commands passed will overwrite any command set previously.
|
||||
This method can be used by the own bot only.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
scope (:obj:`~pyrogram.types.BotCommandScope`, *optional*):
|
||||
An object describing the scope of users for which the commands are relevant.
|
||||
|
@ -30,6 +30,8 @@ class GetBotDefaultPrivileges:
|
||||
) -> Optional["types.ChatPrivileges"]:
|
||||
"""Get the current default privileges of the bot.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
for_channels (``bool``, *optional*):
|
||||
Pass True to get default privileges of the bot in channels. Otherwise, default privileges of the bot
|
||||
|
@ -30,6 +30,8 @@ class GetChatMenuButton:
|
||||
) -> "types.MenuButton":
|
||||
"""Get the current value of the bot's menu button in a private chat, or the default menu button.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -32,6 +32,8 @@ class GetGameHighScores:
|
||||
) -> List["types.GameHighScore"]:
|
||||
"""Get data for high score tables.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
user_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -35,6 +35,8 @@ class GetInlineBotResults:
|
||||
"""Get bot results via inline queries.
|
||||
You can then send a result using :meth:`~pyrogram.Client.send_inline_bot_result`
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
bot (``int`` | ``str``):
|
||||
Unique identifier of the inline bot you want to get results from. You can specify
|
||||
|
@ -33,6 +33,8 @@ class RequestCallbackAnswer:
|
||||
"""Request a callback answer from bots.
|
||||
This is the equivalent of clicking an inline button containing callback data.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -40,6 +40,8 @@ class SendGame:
|
||||
) -> "types.Message":
|
||||
"""Send a game.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -34,6 +34,8 @@ class SendInlineBotResult:
|
||||
"""Send an inline bot result.
|
||||
Bot results can be retrieved using :meth:`~pyrogram.Client.get_inline_bot_results`
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -34,6 +34,8 @@ class SetBotCommands:
|
||||
The commands passed will overwrite any command set previously.
|
||||
This method can be used by the own bot only.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
commands (List of :obj:`~pyrogram.types.BotCommand`):
|
||||
A list of bot commands.
|
||||
|
@ -31,6 +31,8 @@ class SetBotDefaultPrivileges:
|
||||
|
||||
These privileges will be suggested to users, but they are are free to modify the list before adding the bot.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
privileges (:obj:`~pyrogram.types.ChatPrivileges`):
|
||||
New default privileges. None to clear.
|
||||
|
@ -31,6 +31,8 @@ class SetChatMenuButton:
|
||||
) -> bool:
|
||||
"""Change the bot's menu button in a private chat, or the default menu button.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``, *optional*):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -36,6 +36,8 @@ class SetGameScore:
|
||||
# inline_message_id: str = None): TODO Add inline_message_id
|
||||
"""Set the score of the specified user in a game.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
user_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -31,6 +31,8 @@ class AddChatMembers:
|
||||
) -> bool:
|
||||
"""Add new chat members to a group, supergroup or channel
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
The group, supergroup or channel id
|
||||
|
@ -29,6 +29,8 @@ class ArchiveChats:
|
||||
) -> bool:
|
||||
"""Archive one or more chats.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_ids (``int`` | ``str`` | List[``int``, ``str``]):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -41,6 +41,8 @@ class BanChatMember:
|
||||
off in the target group. Otherwise members may only be removed by the group's creator or by the member
|
||||
that added them.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -28,6 +28,8 @@ class CreateChannel:
|
||||
) -> "types.Chat":
|
||||
"""Create a new broadcast channel.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
title (``str``):
|
||||
The channel title.
|
||||
|
@ -35,6 +35,8 @@ class CreateGroup:
|
||||
|
||||
If you want to create a new supergroup, use :meth:`~pyrogram.Client.create_supergroup` instead.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
title (``str``):
|
||||
The group title.
|
||||
|
@ -32,6 +32,8 @@ class CreateSupergroup:
|
||||
|
||||
If you want to create a new basic group, use :meth:`~pyrogram.Client.create_group` instead.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
title (``str``):
|
||||
The supergroup title.
|
||||
|
@ -29,6 +29,8 @@ class DeleteChannel:
|
||||
) -> bool:
|
||||
"""Delete a channel.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
The id of the channel to be deleted.
|
||||
|
@ -31,6 +31,8 @@ class DeleteChatPhoto:
|
||||
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -29,6 +29,8 @@ class DeleteSupergroup:
|
||||
) -> bool:
|
||||
"""Delete a supergroup.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
The id of the supergroup to be deleted.
|
||||
|
@ -30,6 +30,8 @@ class DeleteUserHistory:
|
||||
) -> bool:
|
||||
"""Delete all messages sent by a certain user in a supergroup.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -34,6 +34,8 @@ class GetChat:
|
||||
Information include current name of the user for one-on-one conversations, current username of a user, group or
|
||||
channel, etc.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -38,7 +38,9 @@ class GetChatEventLog:
|
||||
Only available for supergroups and channels. Requires administrator rights.
|
||||
Results are returned in reverse chronological order (i.e., newest first).
|
||||
|
||||
Args:
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
||||
|
@ -32,6 +32,8 @@ class GetChatMember:
|
||||
) -> "types.ChatMember":
|
||||
"""Get information about one member of a chat.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -70,6 +70,8 @@ class GetChatMembers:
|
||||
A chat can be either a basic group, a supergroup or a channel.
|
||||
Requires administrator rights in channels.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -29,6 +29,8 @@ class GetChatMembersCount:
|
||||
) -> int:
|
||||
"""Get the number of members in a chat.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -29,6 +29,8 @@ class GetChatOnlineCount:
|
||||
) -> int:
|
||||
"""Get the number of members that are currently online in a chat.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -29,6 +29,8 @@ class GetDialogs:
|
||||
) -> Optional[AsyncGenerator["types.Dialog", None]]:
|
||||
"""Get a user's dialogs sequentially.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
limit (``int``, *optional*):
|
||||
Limits the number of dialogs to be retrieved.
|
||||
|
@ -27,6 +27,9 @@ class GetDialogsCount:
|
||||
) -> int:
|
||||
"""Get the total count of your dialogs.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
pinned_only (``bool``, *optional*):
|
||||
Pass True if you want to count only pinned dialogs.
|
||||
Defaults to False.
|
||||
|
@ -32,6 +32,8 @@ class GetNearbyChats:
|
||||
) -> List["types.Chat"]:
|
||||
"""Get nearby chats.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
latitude (``float``):
|
||||
Latitude of the location.
|
||||
|
@ -30,6 +30,8 @@ class GetSendAsChats:
|
||||
) -> List["types.Chat"]:
|
||||
"""Get the list of "send_as" chats available.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -30,6 +30,8 @@ class JoinChat:
|
||||
) -> "types.Chat":
|
||||
"""Join a group chat or channel.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat in form of a *t.me/joinchat/* link, a username of the target
|
||||
|
@ -30,6 +30,8 @@ class LeaveChat:
|
||||
):
|
||||
"""Leave a group chat or channel.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -29,6 +29,8 @@ class MarkChatUnread:
|
||||
) -> bool:
|
||||
"""Mark a chat as unread.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -34,6 +34,8 @@ class PinChatMessage:
|
||||
You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin right in
|
||||
the supergroup or "can_edit_messages" admin right in the channel.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -34,6 +34,8 @@ class PromoteChatMember:
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
Pass False for all boolean parameters to demote a user.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -37,6 +37,8 @@ class RestrictChatMember:
|
||||
You must be an administrator in the supergroup for this to work and must have the appropriate admin rights.
|
||||
Pass True for all permissions to lift restrictions from a user.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -34,6 +34,8 @@ class SetAdministratorTitle:
|
||||
If you are an administrator of a supergroup (i.e. not the owner), you can only set the title of other
|
||||
administrators who have been promoted by you. If you are the owner, you can change every administrator's title.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -31,6 +31,8 @@ class SetChatDescription:
|
||||
"""Change the description of a supergroup or a channel.
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -34,6 +34,8 @@ class SetChatPermissions:
|
||||
You must be an administrator in the group or a supergroup for this to work and must have the
|
||||
*can_restrict_members* admin rights.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -41,6 +41,8 @@ class SetChatPhoto:
|
||||
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -30,6 +30,8 @@ class SetChatProtectedContent:
|
||||
) -> bool:
|
||||
"""Set the chat protected content setting.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -36,6 +36,8 @@ class SetChatTitle:
|
||||
In regular groups (non-supergroups), this method will only work if the "All Members Are Admins"
|
||||
setting is off.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -32,6 +32,8 @@ class SetChatUsername:
|
||||
|
||||
To set your own username (for users only, not bots) you can use :meth:`~pyrogram.Client.set_username`.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``)
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -32,6 +32,8 @@ class SetSendAsChat:
|
||||
|
||||
Use :meth:`~pyrogram.Client.get_send_as_chats` to get all the "send_as" chats available for use.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -30,6 +30,8 @@ class SetSlowMode:
|
||||
) -> bool:
|
||||
"""Set the slow mode interval for a chat.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -29,6 +29,8 @@ class UnarchiveChats:
|
||||
) -> bool:
|
||||
"""Unarchive one or more chats.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
chat_ids (``int`` | ``str`` | List[``int``, ``str``]):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -32,6 +32,8 @@ class UnbanChatMember:
|
||||
The user will **not** return to the group or channel automatically, but will be able to join via link, etc.
|
||||
You must be an administrator for this to work.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -31,6 +31,8 @@ class UnpinAllChatMessages:
|
||||
If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have
|
||||
the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -32,6 +32,8 @@ class UnpinChatMessage:
|
||||
You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin
|
||||
right in the supergroup or "can_edit_messages" admin right in the channel.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -34,6 +34,8 @@ class AddContact:
|
||||
):
|
||||
"""Add an existing Telegram user as contact, even without a phone number.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
user_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target user.
|
||||
|
@ -29,6 +29,8 @@ class DeleteContacts:
|
||||
) -> Union["types.User", List["types.User"], None]:
|
||||
"""Delete contacts from your Telegram address book.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
user_ids (``int`` | ``str`` | List of ``int`` or ``str``):
|
||||
A single user id/username o a list of user identifiers (id or username).
|
||||
|
@ -32,6 +32,8 @@ class GetContacts:
|
||||
) -> List["types.User"]:
|
||||
"""Get contacts from your Telegram address book.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Returns:
|
||||
List of :obj:`~pyrogram.types.User`: On success, a list of users is returned.
|
||||
|
||||
|
@ -26,6 +26,8 @@ class GetContactsCount:
|
||||
) -> int:
|
||||
"""Get the total count of contacts from your Telegram address book.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Returns:
|
||||
``int``: On success, the contacts count is returned.
|
||||
|
||||
|
@ -30,6 +30,8 @@ class ImportContacts:
|
||||
):
|
||||
"""Import contacts to your Telegram address book.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
||||
Parameters:
|
||||
contacts (List of :obj:`~pyrogram.types.InputPhoneContact`):
|
||||
The contact list to be added
|
||||
|
@ -30,6 +30,8 @@ class ApproveAllChatJoinRequests:
|
||||
) -> bool:
|
||||
"""Approve all pending join requests in a chat.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -30,9 +30,11 @@ class ApproveChatJoinRequest:
|
||||
) -> bool:
|
||||
"""Approve a chat join request.
|
||||
|
||||
The bot must be an administrator in the chat for this to work and must have the *can_invite_users* administrator
|
||||
You must be an administrator in the chat for this to work and must have the *can_invite_users* administrator
|
||||
right.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -39,6 +39,8 @@ class CreateChatInviteLink:
|
||||
|
||||
The link can be revoked using the method :meth:`~pyrogram.Client.revoke_chat_invite_link`.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -30,6 +30,8 @@ class DeclineAllChatJoinRequests:
|
||||
) -> bool:
|
||||
"""Decline all pending join requests in a chat.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -30,9 +30,11 @@ class DeclineChatJoinRequest:
|
||||
) -> bool:
|
||||
"""Decline a chat join request.
|
||||
|
||||
The bot must be an administrator in the chat for this to work and must have the *can_invite_users* administrator
|
||||
You must be an administrator in the chat for this to work and must have the *can_invite_users* administrator
|
||||
right.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -30,6 +30,8 @@ class DeleteChatAdminInviteLinks:
|
||||
) -> bool:
|
||||
"""Delete all revoked invite links of an administrator.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -30,6 +30,8 @@ class DeleteChatInviteLink:
|
||||
) -> bool:
|
||||
"""Delete an already revoked invite link.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -38,6 +38,8 @@ class EditChatInviteLink:
|
||||
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -39,6 +39,8 @@ class ExportChatInviteLink:
|
||||
:meth:`~pyrogram.Client.get_chat` method. If your bot needs to generate a new invite link replacing its
|
||||
previous one, use this method again.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -38,6 +38,8 @@ class GetChatAdminInviteLinks:
|
||||
As an administrator you can only get your own links you have exported.
|
||||
As the chat or channel owner you can get everyones links.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -31,6 +31,8 @@ class GetChatAdminInviteLinksCount:
|
||||
) -> int:
|
||||
"""Get the count of the invite links created by an administrator in a chat.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -31,7 +31,9 @@ class GetChatAdminsWithInviteLinks:
|
||||
|
||||
You must be the owner of a chat for this to work.
|
||||
|
||||
Args:
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
(in the format @username).
|
||||
|
@ -31,6 +31,8 @@ class GetChatInviteLink:
|
||||
) -> "types.ChatInviteLink":
|
||||
"""Get detailed information about a chat invite link.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -32,6 +32,8 @@ class GetChatInviteLinkJoiners:
|
||||
) -> Optional[AsyncGenerator["types.ChatJoiner", None]]:
|
||||
"""Get the members who joined the chat with the invite link.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -30,6 +30,8 @@ class GetChatInviteLinkJoinersCount:
|
||||
) -> int:
|
||||
"""Get the count of the members who joined the chat with the invite link.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -32,6 +32,8 @@ class GetChatJoinRequests:
|
||||
) -> Optional[AsyncGenerator["types.ChatJoiner", None]]:
|
||||
"""Get the pending join requests of a chat.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -35,6 +35,8 @@ class RevokeChatInviteLink:
|
||||
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier for the target chat or username of the target channel/supergroup
|
||||
|
@ -36,6 +36,8 @@ class CopyMediaGroup:
|
||||
) -> List["types.Message"]:
|
||||
"""Copy a media group by providing one of the message ids.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -51,6 +51,8 @@ class CopyMessage:
|
||||
The method is analogous to the method :meth:`~Client.forward_messages`, but the copied message doesn't have a
|
||||
link to the original message.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -31,6 +31,8 @@ class DeleteMessages:
|
||||
) -> int:
|
||||
"""Delete messages, including service messages.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
@ -40,6 +40,8 @@ class DownloadMedia:
|
||||
) -> Optional[Union[str, BinaryIO]]:
|
||||
"""Download the media from a message.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
message (:obj:`~pyrogram.types.Message` | ``str``):
|
||||
Pass a Message containing the media, the media itself (message.audio, message.video, ...) or a file id
|
||||
|
@ -32,6 +32,8 @@ class EditInlineCaption:
|
||||
) -> bool:
|
||||
"""Edit the caption of inline media messages.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
inline_message_id (``str``):
|
||||
Identifier of the inline message.
|
||||
|
@ -45,6 +45,8 @@ class EditInlineMedia:
|
||||
When the inline message is edited, a new file can't be uploaded. Use a previously uploaded file via its file_id
|
||||
or specify a URL.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
inline_message_id (``str``):
|
||||
Required if *chat_id* and *message_id* are not specified.
|
||||
|
@ -31,6 +31,8 @@ class EditInlineReplyMarkup:
|
||||
) -> bool:
|
||||
"""Edit only the reply markup of inline messages sent via the bot (for inline bots).
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
inline_message_id (``str``):
|
||||
Identifier of the inline message.
|
||||
|
@ -36,6 +36,8 @@ class EditInlineText:
|
||||
) -> bool:
|
||||
"""Edit the text of inline messages.
|
||||
|
||||
.. include:: /_includes/usable-by/bots.rst
|
||||
|
||||
Parameters:
|
||||
inline_message_id (``str``):
|
||||
Identifier of the inline message.
|
||||
|
@ -34,6 +34,8 @@ class EditMessageCaption:
|
||||
) -> "types.Message":
|
||||
"""Edit the caption of media messages.
|
||||
|
||||
.. include:: /_includes/usable-by/users-bots.rst
|
||||
|
||||
Parameters:
|
||||
chat_id (``int`` | ``str``):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user