From a355daba49a6e03ee8ac306746d1c0406361986e Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sun, 29 Oct 2023 02:15:50 +0300 Subject: [PATCH] Re-generate Bot API --- .butcher/methods/getUpdates/entity.json | 6 +- .../methods/promoteChatMember/entity.json | 68 ++++++--- .butcher/methods/setWebhook/entity.json | 6 +- .butcher/schema/schema.json | 140 ++++++++++-------- .../types/ChatAdministratorRights/entity.json | 24 +-- .butcher/types/ChatJoinRequest/entity.json | 6 +- .../types/ChatMemberAdministrator/entity.json | 24 +-- .butcher/types/Update/entity.json | 6 +- Makefile | 13 ++ aiogram/client/bot.py | 29 ++-- aiogram/methods/get_updates.py | 2 +- aiogram/methods/promote_chat_member.py | 32 ++-- aiogram/methods/set_webhook.py | 2 +- aiogram/types/chat.py | 25 +++- aiogram/types/chat_administrator_rights.py | 8 +- aiogram/types/chat_join_request.py | 2 +- aiogram/types/chat_member_administrator.py | 8 +- aiogram/types/update.py | 2 +- 18 files changed, 247 insertions(+), 156 deletions(-) diff --git a/.butcher/methods/getUpdates/entity.json b/.butcher/methods/getUpdates/entity.json index 6163ad20..775ad6dd 100644 --- a/.butcher/methods/getUpdates/entity.json +++ b/.butcher/methods/getUpdates/entity.json @@ -38,9 +38,9 @@ { "type": "Array of String", "required": false, - "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", - "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\n
\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", - "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n", + "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", + "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\n
\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", + "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n", "name": "allowed_updates" } ], diff --git a/.butcher/methods/promoteChatMember/entity.json b/.butcher/methods/promoteChatMember/entity.json index ad0fce42..d866b307 100644 --- a/.butcher/methods/promoteChatMember/entity.json +++ b/.butcher/methods/promoteChatMember/entity.json @@ -38,27 +38,11 @@ { "type": "Boolean", "required": false, - "description": "Pass 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", - "html_description": "Pass 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", - "rst_description": "Pass :code:`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\n", + "description": "Pass True if the administrator can access the chat event log, 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", + "html_description": "Pass True if the administrator can access the chat event log, 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", + "rst_description": "Pass :code:`True` if the administrator can access the chat event log, 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\n", "name": "can_manage_chat" }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the administrator can create channel posts, channels only", - "html_description": "Pass True if the administrator can create channel posts, channels only", - "rst_description": "Pass :code:`True` if the administrator can create channel posts, channels only\n", - "name": "can_post_messages" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the administrator can edit messages of other users and can pin messages, channels only", - "html_description": "Pass True if the administrator can edit messages of other users and can pin messages, channels only", - "rst_description": "Pass :code:`True` if the administrator can edit messages of other users and can pin messages, channels only\n", - "name": "can_edit_messages" - }, { "type": "Boolean", "required": false, @@ -78,9 +62,9 @@ { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can restrict, ban or unban chat members", - "html_description": "Pass True if the administrator can restrict, ban or unban chat members", - "rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members\n", + "description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "html_description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics\n", "name": "can_restrict_members" }, { @@ -107,6 +91,22 @@ "rst_description": "Pass :code:`True` if the administrator can invite new users to the chat\n", "name": "can_invite_users" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", + "html_description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", + "rst_description": "Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only\n", + "name": "can_post_messages" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", + "html_description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", + "rst_description": "Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only\n", + "name": "can_edit_messages" + }, { "type": "Boolean", "required": false, @@ -115,6 +115,30 @@ "rst_description": "Pass :code:`True` if the administrator can pin messages, supergroups only\n", "name": "can_pin_messages" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can post stories in the channel; channels only", + "html_description": "Pass True if the administrator can post stories in the channel; channels only", + "rst_description": "Pass :code:`True` if the administrator can post stories in the channel; channels only\n", + "name": "can_post_stories" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can edit stories posted by other users; channels only", + "html_description": "Pass True if the administrator can edit stories posted by other users; channels only", + "rst_description": "Pass :code:`True` if the administrator can edit stories posted by other users; channels only\n", + "name": "can_edit_stories" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can delete stories posted by other users; channels only", + "html_description": "Pass True if the administrator can delete stories posted by other users; channels only", + "rst_description": "Pass :code:`True` if the administrator can delete stories posted by other users; channels only\n", + "name": "can_delete_stories" + }, { "type": "Boolean", "required": false, diff --git a/.butcher/methods/setWebhook/entity.json b/.butcher/methods/setWebhook/entity.json index 337a7b43..593186b6 100644 --- a/.butcher/methods/setWebhook/entity.json +++ b/.butcher/methods/setWebhook/entity.json @@ -46,9 +46,9 @@ { "type": "Array of String", "required": false, - "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", - "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", - "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.\n", + "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", + "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", + "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.\n", "name": "allowed_updates" }, { diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index 7f4457cc..27e87e97 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -121,9 +121,9 @@ }, { "type": "ChatMemberUpdated", - "description": "A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify 'chat_member' in the list of allowed_updates to receive these updates.", - "html_description": "Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.", - "rst_description": "*Optional*. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify 'chat_member' in the list of *allowed_updates* to receive these updates.\n", + "description": "A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \"chat_member\" in the list of allowed_updates to receive these updates.", + "html_description": "Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \"chat_member\" in the list of allowed_updates to receive these updates.", + "rst_description": "*Optional*. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify :code:`\"chat_member\"` in the list of *allowed_updates* to receive these updates.\n", "name": "chat_member", "required": false }, @@ -172,9 +172,9 @@ { "type": "Array of String", "required": false, - "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", - "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\n
\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", - "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n", + "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", + "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\n
\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", + "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n", "name": "allowed_updates" } ], @@ -222,9 +222,9 @@ { "type": "Array of String", "required": false, - "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", - "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", - "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.\n", + "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", + "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", + "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.\n", "name": "allowed_updates" }, { @@ -3351,9 +3351,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", - "html_description": "True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", - "rst_description": ":code:`True`, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege\n", + "description": "True, if the administrator can access the chat event log, 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", + "html_description": "True, if the administrator can access the chat event log, 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", + "rst_description": ":code:`True`, if the administrator can access the chat event log, 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\n", "name": "can_manage_chat", "required": true }, @@ -3375,9 +3375,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can restrict, ban or unban chat members", - "html_description": "True, if the administrator can restrict, ban or unban chat members", - "rst_description": ":code:`True`, if the administrator can restrict, ban or unban chat members\n", + "description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "html_description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "rst_description": ":code:`True`, if the administrator can restrict, ban or unban chat members, or access supergroup statistics\n", "name": "can_restrict_members", "required": true }, @@ -3407,9 +3407,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post messages in the channel; channels only", - "html_description": "Optional. True, if the administrator can post messages in the channel; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel; channels only\n", + "description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", + "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", "name": "can_post_messages", "required": false }, @@ -3447,9 +3447,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can delete stories posted by other users", - "html_description": "Optional. True, if the administrator can delete stories posted by other users", - "rst_description": "*Optional*. :code:`True`, if the administrator can delete stories posted by other users\n", + "description": "True, if the administrator can delete stories posted by other users; channels only", + "html_description": "Optional. True, if the administrator can delete stories posted by other users; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can delete stories posted by other users; channels only\n", "name": "can_delete_stories", "required": false }, @@ -3556,9 +3556,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", - "html_description": "True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", - "rst_description": ":code:`True`, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege\n", + "description": "True, if the administrator can access the chat event log, 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", + "html_description": "True, if the administrator can access the chat event log, 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", + "rst_description": ":code:`True`, if the administrator can access the chat event log, 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\n", "name": "can_manage_chat", "required": true }, @@ -3580,9 +3580,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can restrict, ban or unban chat members", - "html_description": "True, if the administrator can restrict, ban or unban chat members", - "rst_description": ":code:`True`, if the administrator can restrict, ban or unban chat members\n", + "description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "html_description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "rst_description": ":code:`True`, if the administrator can restrict, ban or unban chat members, or access supergroup statistics\n", "name": "can_restrict_members", "required": true }, @@ -3612,9 +3612,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post messages in the channel; channels only", - "html_description": "Optional. True, if the administrator can post messages in the channel; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel; channels only\n", + "description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", + "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", "name": "can_post_messages", "required": false }, @@ -3652,9 +3652,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can delete stories posted by other users", - "html_description": "Optional. True, if the administrator can delete stories posted by other users", - "rst_description": "*Optional*. :code:`True`, if the administrator can delete stories posted by other users\n", + "description": "True, if the administrator can delete stories posted by other users; channels only", + "html_description": "Optional. True, if the administrator can delete stories posted by other users; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can delete stories posted by other users; channels only\n", "name": "can_delete_stories", "required": false }, @@ -4008,9 +4008,9 @@ }, { "type": "Integer", - "description": "Identifier of a private chat with the user who sent the join 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 until the join request is processed, assuming no other administrator contacted the user.", - "html_description": "Identifier of a private chat with the user who sent the join 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 until the join request is processed, assuming no other administrator contacted the user.", - "rst_description": "Identifier of a private chat with the user who sent the join 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 until the join request is processed, assuming no other administrator contacted the user.\n", + "description": "Identifier of a private chat with the user who sent the join 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 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.", + "html_description": "Identifier of a private chat with the user who sent the join 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 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.", + "rst_description": "Identifier of a private chat with the user who sent the join 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 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.\n", "name": "user_chat_id", "required": true }, @@ -7019,27 +7019,11 @@ { "type": "Boolean", "required": false, - "description": "Pass 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", - "html_description": "Pass 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", - "rst_description": "Pass :code:`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\n", + "description": "Pass True if the administrator can access the chat event log, 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", + "html_description": "Pass True if the administrator can access the chat event log, 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", + "rst_description": "Pass :code:`True` if the administrator can access the chat event log, 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\n", "name": "can_manage_chat" }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the administrator can create channel posts, channels only", - "html_description": "Pass True if the administrator can create channel posts, channels only", - "rst_description": "Pass :code:`True` if the administrator can create channel posts, channels only\n", - "name": "can_post_messages" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the administrator can edit messages of other users and can pin messages, channels only", - "html_description": "Pass True if the administrator can edit messages of other users and can pin messages, channels only", - "rst_description": "Pass :code:`True` if the administrator can edit messages of other users and can pin messages, channels only\n", - "name": "can_edit_messages" - }, { "type": "Boolean", "required": false, @@ -7059,9 +7043,9 @@ { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can restrict, ban or unban chat members", - "html_description": "Pass True if the administrator can restrict, ban or unban chat members", - "rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members\n", + "description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "html_description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics\n", "name": "can_restrict_members" }, { @@ -7088,6 +7072,22 @@ "rst_description": "Pass :code:`True` if the administrator can invite new users to the chat\n", "name": "can_invite_users" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", + "html_description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", + "rst_description": "Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only\n", + "name": "can_post_messages" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", + "html_description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", + "rst_description": "Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only\n", + "name": "can_edit_messages" + }, { "type": "Boolean", "required": false, @@ -7096,6 +7096,30 @@ "rst_description": "Pass :code:`True` if the administrator can pin messages, supergroups only\n", "name": "can_pin_messages" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can post stories in the channel; channels only", + "html_description": "Pass True if the administrator can post stories in the channel; channels only", + "rst_description": "Pass :code:`True` if the administrator can post stories in the channel; channels only\n", + "name": "can_post_stories" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can edit stories posted by other users; channels only", + "html_description": "Pass True if the administrator can edit stories posted by other users; channels only", + "rst_description": "Pass :code:`True` if the administrator can edit stories posted by other users; channels only\n", + "name": "can_edit_stories" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the administrator can delete stories posted by other users; channels only", + "html_description": "Pass True if the administrator can delete stories posted by other users; channels only", + "rst_description": "Pass :code:`True` if the administrator can delete stories posted by other users; channels only\n", + "name": "can_delete_stories" + }, { "type": "Boolean", "required": false, diff --git a/.butcher/types/ChatAdministratorRights/entity.json b/.butcher/types/ChatAdministratorRights/entity.json index eb3b1c14..e493b3e2 100644 --- a/.butcher/types/ChatAdministratorRights/entity.json +++ b/.butcher/types/ChatAdministratorRights/entity.json @@ -21,9 +21,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", - "html_description": "True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", - "rst_description": ":code:`True`, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege\n", + "description": "True, if the administrator can access the chat event log, 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", + "html_description": "True, if the administrator can access the chat event log, 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", + "rst_description": ":code:`True`, if the administrator can access the chat event log, 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\n", "name": "can_manage_chat", "required": true }, @@ -45,9 +45,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can restrict, ban or unban chat members", - "html_description": "True, if the administrator can restrict, ban or unban chat members", - "rst_description": ":code:`True`, if the administrator can restrict, ban or unban chat members\n", + "description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "html_description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "rst_description": ":code:`True`, if the administrator can restrict, ban or unban chat members, or access supergroup statistics\n", "name": "can_restrict_members", "required": true }, @@ -77,9 +77,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post messages in the channel; channels only", - "html_description": "Optional. True, if the administrator can post messages in the channel; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel; channels only\n", + "description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", + "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", "name": "can_post_messages", "required": false }, @@ -117,9 +117,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can delete stories posted by other users", - "html_description": "Optional. True, if the administrator can delete stories posted by other users", - "rst_description": "*Optional*. :code:`True`, if the administrator can delete stories posted by other users\n", + "description": "True, if the administrator can delete stories posted by other users; channels only", + "html_description": "Optional. True, if the administrator can delete stories posted by other users; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can delete stories posted by other users; channels only\n", "name": "can_delete_stories", "required": false }, diff --git a/.butcher/types/ChatJoinRequest/entity.json b/.butcher/types/ChatJoinRequest/entity.json index 99fa2d7d..25cfe9e3 100644 --- a/.butcher/types/ChatJoinRequest/entity.json +++ b/.butcher/types/ChatJoinRequest/entity.json @@ -29,9 +29,9 @@ }, { "type": "Integer", - "description": "Identifier of a private chat with the user who sent the join 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 until the join request is processed, assuming no other administrator contacted the user.", - "html_description": "Identifier of a private chat with the user who sent the join 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 until the join request is processed, assuming no other administrator contacted the user.", - "rst_description": "Identifier of a private chat with the user who sent the join 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 until the join request is processed, assuming no other administrator contacted the user.\n", + "description": "Identifier of a private chat with the user who sent the join 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 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.", + "html_description": "Identifier of a private chat with the user who sent the join 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 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.", + "rst_description": "Identifier of a private chat with the user who sent the join 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 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.\n", "name": "user_chat_id", "required": true }, diff --git a/.butcher/types/ChatMemberAdministrator/entity.json b/.butcher/types/ChatMemberAdministrator/entity.json index 65981631..4679a1e0 100644 --- a/.butcher/types/ChatMemberAdministrator/entity.json +++ b/.butcher/types/ChatMemberAdministrator/entity.json @@ -45,9 +45,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", - "html_description": "True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", - "rst_description": ":code:`True`, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege\n", + "description": "True, if the administrator can access the chat event log, 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", + "html_description": "True, if the administrator can access the chat event log, 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", + "rst_description": ":code:`True`, if the administrator can access the chat event log, 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\n", "name": "can_manage_chat", "required": true }, @@ -69,9 +69,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can restrict, ban or unban chat members", - "html_description": "True, if the administrator can restrict, ban or unban chat members", - "rst_description": ":code:`True`, if the administrator can restrict, ban or unban chat members\n", + "description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "html_description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", + "rst_description": ":code:`True`, if the administrator can restrict, ban or unban chat members, or access supergroup statistics\n", "name": "can_restrict_members", "required": true }, @@ -101,9 +101,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post messages in the channel; channels only", - "html_description": "Optional. True, if the administrator can post messages in the channel; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel; channels only\n", + "description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", + "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", "name": "can_post_messages", "required": false }, @@ -141,9 +141,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can delete stories posted by other users", - "html_description": "Optional. True, if the administrator can delete stories posted by other users", - "rst_description": "*Optional*. :code:`True`, if the administrator can delete stories posted by other users\n", + "description": "True, if the administrator can delete stories posted by other users; channels only", + "html_description": "Optional. True, if the administrator can delete stories posted by other users; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can delete stories posted by other users; channels only\n", "name": "can_delete_stories", "required": false }, diff --git a/.butcher/types/Update/entity.json b/.butcher/types/Update/entity.json index 1ee46f08..9ccf33e5 100644 --- a/.butcher/types/Update/entity.json +++ b/.butcher/types/Update/entity.json @@ -117,9 +117,9 @@ }, { "type": "ChatMemberUpdated", - "description": "A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify 'chat_member' in the list of allowed_updates to receive these updates.", - "html_description": "Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.", - "rst_description": "*Optional*. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify 'chat_member' in the list of *allowed_updates* to receive these updates.\n", + "description": "A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \"chat_member\" in the list of allowed_updates to receive these updates.", + "html_description": "Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \"chat_member\" in the list of allowed_updates to receive these updates.", + "rst_description": "*Optional*. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify :code:`\"chat_member\"` in the list of *allowed_updates* to receive these updates.\n", "name": "chat_member", "required": false }, diff --git a/Makefile b/Makefile index 327f94df..0464bd45 100644 --- a/Makefile +++ b/Makefile @@ -119,3 +119,16 @@ release: git add . git commit -m "Release $(shell poetry version -s)" git tag v$(shell hatch version -s) + + +butcher_version := 0.1.23 + +butcher-install: + pip install -U git+ssh://git@github.com/aiogram/butcher.git@v$(butcher_version) +.PHONY: butcher-install + +butcher: + butcher parse + butcher refresh + butcher apply all +.PHONY: butcher diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index 3a360c25..bcaeff35 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -1849,7 +1849,7 @@ class Bot: :param offset: Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as :class:`aiogram.methods.get_updates.GetUpdates` is called with an *offset* higher than its *update_id*. The negative offset can be specified to retrieve updates starting from *-offset* update from the end of the updates queue. All previous updates will be forgotten. :param limit: Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. :param timeout: Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. - :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used. + :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used. :param request_timeout: Request timeout :return: Returns an Array of :class:`aiogram.types.update.Update` objects. """ @@ -1972,15 +1972,18 @@ class Bot: user_id: int, is_anonymous: Optional[bool] = None, can_manage_chat: Optional[bool] = None, - can_post_messages: Optional[bool] = None, - can_edit_messages: Optional[bool] = None, can_delete_messages: Optional[bool] = None, can_manage_video_chats: Optional[bool] = None, can_restrict_members: Optional[bool] = None, can_promote_members: Optional[bool] = None, can_change_info: Optional[bool] = None, can_invite_users: Optional[bool] = None, + can_post_messages: Optional[bool] = None, + can_edit_messages: Optional[bool] = None, can_pin_messages: Optional[bool] = None, + can_post_stories: Optional[bool] = None, + can_edit_stories: Optional[bool] = None, + can_delete_stories: Optional[bool] = None, can_manage_topics: Optional[bool] = None, request_timeout: Optional[int] = None, ) -> bool: @@ -1992,16 +1995,19 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param user_id: Unique identifier of the target user :param is_anonymous: Pass :code:`True` if the administrator's presence in the chat is hidden - :param can_manage_chat: Pass :code:`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 - :param can_post_messages: Pass :code:`True` if the administrator can create channel posts, channels only - :param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages, channels only + :param can_manage_chat: Pass :code:`True` if the administrator can access the chat event log, 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 :param can_delete_messages: Pass :code:`True` if the administrator can delete messages of other users :param can_manage_video_chats: Pass :code:`True` if the administrator can manage video chats - :param can_restrict_members: Pass :code:`True` if the administrator can restrict, ban or unban chat members + :param can_restrict_members: Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics :param can_promote_members: Pass :code:`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 were appointed by him) :param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings :param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat + :param can_post_messages: Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only + :param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only :param can_pin_messages: Pass :code:`True` if the administrator can pin messages, supergroups only + :param can_post_stories: Pass :code:`True` if the administrator can post stories in the channel; channels only + :param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users; channels only + :param can_delete_stories: Pass :code:`True` if the administrator can delete stories posted by other users; channels only :param can_manage_topics: Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only :param request_timeout: Request timeout :return: Returns :code:`True` on success. @@ -2012,15 +2018,18 @@ class Bot: user_id=user_id, is_anonymous=is_anonymous, can_manage_chat=can_manage_chat, - can_post_messages=can_post_messages, - can_edit_messages=can_edit_messages, can_delete_messages=can_delete_messages, can_manage_video_chats=can_manage_video_chats, can_restrict_members=can_restrict_members, can_promote_members=can_promote_members, can_change_info=can_change_info, can_invite_users=can_invite_users, + can_post_messages=can_post_messages, + can_edit_messages=can_edit_messages, can_pin_messages=can_pin_messages, + can_post_stories=can_post_stories, + can_edit_stories=can_edit_stories, + can_delete_stories=can_delete_stories, can_manage_topics=can_manage_topics, ) return await self(call, request_timeout=request_timeout) @@ -3481,7 +3490,7 @@ class Bot: :param certificate: Upload your public key certificate so that the root certificate in use can be checked. See our `self-signed guide `_ for details. :param ip_address: The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS :param max_connections: The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. - :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used. + :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used. :param drop_pending_updates: Pass :code:`True` to drop all pending updates :param secret_token: A secret token to be sent in a header 'X-Telegram-Bot-Api-Secret-Token' in every webhook request, 1-256 characters. Only characters :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed. The header is useful to ensure that the request comes from a webhook set by you. :param request_timeout: Request timeout diff --git a/aiogram/methods/get_updates.py b/aiogram/methods/get_updates.py index 5c28aea3..dd9f855e 100644 --- a/aiogram/methods/get_updates.py +++ b/aiogram/methods/get_updates.py @@ -29,7 +29,7 @@ class GetUpdates(TelegramMethod[List[Update]]): timeout: Optional[int] = None """Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.""" allowed_updates: Optional[List[str]] = None - """A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.""" + """A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/methods/promote_chat_member.py b/aiogram/methods/promote_chat_member.py index 4f9377d3..8be42d30 100644 --- a/aiogram/methods/promote_chat_member.py +++ b/aiogram/methods/promote_chat_member.py @@ -22,25 +22,31 @@ class PromoteChatMember(TelegramMethod[bool]): is_anonymous: Optional[bool] = None """Pass :code:`True` if the administrator's presence in the chat is hidden""" can_manage_chat: Optional[bool] = None - """Pass :code:`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_post_messages: Optional[bool] = None - """Pass :code:`True` if the administrator can create channel posts, channels only""" - can_edit_messages: Optional[bool] = None - """Pass :code:`True` if the administrator can edit messages of other users and can pin messages, channels only""" + """Pass :code:`True` if the administrator can access the chat event log, 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: Optional[bool] = None """Pass :code:`True` if the administrator can delete messages of other users""" can_manage_video_chats: Optional[bool] = None """Pass :code:`True` if the administrator can manage video chats""" can_restrict_members: Optional[bool] = None - """Pass :code:`True` if the administrator can restrict, ban or unban chat members""" + """Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics""" can_promote_members: Optional[bool] = None """Pass :code:`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 were appointed by him)""" can_change_info: Optional[bool] = None """Pass :code:`True` if the administrator can change chat title, photo and other settings""" can_invite_users: Optional[bool] = None """Pass :code:`True` if the administrator can invite new users to the chat""" + can_post_messages: Optional[bool] = None + """Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only""" + can_edit_messages: Optional[bool] = None + """Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only""" can_pin_messages: Optional[bool] = None """Pass :code:`True` if the administrator can pin messages, supergroups only""" + can_post_stories: Optional[bool] = None + """Pass :code:`True` if the administrator can post stories in the channel; channels only""" + can_edit_stories: Optional[bool] = None + """Pass :code:`True` if the administrator can edit stories posted by other users; channels only""" + can_delete_stories: Optional[bool] = None + """Pass :code:`True` if the administrator can delete stories posted by other users; channels only""" can_manage_topics: Optional[bool] = None """Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only""" @@ -55,15 +61,18 @@ class PromoteChatMember(TelegramMethod[bool]): user_id: int, is_anonymous: Optional[bool] = None, can_manage_chat: Optional[bool] = None, - can_post_messages: Optional[bool] = None, - can_edit_messages: Optional[bool] = None, can_delete_messages: Optional[bool] = None, can_manage_video_chats: Optional[bool] = None, can_restrict_members: Optional[bool] = None, can_promote_members: Optional[bool] = None, can_change_info: Optional[bool] = None, can_invite_users: Optional[bool] = None, + can_post_messages: Optional[bool] = None, + can_edit_messages: Optional[bool] = None, can_pin_messages: Optional[bool] = None, + can_post_stories: Optional[bool] = None, + can_edit_stories: Optional[bool] = None, + can_delete_stories: Optional[bool] = None, can_manage_topics: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: @@ -76,15 +85,18 @@ class PromoteChatMember(TelegramMethod[bool]): user_id=user_id, is_anonymous=is_anonymous, can_manage_chat=can_manage_chat, - can_post_messages=can_post_messages, - can_edit_messages=can_edit_messages, can_delete_messages=can_delete_messages, can_manage_video_chats=can_manage_video_chats, can_restrict_members=can_restrict_members, can_promote_members=can_promote_members, can_change_info=can_change_info, can_invite_users=can_invite_users, + can_post_messages=can_post_messages, + can_edit_messages=can_edit_messages, can_pin_messages=can_pin_messages, + can_post_stories=can_post_stories, + can_edit_stories=can_edit_stories, + can_delete_stories=can_delete_stories, can_manage_topics=can_manage_topics, **__pydantic_kwargs, ) diff --git a/aiogram/methods/set_webhook.py b/aiogram/methods/set_webhook.py index 92892531..da8ec9d4 100644 --- a/aiogram/methods/set_webhook.py +++ b/aiogram/methods/set_webhook.py @@ -35,7 +35,7 @@ class SetWebhook(TelegramMethod[bool]): max_connections: Optional[int] = None """The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.""" allowed_updates: Optional[List[str]] = None - """A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.""" + """A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.""" drop_pending_updates: Optional[bool] = None """Pass :code:`True` to drop all pending updates""" secret_token: Optional[str] = None diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index b5bcd5d4..d2ef2487 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -811,15 +811,18 @@ class Chat(TelegramObject): user_id: int, is_anonymous: Optional[bool] = None, can_manage_chat: Optional[bool] = None, - can_post_messages: Optional[bool] = None, - can_edit_messages: Optional[bool] = None, can_delete_messages: Optional[bool] = None, can_manage_video_chats: Optional[bool] = None, can_restrict_members: Optional[bool] = None, can_promote_members: Optional[bool] = None, can_change_info: Optional[bool] = None, can_invite_users: Optional[bool] = None, + can_post_messages: Optional[bool] = None, + can_edit_messages: Optional[bool] = None, can_pin_messages: Optional[bool] = None, + can_post_stories: Optional[bool] = None, + can_edit_stories: Optional[bool] = None, + can_delete_stories: Optional[bool] = None, can_manage_topics: Optional[bool] = None, **kwargs: Any, ) -> PromoteChatMember: @@ -835,16 +838,19 @@ class Chat(TelegramObject): :param user_id: Unique identifier of the target user :param is_anonymous: Pass :code:`True` if the administrator's presence in the chat is hidden - :param can_manage_chat: Pass :code:`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 - :param can_post_messages: Pass :code:`True` if the administrator can create channel posts, channels only - :param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages, channels only + :param can_manage_chat: Pass :code:`True` if the administrator can access the chat event log, 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 :param can_delete_messages: Pass :code:`True` if the administrator can delete messages of other users :param can_manage_video_chats: Pass :code:`True` if the administrator can manage video chats - :param can_restrict_members: Pass :code:`True` if the administrator can restrict, ban or unban chat members + :param can_restrict_members: Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics :param can_promote_members: Pass :code:`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 were appointed by him) :param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings :param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat + :param can_post_messages: Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only + :param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only :param can_pin_messages: Pass :code:`True` if the administrator can pin messages, supergroups only + :param can_post_stories: Pass :code:`True` if the administrator can post stories in the channel; channels only + :param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users; channels only + :param can_delete_stories: Pass :code:`True` if the administrator can delete stories posted by other users; channels only :param can_manage_topics: Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only :return: instance of method :class:`aiogram.methods.promote_chat_member.PromoteChatMember` """ @@ -858,15 +864,18 @@ class Chat(TelegramObject): user_id=user_id, is_anonymous=is_anonymous, can_manage_chat=can_manage_chat, - can_post_messages=can_post_messages, - can_edit_messages=can_edit_messages, can_delete_messages=can_delete_messages, can_manage_video_chats=can_manage_video_chats, can_restrict_members=can_restrict_members, can_promote_members=can_promote_members, can_change_info=can_change_info, can_invite_users=can_invite_users, + can_post_messages=can_post_messages, + can_edit_messages=can_edit_messages, can_pin_messages=can_pin_messages, + can_post_stories=can_post_stories, + can_edit_stories=can_edit_stories, + can_delete_stories=can_delete_stories, can_manage_topics=can_manage_topics, **kwargs, ).as_(self._bot) diff --git a/aiogram/types/chat_administrator_rights.py b/aiogram/types/chat_administrator_rights.py index da5179b7..cccda5b2 100644 --- a/aiogram/types/chat_administrator_rights.py +++ b/aiogram/types/chat_administrator_rights.py @@ -18,13 +18,13 @@ class ChatAdministratorRights(TelegramObject): is_anonymous: bool """:code:`True`, if the user's presence in the chat is hidden""" can_manage_chat: bool - """:code:`True`, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege""" + """:code:`True`, if the administrator can access the chat event log, 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: bool """:code:`True`, if the administrator can delete messages of other users""" can_manage_video_chats: bool """:code:`True`, if the administrator can manage video chats""" can_restrict_members: bool - """:code:`True`, if the administrator can restrict, ban or unban chat members""" + """:code:`True`, if the administrator can restrict, ban or unban chat members, or access supergroup statistics""" can_promote_members: bool """:code:`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 were appointed by the user)""" can_change_info: bool @@ -32,7 +32,7 @@ class ChatAdministratorRights(TelegramObject): can_invite_users: bool """:code:`True`, if the user is allowed to invite new users to the chat""" can_post_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the administrator can post messages in the channel; channels only""" + """*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only""" can_edit_messages: Optional[bool] = None """*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only""" can_pin_messages: Optional[bool] = None @@ -42,7 +42,7 @@ class ChatAdministratorRights(TelegramObject): can_edit_stories: Optional[bool] = None """*Optional*. :code:`True`, if the administrator can edit stories posted by other users; channels only""" can_delete_stories: Optional[bool] = None - """*Optional*. :code:`True`, if the administrator can delete stories posted by other users""" + """*Optional*. :code:`True`, if the administrator can delete stories posted by other users; channels only""" can_manage_topics: Optional[bool] = None """*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only""" diff --git a/aiogram/types/chat_join_request.py b/aiogram/types/chat_join_request.py index 9a9f73b9..b8ba33d2 100644 --- a/aiogram/types/chat_join_request.py +++ b/aiogram/types/chat_join_request.py @@ -63,7 +63,7 @@ class ChatJoinRequest(TelegramObject): from_user: User = Field(..., alias="from") """User that sent the join request""" user_chat_id: int - """Identifier of a private chat with the user who sent the join 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 until the join request is processed, assuming no other administrator contacted the user.""" + """Identifier of a private chat with the user who sent the join 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 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.""" date: DateTime """Date the request was sent in Unix time""" bio: Optional[str] = None diff --git a/aiogram/types/chat_member_administrator.py b/aiogram/types/chat_member_administrator.py index 0db04dce..215ff0bd 100644 --- a/aiogram/types/chat_member_administrator.py +++ b/aiogram/types/chat_member_administrator.py @@ -25,13 +25,13 @@ class ChatMemberAdministrator(ChatMember): is_anonymous: bool """:code:`True`, if the user's presence in the chat is hidden""" can_manage_chat: bool - """:code:`True`, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege""" + """:code:`True`, if the administrator can access the chat event log, 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: bool """:code:`True`, if the administrator can delete messages of other users""" can_manage_video_chats: bool """:code:`True`, if the administrator can manage video chats""" can_restrict_members: bool - """:code:`True`, if the administrator can restrict, ban or unban chat members""" + """:code:`True`, if the administrator can restrict, ban or unban chat members, or access supergroup statistics""" can_promote_members: bool """:code:`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 were appointed by the user)""" can_change_info: bool @@ -39,7 +39,7 @@ class ChatMemberAdministrator(ChatMember): can_invite_users: bool """:code:`True`, if the user is allowed to invite new users to the chat""" can_post_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the administrator can post messages in the channel; channels only""" + """*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only""" can_edit_messages: Optional[bool] = None """*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only""" can_pin_messages: Optional[bool] = None @@ -49,7 +49,7 @@ class ChatMemberAdministrator(ChatMember): can_edit_stories: Optional[bool] = None """*Optional*. :code:`True`, if the administrator can edit stories posted by other users; channels only""" can_delete_stories: Optional[bool] = None - """*Optional*. :code:`True`, if the administrator can delete stories posted by other users""" + """*Optional*. :code:`True`, if the administrator can delete stories posted by other users; channels only""" can_manage_topics: Optional[bool] = None """*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only""" custom_title: Optional[str] = None diff --git a/aiogram/types/update.py b/aiogram/types/update.py index dbaa3222..aed68270 100644 --- a/aiogram/types/update.py +++ b/aiogram/types/update.py @@ -54,7 +54,7 @@ class Update(TelegramObject): my_chat_member: Optional[ChatMemberUpdated] = None """*Optional*. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.""" chat_member: Optional[ChatMemberUpdated] = None - """*Optional*. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify 'chat_member' in the list of *allowed_updates* to receive these updates.""" + """*Optional*. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify :code:`"chat_member"` in the list of *allowed_updates* to receive these updates.""" chat_join_request: Optional[ChatJoinRequest] = None """*Optional*. A request to join the chat has been sent. The bot must have the *can_invite_users* administrator right in the chat to receive these updates."""