Skip to content

Commit

Permalink
Update usable-by label of methods
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe authored Dec 2, 2024
1 parent 557d99b commit adf3565
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 18 deletions.
4 changes: 3 additions & 1 deletion pyrogram/methods/business/answer_pre_checkout_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ async def answer_pre_checkout_query(
Use this method to respond to such pre-checkout queries.
**Note**: The API must receive an answer within 10 seconds after the pre-checkout query was sent.
.. note::
The API must receive an answer within 10 seconds after the pre-checkout query was sent.
.. include:: /_includes/usable-by/bots.rst
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/business/send_gift.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def send_gift(
) -> bool:
"""Sends a gift to another user.
.. include:: /_includes/usable-by/users.rst
.. include:: /_includes/usable-by/users-bots.rst
Parameters:
user_id (``int`` | ``str``):
Expand Down
4 changes: 3 additions & 1 deletion pyrogram/methods/chats/set_chat_message_auto_delete_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ async def set_chat_message_auto_delete_time(
message_auto_delete_time: int
) -> "types.Message":
"""Changes the message auto-delete or self-destruct (for secret chats) time in a chat.
Requires change_info administrator right in basic groups, supergroups and channels.
.. include:: /_includes/usable-by/users.rst
Parameters:
chat_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the target chat.
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/chats/set_chat_protected_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def set_chat_protected_content(
) -> bool:
"""Set the chat protected content setting.
.. include:: /_includes/usable-by/users-bots.rst
.. include:: /_includes/usable-by/users.rst
Parameters:
chat_id (``int`` | ``str``):
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/chats/set_slow_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def set_slow_mode(
) -> bool:
"""Set the slow mode interval for a chat.
.. include:: /_includes/usable-by/users-bots.rst
.. include:: /_includes/usable-by/users.rst
Parameters:
chat_id (``int`` | ``str``):
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/users/get_default_emoji_statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def get_default_emoji_statuses(
) -> List["types.EmojiStatus"]:
"""Get the default emoji statuses.
.. include:: /_includes/usable-by/users-bots.rst
.. include:: /_includes/usable-by/users.rst
Returns:
List of :obj:`~pyrogram.types.EmojiStatus`: On success, a list of emoji statuses is returned.
Expand Down
9 changes: 5 additions & 4 deletions pyrogram/methods/users/set_username.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@ async def set_username(
self: "pyrogram.Client",
username: Optional[str]
) -> bool:
"""Set your own username.
"""Changes the editable username of the current user.
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 set a channel or supergroup username you can use
:meth:`~pyrogram.Client.set_chat_username`.
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 set a channel or supergroup username you can use :meth:`~pyrogram.Client.set_chat_username`.
.. include:: /_includes/usable-by/users.rst
Parameters:
username (``str`` | ``None``):
Username to set. "" (empty string) or None to remove it.
The username can't be completely removed if there is another active or disabled username.
Returns:
``bool``: True on success.
Expand Down
8 changes: 5 additions & 3 deletions pyrogram/methods/users/update_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
class UpdateProfile:
async def update_profile(
self: "pyrogram.Client",
*,
first_name: str = None,
last_name: str = None,
bio: str = None
Expand All @@ -35,14 +36,15 @@ async def update_profile(
Parameters:
first_name (``str``, *optional*):
The new first name.
The new first name; 1-64 characters.
last_name (``str``, *optional*):
The new last name.
The new last name; 1-64 characters.
Pass "" (empty string) to remove it.
bio (``str``, *optional*):
The new bio, also known as "about". Max 70 characters.
Changes the bio of the current user.
Max ``intro_description_length_limit`` characters without line feeds.
Pass "" (empty string) to remove it.
Returns:
Expand Down
9 changes: 7 additions & 2 deletions pyrogram/types/bots_and_keyboards/inline_keyboard_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@ class InlineKeyboardButton(Object):
callback_game (:obj:`~pyrogram.types.CallbackGame`, *optional*):
Description of the game that will be launched when the user presses the button.
**NOTE**: This type of button **must** always be the first button in the first row.
.. note::
This type of button **must** always be the first button in the first row.
pay (``bool``, *optional*):
Specify True, to send a Pay button. Substrings "⭐" and "XTR" in the buttons's text will be replaced with a Telegram Star icon.
**NOTE**: This type of button **must** always be the first button in the first row and can only be used in invoice messages.
.. note::
This type of button **must** always be the first button in the first row and can only be used in invoice messages.
callback_data_with_password (``bytes``, *optional*):
A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot Data to be sent to the bot via a callback query.
Expand Down
7 changes: 4 additions & 3 deletions pyrogram/types/bots_and_keyboards/login_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ class LoginUrl(Object):
be opened. The data added is the same as described in
`Receiving authorization data <https://core.telegram.org/widgets/login#receiving-authorization-data>`.
**NOTE**: You **must** always check the hash of the received data to verify the authentication and the
integrity of the data as described in
`Checking authorization <https://core.telegram.org/widgets/login#checking-authorization>`_.
.. note::
You **must** always check the hash of the received data to verify the authentication
and the integrity of the data as described in `Checking authorization <https://core.telegram.org/widgets/login#checking-authorization>`_.
forward_text (``str``, *optional*):
New text of the button in forwarded messages.
Expand Down

0 comments on commit adf3565

Please sign in to comment.