From 63977ea353a1a9d04484a3c2f05059269ac71c87 Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Tue, 3 Oct 2023 15:11:37 +0200 Subject: [PATCH] Documentation Improvements (#3910) Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com> --- telegram/_bot.py | 12 ++++++------ telegram/_chatadministratorrights.py | 20 ++++++++++---------- telegram/_chatjoinrequest.py | 2 +- telegram/_chatmember.py | 16 +++++++++------- telegram/_inline/inlinequeryresultsbutton.py | 2 +- telegram/_webappinfo.py | 4 ++-- 6 files changed, 29 insertions(+), 27 deletions(-) diff --git a/telegram/_bot.py b/telegram/_bot.py index df5a789af..b9735c7a0 100644 --- a/telegram/_bot.py +++ b/telegram/_bot.py @@ -4614,10 +4614,10 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): user_id (:obj:`int`): Unique identifier of the target user. is_anonymous (:obj:`bool`, optional): Pass :obj:`True`, if the administrator's presence in the chat is hidden. - can_manage_chat (:obj:`bool`, optional): Pass :obj:`True`, if the administrator can - access the chat event log, chat statistics, message statistics in channels, see - channel members, see anonymous administrators in supergroups and ignore slow mode. - Implied by any other administrator privilege. + can_manage_chat (:obj:`bool`, optional): Pass :obj:`True`, if the administrator can + access the chat event log, chat statistics, boost list in channels, see channel + members, report spam messages, see anonymous administrators in supergroups and + ignore slow mode. Implied by any other administrator privilege. .. versionadded:: 13.4 @@ -4629,7 +4629,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): can_change_info (:obj:`bool`, optional): Pass :obj:`True`, if the administrator can change chat title, photo and other settings. can_post_messages (:obj:`bool`, optional): Pass :obj:`True`, if the administrator can - create channel posts, channels only. + post messages in the channel, or access channel statistics; channels only. can_edit_messages (:obj:`bool`, optional): Pass :obj:`True`, if the administrator can edit messages of other users and can pin messages, channels only. can_delete_messages (:obj:`bool`, optional): Pass :obj:`True`, if the administrator can @@ -4637,7 +4637,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): can_invite_users (:obj:`bool`, optional): Pass :obj:`True`, if the administrator can invite new users to the chat. can_restrict_members (:obj:`bool`, optional): Pass :obj:`True`, if the administrator - can restrict, ban or unban chat members. + can restrict, ban or unban chat members, or access supergroup statistics. can_pin_messages (:obj:`bool`, optional): Pass :obj:`True`, if the administrator can pin messages, supergroups only. can_promote_members (:obj:`bool`, optional): Pass :obj:`True`, if the administrator can diff --git a/telegram/_chatadministratorrights.py b/telegram/_chatadministratorrights.py index 760d3f728..d7a76a364 100644 --- a/telegram/_chatadministratorrights.py +++ b/telegram/_chatadministratorrights.py @@ -47,15 +47,15 @@ class ChatAdministratorRights(TelegramObject): Args: is_anonymous (:obj:`bool`): :obj:`True`, if the user's presence in the chat is hidden. can_manage_chat (:obj:`bool`): :obj:`True`, if the administrator can access the chat event - log, chat statistics, message statistics in channels, see channel members, see - anonymous administrators in supergroups and ignore slow mode. Implied by any other - administrator privilege. + log, chat statistics, boost list in channels, see channel members, report spam + messages, see anonymous administrators in supergroups and ignore slow mode. + Implied by any other administrator privilege. can_delete_messages (:obj:`bool`): :obj:`True`, if the administrator can delete messages of other users. can_manage_video_chats (:obj:`bool`): :obj:`True`, if the administrator can manage video chats. can_restrict_members (:obj:`bool`): :obj:`True`, if the administrator can restrict, ban or - unban chat members. + unban chat members, or access supergroup statistics. can_promote_members (:obj:`bool`): :obj:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that @@ -65,7 +65,7 @@ class ChatAdministratorRights(TelegramObject): can_invite_users (:obj:`bool`): :obj:`True`, if the user is allowed to invite new users to the chat. can_post_messages (:obj:`bool`, optional): :obj:`True`, if the administrator can post - messages in the channel; channels only. + messages in the channel, or access channel statistics; channels only. can_edit_messages (:obj:`bool`, optional): :obj:`True`, if the administrator can edit messages of other users. can_pin_messages (:obj:`bool`, optional): :obj:`True`, if the user is allowed to pin @@ -90,15 +90,15 @@ class ChatAdministratorRights(TelegramObject): Attributes: is_anonymous (:obj:`bool`): :obj:`True`, if the user's presence in the chat is hidden. can_manage_chat (:obj:`bool`): :obj:`True`, if the administrator can access the chat event - log, chat statistics, message statistics in channels, see channel members, see - anonymous administrators in supergroups and ignore slow mode. Implied by any other - administrator privilege. + log, chat statistics, boost list in channels, see channel members, report spam + messages, see anonymous administrators in supergroups and ignore slow mode. + Implied by any other administrator privilege. can_delete_messages (:obj:`bool`): :obj:`True`, if the administrator can delete messages of other users. can_manage_video_chats (:obj:`bool`): :obj:`True`, if the administrator can manage video chats. can_restrict_members (:obj:`bool`): :obj:`True`, if the administrator can restrict, ban or - unban chat members. + unban chat members, or access supergroup statistics. can_promote_members (:obj:`bool`): :obj:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by @@ -108,7 +108,7 @@ class ChatAdministratorRights(TelegramObject): can_invite_users (:obj:`bool`): :obj:`True`, if the user is allowed to invite new users to the chat. can_post_messages (:obj:`bool`): Optional. :obj:`True`, if the administrator can post - messages in the channel; channels only. + messages in the channel, or access channel statistics; channels only. can_edit_messages (:obj:`bool`): Optional. :obj:`True`, if the administrator can edit messages of other users. can_pin_messages (:obj:`bool`): Optional. :obj:`True`, if the user is allowed to pin diff --git a/telegram/_chatjoinrequest.py b/telegram/_chatjoinrequest.py index a2f255abb..8ed94a94a 100644 --- a/telegram/_chatjoinrequest.py +++ b/telegram/_chatjoinrequest.py @@ -63,7 +63,7 @@ class ChatJoinRequest(TelegramObject): request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for - storing this identifier. The bot can use this identifier for 24 hours to send messages + storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. diff --git a/telegram/_chatmember.py b/telegram/_chatmember.py index d8fd1de05..0ab51080c 100644 --- a/telegram/_chatmember.py +++ b/telegram/_chatmember.py @@ -218,7 +218,8 @@ class ChatMemberAdministrator(ChatMember): can_invite_users (:obj:`bool`): :obj:`True`, if the user can invite new users to the chat. can_post_messages (:obj:`bool`, optional): :obj:`True`, if the - administrator can post in the channel, channels only. + administrator can post messages in the channel, or access channel statistics; channels + only. can_edit_messages (:obj:`bool`, optional): :obj:`True`, if the administrator can edit messages of other users and can pin messages; channels only. @@ -250,10 +251,10 @@ class ChatMemberAdministrator(ChatMember): is allowed to edit administrator privileges of that user. is_anonymous (:obj:`bool`): :obj:`True`, if the user's presence in the chat is hidden. - can_manage_chat (:obj:`bool`): :obj:`True`, if the administrator - can access the chat event log, chat statistics, message statistics in - channels, see channel members, see anonymous administrators in supergroups - and ignore slow mode. Implied by any other administrator privilege. + can_manage_chat (:obj:`bool`): :obj:`True`, if the administrator can access the chat event + log, chat statistics, boost list in channels, see channel members, report spam + messages, see anonymous administrators in supergroups and ignore slow mode. + Implied by any other administrator privilege. can_delete_messages (:obj:`bool`): :obj:`True`, if the administrator can delete messages of other users. can_manage_video_chats (:obj:`bool`): :obj:`True`, if the @@ -261,7 +262,7 @@ class ChatMemberAdministrator(ChatMember): .. versionadded:: 20.0 can_restrict_members (:obj:`bool`): :obj:`True`, if the - administrator can restrict, ban or unban chat members. + administrator can restrict, ban or unban chat members, or access supergroup statistics. can_promote_members (:obj:`bool`): :obj:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that @@ -271,7 +272,8 @@ class ChatMemberAdministrator(ChatMember): can_invite_users (:obj:`bool`): :obj:`True`, if the user can invite new users to the chat. can_post_messages (:obj:`bool`): Optional. :obj:`True`, if the - administrator can post in the channel, channels only. + administrator can post messages in the channel or access channel statistics; + channels only. can_edit_messages (:obj:`bool`): Optional. :obj:`True`, if the administrator can edit messages of other users and can pin messages; channels only. diff --git a/telegram/_inline/inlinequeryresultsbutton.py b/telegram/_inline/inlinequeryresultsbutton.py index d15b9877d..899426590 100644 --- a/telegram/_inline/inlinequeryresultsbutton.py +++ b/telegram/_inline/inlinequeryresultsbutton.py @@ -42,7 +42,7 @@ class InlineQueryResultsButton(TelegramObject): `Web App `_ that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method - `switchInlineQuery `_ + `switchInlineQuery `_ inside the Web App. start_parameter (:obj:`str`, optional): Deep-linking parameter for the :guilabel:`/start` message sent to the bot when user presses the switch button. diff --git a/telegram/_webappinfo.py b/telegram/_webappinfo.py index 4c83af1c2..46fd8f53b 100644 --- a/telegram/_webappinfo.py +++ b/telegram/_webappinfo.py @@ -39,12 +39,12 @@ class WebAppInfo(TelegramObject): Args: url (:obj:`str`): An HTTPS URL of a Web App to be opened with additional data as specified in `Initializing Web Apps \ - `_. + `_. Attributes: url (:obj:`str`): An HTTPS URL of a Web App to be opened with additional data as specified in `Initializing Web Apps \ - `_. + `_. """ __slots__ = ("url",)