From fec138977db889e2a9ec6e01616bf6269ce54538 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Fri, 22 Sep 2023 17:46:57 +0300 Subject: [PATCH] Telegram Bot API 6.9 (#1319) * Added support for Bot API 6.9 * Bump API * Added changelog --- .apiversion | 2 +- .butcher/methods/banChatMember/entity.json | 6 +- .../methods/restrictChatMember/entity.json | 6 +- .butcher/schema/schema.json | 148 +++++++++++++----- .butcher/types/Chat/entity.json | 6 +- .../types/ChatAdministratorRights/entity.json | 36 ++++- .../types/ChatMemberAdministrator/entity.json | 36 ++++- .butcher/types/ChatMemberBanned/entity.json | 6 +- .../types/ChatMemberRestricted/entity.json | 6 +- .../InlineQueryResultsButton/entity.json | 4 +- .butcher/types/Message/entity.json | 6 +- .butcher/types/WebAppInfo/entity.json | 4 +- .butcher/types/WriteAccessAllowed/entity.json | 28 +++- CHANGES/{1262.feature => 1262.feature.rst} | 0 CHANGES/{1303.bugfix => 1303.bugfix.rst} | 0 CHANGES/1319.feature.rst | 1 + README.rst | 2 +- aiogram/__meta__.py | 4 +- aiogram/client/bot.py | 4 +- aiogram/methods/ban_chat_member.py | 2 +- aiogram/methods/restrict_chat_member.py | 2 +- aiogram/types/chat.py | 6 +- aiogram/types/chat_administrator_rights.py | 16 +- aiogram/types/chat_member_administrator.py | 16 +- aiogram/types/chat_member_banned.py | 2 +- aiogram/types/chat_member_restricted.py | 2 +- aiogram/types/inline_query_results_button.py | 2 +- aiogram/types/message.py | 2 +- aiogram/types/web_app_info.py | 2 +- aiogram/types/write_access_allowed.py | 22 ++- examples/multibot.py | 2 +- pyproject.toml | 6 +- 32 files changed, 277 insertions(+), 110 deletions(-) rename CHANGES/{1262.feature => 1262.feature.rst} (100%) rename CHANGES/{1303.bugfix => 1303.bugfix.rst} (100%) create mode 100644 CHANGES/1319.feature.rst diff --git a/.apiversion b/.apiversion index 21afad37..12e41412 100644 --- a/.apiversion +++ b/.apiversion @@ -1 +1 @@ -6.8 +6.9 diff --git a/.butcher/methods/banChatMember/entity.json b/.butcher/methods/banChatMember/entity.json index c6ee2e8e..9a5eda0d 100644 --- a/.butcher/methods/banChatMember/entity.json +++ b/.butcher/methods/banChatMember/entity.json @@ -30,9 +30,9 @@ { "type": "Integer", "required": false, - "description": "Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", - "html_description": "Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", - "rst_description": "Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.\n", + "description": "Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", + "html_description": "Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", + "rst_description": "Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.\n", "name": "until_date" }, { diff --git a/.butcher/methods/restrictChatMember/entity.json b/.butcher/methods/restrictChatMember/entity.json index f0ed7537..38d78844 100644 --- a/.butcher/methods/restrictChatMember/entity.json +++ b/.butcher/methods/restrictChatMember/entity.json @@ -46,9 +46,9 @@ { "type": "Integer", "required": false, - "description": "Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", - "html_description": "Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", - "rst_description": "Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever\n", + "description": "Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", + "html_description": "Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", + "rst_description": "Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever\n", "name": "until_date" } ], diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index d4ec9ad1..7f4457cc 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -1,7 +1,7 @@ { "api": { - "version": "6.8", - "release_date": "2023-08-18" + "version": "6.9", + "release_date": "2023-09-22" }, "items": [ { @@ -549,9 +549,9 @@ }, { "type": "Integer", - "description": "Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", - "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", - "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.", + "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.", + "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "emoji_status_expiration_date", "required": false }, @@ -1167,9 +1167,9 @@ }, { "type": "WriteAccessAllowed", - "description": "Service message: the user allowed the bot added to the attachment menu to write messages", - "html_description": "Optional. Service message: the user allowed the bot added to the attachment menu to write messages", - "rst_description": "*Optional*. Service message: the user allowed the bot added to the attachment menu to write messages\n", + "description": "Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess", + "html_description": "Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess", + "rst_description": "*Optional*. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method `requestWriteAccess `_\n", "name": "write_access_allowed", "required": false }, @@ -2454,17 +2454,33 @@ { "anchor": "writeaccessallowed", "name": "WriteAccessAllowed", - "description": "This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.", - "html_description": "

This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.

", - "rst_description": "This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.", + "description": "This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.", + "html_description": "

This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.

", + "rst_description": "This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method `requestWriteAccess `_.", "annotations": [ + { + "type": "Boolean", + "description": "True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess", + "html_description": "Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess", + "rst_description": "*Optional*. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method `requestWriteAccess `_\n", + "name": "from_request", + "required": false + }, { "type": "String", - "description": "Name of the Web App which was launched from a link", - "html_description": "Optional. Name of the Web App which was launched from a link", - "rst_description": "*Optional*. Name of the Web App which was launched from a link\n", + "description": "Name of the Web App, if the access was granted when the Web App was launched from a link", + "html_description": "Optional. Name of the Web App, if the access was granted when the Web App was launched from a link", + "rst_description": "*Optional*. Name of the Web App, if the access was granted when the Web App was launched from a link\n", "name": "web_app_name", "required": false + }, + { + "type": "Boolean", + "description": "True, if the access was granted when the bot was added to the attachment or side menu", + "html_description": "Optional. True, if the access was granted when the bot was added to the attachment or side menu", + "rst_description": "*Optional*. True, if the access was granted when the bot was added to the attachment or side menu\n", + "name": "from_attachment_menu", + "required": false } ], "category": "types" @@ -2610,8 +2626,8 @@ { "type": "String", "description": "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps", - "html_description": "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps", - "rst_description": "An HTTPS URL of a Web App to be opened with additional data as specified in `Initializing Web Apps `_\n", + "html_description": "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps", + "rst_description": "An HTTPS URL of a Web App to be opened with additional data as specified in `Initializing Web Apps `_\n", "name": "url", "required": true } @@ -3335,9 +3351,9 @@ }, { "type": "Boolean", - "description": "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": "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": ":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": "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", "name": "can_manage_chat", "required": true }, @@ -3391,9 +3407,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post in the channel; channels only", - "html_description": "Optional. True, if the administrator can post in the channel; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post in the channel; channels only\n", + "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", "name": "can_post_messages", "required": false }, @@ -3413,6 +3429,30 @@ "name": "can_pin_messages", "required": false }, + { + "type": "Boolean", + "description": "True, if the administrator can post stories in the channel; channels only", + "html_description": "Optional. True, if the administrator can post stories in the channel; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post stories in the channel; channels only\n", + "name": "can_post_stories", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the administrator can edit stories posted by other users; channels only", + "html_description": "Optional. True, if the administrator can edit stories posted by other users; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can edit stories posted by other users; channels only\n", + "name": "can_edit_stories", + "required": false + }, + { + "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", + "name": "can_delete_stories", + "required": false + }, { "type": "Boolean", "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", @@ -3516,9 +3556,9 @@ }, { "type": "Boolean", - "description": "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": "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": ":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": "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", "name": "can_manage_chat", "required": true }, @@ -3572,9 +3612,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post in the channel; channels only", - "html_description": "Optional. True, if the administrator can post in the channel; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post in the channel; channels only\n", + "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", "name": "can_post_messages", "required": false }, @@ -3594,6 +3634,30 @@ "name": "can_pin_messages", "required": false }, + { + "type": "Boolean", + "description": "True, if the administrator can post stories in the channel; channels only", + "html_description": "Optional. True, if the administrator can post stories in the channel; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post stories in the channel; channels only\n", + "name": "can_post_stories", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the administrator can edit stories posted by other users; channels only", + "html_description": "Optional. True, if the administrator can edit stories posted by other users; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can edit stories posted by other users; channels only\n", + "name": "can_edit_stories", + "required": false + }, + { + "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", + "name": "can_delete_stories", + "required": false + }, { "type": "Boolean", "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", @@ -3784,9 +3848,9 @@ }, { "type": "Integer", - "description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever", - "html_description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever", - "rst_description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever\n", + "description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever", + "html_description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever", + "rst_description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever\n", "name": "until_date", "required": true } @@ -3844,9 +3908,9 @@ }, { "type": "Integer", - "description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever", - "html_description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever", - "rst_description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever\n", + "description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever", + "html_description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever", + "rst_description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever\n", "name": "until_date", "required": true } @@ -6821,9 +6885,9 @@ { "type": "Integer", "required": false, - "description": "Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", - "html_description": "Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", - "rst_description": "Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.\n", + "description": "Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", + "html_description": "Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", + "rst_description": "Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.\n", "name": "until_date" }, { @@ -6913,9 +6977,9 @@ { "type": "Integer", "required": false, - "description": "Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", - "html_description": "Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", - "rst_description": "Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever\n", + "description": "Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", + "html_description": "Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", + "rst_description": "Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever\n", "name": "until_date" } ], @@ -9681,8 +9745,8 @@ { "type": "WebAppInfo", "description": "Description of the 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 inside the Web App.", - "html_description": "Optional. Description of the 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 inside the Web App.", - "rst_description": "*Optional*. Description of the `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 `_ inside the Web App.\n", + "html_description": "Optional. Description of the 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 inside the Web App.", + "rst_description": "*Optional*. Description of the `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 `_ inside the Web App.\n", "name": "web_app", "required": false }, diff --git a/.butcher/types/Chat/entity.json b/.butcher/types/Chat/entity.json index 4bc1fb60..0a65849d 100644 --- a/.butcher/types/Chat/entity.json +++ b/.butcher/types/Chat/entity.json @@ -93,9 +93,9 @@ }, { "type": "Integer", - "description": "Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", - "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", - "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.", + "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.", + "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "emoji_status_expiration_date", "required": false }, diff --git a/.butcher/types/ChatAdministratorRights/entity.json b/.butcher/types/ChatAdministratorRights/entity.json index 6d5951e8..eb3b1c14 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, 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, 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, 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, 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", "name": "can_manage_chat", "required": true }, @@ -77,9 +77,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post in the channel; channels only", - "html_description": "Optional. True, if the administrator can post in the channel; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post in the channel; channels only\n", + "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", "name": "can_post_messages", "required": false }, @@ -99,6 +99,30 @@ "name": "can_pin_messages", "required": false }, + { + "type": "Boolean", + "description": "True, if the administrator can post stories in the channel; channels only", + "html_description": "Optional. True, if the administrator can post stories in the channel; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post stories in the channel; channels only\n", + "name": "can_post_stories", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the administrator can edit stories posted by other users; channels only", + "html_description": "Optional. True, if the administrator can edit stories posted by other users; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can edit stories posted by other users; channels only\n", + "name": "can_edit_stories", + "required": false + }, + { + "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", + "name": "can_delete_stories", + "required": false + }, { "type": "Boolean", "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", diff --git a/.butcher/types/ChatMemberAdministrator/entity.json b/.butcher/types/ChatMemberAdministrator/entity.json index 577d9daf..65981631 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, 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, 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, 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, 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", "name": "can_manage_chat", "required": true }, @@ -101,9 +101,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post in the channel; channels only", - "html_description": "Optional. True, if the administrator can post in the channel; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post in the channel; channels only\n", + "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", "name": "can_post_messages", "required": false }, @@ -123,6 +123,30 @@ "name": "can_pin_messages", "required": false }, + { + "type": "Boolean", + "description": "True, if the administrator can post stories in the channel; channels only", + "html_description": "Optional. True, if the administrator can post stories in the channel; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post stories in the channel; channels only\n", + "name": "can_post_stories", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the administrator can edit stories posted by other users; channels only", + "html_description": "Optional. True, if the administrator can edit stories posted by other users; channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can edit stories posted by other users; channels only\n", + "name": "can_edit_stories", + "required": false + }, + { + "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", + "name": "can_delete_stories", + "required": false + }, { "type": "Boolean", "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", diff --git a/.butcher/types/ChatMemberBanned/entity.json b/.butcher/types/ChatMemberBanned/entity.json index 49d42e20..4da411ec 100644 --- a/.butcher/types/ChatMemberBanned/entity.json +++ b/.butcher/types/ChatMemberBanned/entity.json @@ -29,9 +29,9 @@ }, { "type": "Integer", - "description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever", - "html_description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever", - "rst_description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever\n", + "description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever", + "html_description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever", + "rst_description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever\n", "name": "until_date", "required": true } diff --git a/.butcher/types/ChatMemberRestricted/entity.json b/.butcher/types/ChatMemberRestricted/entity.json index 958ad57a..1c46132d 100644 --- a/.butcher/types/ChatMemberRestricted/entity.json +++ b/.butcher/types/ChatMemberRestricted/entity.json @@ -149,9 +149,9 @@ }, { "type": "Integer", - "description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever", - "html_description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever", - "rst_description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever\n", + "description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever", + "html_description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever", + "rst_description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever\n", "name": "until_date", "required": true } diff --git a/.butcher/types/InlineQueryResultsButton/entity.json b/.butcher/types/InlineQueryResultsButton/entity.json index ce4cdf1e..a66c2f3b 100644 --- a/.butcher/types/InlineQueryResultsButton/entity.json +++ b/.butcher/types/InlineQueryResultsButton/entity.json @@ -22,8 +22,8 @@ { "type": "WebAppInfo", "description": "Description of the 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 inside the Web App.", - "html_description": "Optional. Description of the 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 inside the Web App.", - "rst_description": "*Optional*. Description of the `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 `_ inside the Web App.\n", + "html_description": "Optional. Description of the 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 inside the Web App.", + "rst_description": "*Optional*. Description of the `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 `_ inside the Web App.\n", "name": "web_app", "required": false }, diff --git a/.butcher/types/Message/entity.json b/.butcher/types/Message/entity.json index ef639796..993d37eb 100644 --- a/.butcher/types/Message/entity.json +++ b/.butcher/types/Message/entity.json @@ -469,9 +469,9 @@ }, { "type": "WriteAccessAllowed", - "description": "Service message: the user allowed the bot added to the attachment menu to write messages", - "html_description": "Optional. Service message: the user allowed the bot added to the attachment menu to write messages", - "rst_description": "*Optional*. Service message: the user allowed the bot added to the attachment menu to write messages\n", + "description": "Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess", + "html_description": "Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess", + "rst_description": "*Optional*. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method `requestWriteAccess `_\n", "name": "write_access_allowed", "required": false }, diff --git a/.butcher/types/WebAppInfo/entity.json b/.butcher/types/WebAppInfo/entity.json index a0ec3c45..aaeed289 100644 --- a/.butcher/types/WebAppInfo/entity.json +++ b/.butcher/types/WebAppInfo/entity.json @@ -14,8 +14,8 @@ { "type": "String", "description": "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps", - "html_description": "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps", - "rst_description": "An HTTPS URL of a Web App to be opened with additional data as specified in `Initializing Web Apps `_\n", + "html_description": "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps", + "rst_description": "An HTTPS URL of a Web App to be opened with additional data as specified in `Initializing Web Apps `_\n", "name": "url", "required": true } diff --git a/.butcher/types/WriteAccessAllowed/entity.json b/.butcher/types/WriteAccessAllowed/entity.json index 62d83fdd..d054736a 100644 --- a/.butcher/types/WriteAccessAllowed/entity.json +++ b/.butcher/types/WriteAccessAllowed/entity.json @@ -7,17 +7,33 @@ "object": { "anchor": "writeaccessallowed", "name": "WriteAccessAllowed", - "description": "This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.", - "html_description": "

This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.

", - "rst_description": "This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.", + "description": "This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.", + "html_description": "

This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.

", + "rst_description": "This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method `requestWriteAccess `_.", "annotations": [ + { + "type": "Boolean", + "description": "True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess", + "html_description": "Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess", + "rst_description": "*Optional*. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method `requestWriteAccess `_\n", + "name": "from_request", + "required": false + }, { "type": "String", - "description": "Name of the Web App which was launched from a link", - "html_description": "Optional. Name of the Web App which was launched from a link", - "rst_description": "*Optional*. Name of the Web App which was launched from a link\n", + "description": "Name of the Web App, if the access was granted when the Web App was launched from a link", + "html_description": "Optional. Name of the Web App, if the access was granted when the Web App was launched from a link", + "rst_description": "*Optional*. Name of the Web App, if the access was granted when the Web App was launched from a link\n", "name": "web_app_name", "required": false + }, + { + "type": "Boolean", + "description": "True, if the access was granted when the bot was added to the attachment or side menu", + "html_description": "Optional. True, if the access was granted when the bot was added to the attachment or side menu", + "rst_description": "*Optional*. True, if the access was granted when the bot was added to the attachment or side menu\n", + "name": "from_attachment_menu", + "required": false } ], "category": "types" diff --git a/CHANGES/1262.feature b/CHANGES/1262.feature.rst similarity index 100% rename from CHANGES/1262.feature rename to CHANGES/1262.feature.rst diff --git a/CHANGES/1303.bugfix b/CHANGES/1303.bugfix.rst similarity index 100% rename from CHANGES/1303.bugfix rename to CHANGES/1303.bugfix.rst diff --git a/CHANGES/1319.feature.rst b/CHANGES/1319.feature.rst new file mode 100644 index 00000000..2bd75ee4 --- /dev/null +++ b/CHANGES/1319.feature.rst @@ -0,0 +1 @@ +Added full support of `Bot API 6.9 `_ diff --git a/README.rst b/README.rst index af494848..1a2f360a 100644 --- a/README.rst +++ b/README.rst @@ -52,7 +52,7 @@ Features - Asynchronous (`asyncio docs `_, :pep:`492`) - Has type hints (:pep:`484`) and can be used with `mypy `_ - Supports `PyPy `_ -- Supports `Telegram Bot API 6.8 `_ and gets fast updates to the latest versions of the Bot API +- Supports `Telegram Bot API 6.9 `_ and gets fast updates to the latest versions of the Bot API - Telegram Bot API integration code was `autogenerated `_ and can be easily re-generated when API gets updated - Updates router (Blueprints) - Has Finite State Machine diff --git a/aiogram/__meta__.py b/aiogram/__meta__.py index bee8e1f3..64923c65 100644 --- a/aiogram/__meta__.py +++ b/aiogram/__meta__.py @@ -1,2 +1,2 @@ -__version__ = "3.0.1" -__api_version__ = "6.8" +__version__ = "3.1.0" +__api_version__ = "6.9" diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index 1bf48356..3a360c25 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -713,7 +713,7 @@ class Bot: :param chat_id: Unique identifier for the target group or username of the target supergroup or channel (in the format :code:`@channelusername`) :param user_id: Unique identifier of the target user - :param until_date: Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. + :param until_date: Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. :param revoke_messages: Pass :code:`True` to delete all messages from the chat for the user that is being removed. If :code:`False`, the user will be able to see messages in the group that were sent before the user was removed. Always :code:`True` for supergroups and channels. :param request_timeout: Request timeout :return: Returns :code:`True` on success. @@ -2066,7 +2066,7 @@ class Bot: :param user_id: Unique identifier of the target user :param permissions: A JSON-serialized object for new user permissions :param use_independent_chat_permissions: Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission. - :param until_date: Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever + :param until_date: Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever :param request_timeout: Request timeout :return: Returns :code:`True` on success. """ diff --git a/aiogram/methods/ban_chat_member.py b/aiogram/methods/ban_chat_member.py index bbfc9f75..947fccae 100644 --- a/aiogram/methods/ban_chat_member.py +++ b/aiogram/methods/ban_chat_member.py @@ -21,7 +21,7 @@ class BanChatMember(TelegramMethod[bool]): user_id: int """Unique identifier of the target user""" until_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None - """Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.""" + """Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.""" revoke_messages: Optional[bool] = None """Pass :code:`True` to delete all messages from the chat for the user that is being removed. If :code:`False`, the user will be able to see messages in the group that were sent before the user was removed. Always :code:`True` for supergroups and channels.""" diff --git a/aiogram/methods/restrict_chat_member.py b/aiogram/methods/restrict_chat_member.py index 331e95f7..5dfbd01d 100644 --- a/aiogram/methods/restrict_chat_member.py +++ b/aiogram/methods/restrict_chat_member.py @@ -26,7 +26,7 @@ class RestrictChatMember(TelegramMethod[bool]): use_independent_chat_permissions: Optional[bool] = None """Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission.""" until_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None - """Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever""" + """Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index 921ed3e7..b5bcd5d4 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -72,7 +72,7 @@ class Chat(TelegramObject): emoji_status_custom_emoji_id: Optional[str] = None """*Optional*. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" emoji_status_expiration_date: Optional[DateTime] = None - """*Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + """*Optional*. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" bio: Optional[str] = None """*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" has_private_forwards: Optional[bool] = None @@ -892,7 +892,7 @@ class Chat(TelegramObject): :param user_id: Unique identifier of the target user :param permissions: A JSON-serialized object for new user permissions :param use_independent_chat_permissions: Pass :code:`True` if chat permissions are set independently. Otherwise, the *can_send_other_messages* and *can_add_web_page_previews* permissions will imply the *can_send_messages*, *can_send_audios*, *can_send_documents*, *can_send_photos*, *can_send_videos*, *can_send_video_notes*, and *can_send_voice_notes* permissions; the *can_send_polls* permission will imply the *can_send_messages* permission. - :param until_date: Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever + :param until_date: Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever :return: instance of method :class:`aiogram.methods.restrict_chat_member.RestrictChatMember` """ # DO NOT EDIT MANUALLY!!! @@ -959,7 +959,7 @@ class Chat(TelegramObject): Source: https://core.telegram.org/bots/api#banchatmember :param user_id: Unique identifier of the target user - :param until_date: Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. + :param until_date: Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. :param revoke_messages: Pass :code:`True` to delete all messages from the chat for the user that is being removed. If :code:`False`, the user will be able to see messages in the group that were sent before the user was removed. Always :code:`True` for supergroups and channels. :return: instance of method :class:`aiogram.methods.ban_chat_member.BanChatMember` """ diff --git a/aiogram/types/chat_administrator_rights.py b/aiogram/types/chat_administrator_rights.py index 1da998d1..da5179b7 100644 --- a/aiogram/types/chat_administrator_rights.py +++ b/aiogram/types/chat_administrator_rights.py @@ -18,7 +18,7 @@ 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, 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, 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""" can_delete_messages: bool """:code:`True`, if the administrator can delete messages of other users""" can_manage_video_chats: bool @@ -32,11 +32,17 @@ 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 in the channel; channels only""" + """*Optional*. :code:`True`, if the administrator can post messages in the channel; 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 """*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only""" + can_post_stories: Optional[bool] = None + """*Optional*. :code:`True`, if the administrator can post stories in the channel; channels only""" + 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""" can_manage_topics: Optional[bool] = None """*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only""" @@ -58,6 +64,9 @@ class ChatAdministratorRights(TelegramObject): 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: @@ -77,6 +86,9 @@ class ChatAdministratorRights(TelegramObject): 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/types/chat_member_administrator.py b/aiogram/types/chat_member_administrator.py index 02a3be39..0db04dce 100644 --- a/aiogram/types/chat_member_administrator.py +++ b/aiogram/types/chat_member_administrator.py @@ -25,7 +25,7 @@ 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, 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, 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""" can_delete_messages: bool """:code:`True`, if the administrator can delete messages of other users""" can_manage_video_chats: bool @@ -39,11 +39,17 @@ 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 in the channel; channels only""" + """*Optional*. :code:`True`, if the administrator can post messages in the channel; 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 """*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only""" + can_post_stories: Optional[bool] = None + """*Optional*. :code:`True`, if the administrator can post stories in the channel; channels only""" + 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""" 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 @@ -70,6 +76,9 @@ class ChatMemberAdministrator(ChatMember): 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, custom_title: Optional[str] = None, **__pydantic_kwargs: Any, @@ -93,6 +102,9 @@ class ChatMemberAdministrator(ChatMember): 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, custom_title=custom_title, **__pydantic_kwargs, diff --git a/aiogram/types/chat_member_banned.py b/aiogram/types/chat_member_banned.py index 88cfc75e..65776c52 100644 --- a/aiogram/types/chat_member_banned.py +++ b/aiogram/types/chat_member_banned.py @@ -22,7 +22,7 @@ class ChatMemberBanned(ChatMember): user: User """Information about the user""" until_date: DateTime - """Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever""" + """Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/chat_member_restricted.py b/aiogram/types/chat_member_restricted.py index 32d4a0dc..b27d72a2 100644 --- a/aiogram/types/chat_member_restricted.py +++ b/aiogram/types/chat_member_restricted.py @@ -52,7 +52,7 @@ class ChatMemberRestricted(ChatMember): can_manage_topics: bool """:code:`True`, if the user is allowed to create forum topics""" until_date: DateTime - """Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever""" + """Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/inline_query_results_button.py b/aiogram/types/inline_query_results_button.py index c93172bb..6943fb89 100644 --- a/aiogram/types/inline_query_results_button.py +++ b/aiogram/types/inline_query_results_button.py @@ -18,7 +18,7 @@ class InlineQueryResultsButton(TelegramObject): text: str """Label text on the button""" web_app: Optional[WebAppInfo] = None - """*Optional*. Description of the `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 `_ inside the Web App.""" + """*Optional*. Description of the `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 `_ inside the Web App.""" start_parameter: Optional[str] = None """*Optional*. `Deep-linking `_ parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed.""" diff --git a/aiogram/types/message.py b/aiogram/types/message.py index 5ad60d5b..da3e1f98 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -223,7 +223,7 @@ class Message(TelegramObject): connected_website: Optional[str] = None """*Optional*. The domain name of the website on which the user has logged in. `More about Telegram Login ยป `_""" write_access_allowed: Optional[WriteAccessAllowed] = None - """*Optional*. Service message: the user allowed the bot added to the attachment menu to write messages""" + """*Optional*. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method `requestWriteAccess `_""" passport_data: Optional[PassportData] = None """*Optional*. Telegram Passport data""" proximity_alert_triggered: Optional[ProximityAlertTriggered] = None diff --git a/aiogram/types/web_app_info.py b/aiogram/types/web_app_info.py index 01d00d3d..fbf9846e 100644 --- a/aiogram/types/web_app_info.py +++ b/aiogram/types/web_app_info.py @@ -13,7 +13,7 @@ class WebAppInfo(TelegramObject): """ url: str - """An HTTPS URL of a Web App to be opened with additional data as specified in `Initializing Web Apps `_""" + """An HTTPS URL of a Web App to be opened with additional data as specified in `Initializing Web Apps `_""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/write_access_allowed.py b/aiogram/types/write_access_allowed.py index eb8b1d14..6b8e50a0 100644 --- a/aiogram/types/write_access_allowed.py +++ b/aiogram/types/write_access_allowed.py @@ -5,23 +5,37 @@ from aiogram.types import TelegramObject class WriteAccessAllowed(TelegramObject): """ - This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link. + This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method `requestWriteAccess `_. Source: https://core.telegram.org/bots/api#writeaccessallowed """ + from_request: Optional[bool] = None + """*Optional*. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method `requestWriteAccess `_""" web_app_name: Optional[str] = None - """*Optional*. Name of the Web App which was launched from a link""" + """*Optional*. Name of the Web App, if the access was granted when the Web App was launched from a link""" + from_attachment_menu: Optional[bool] = None + """*Optional*. True, if the access was granted when the bot was added to the attachment or side menu""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! # This section was auto-generated via `butcher` def __init__( - __pydantic__self__, *, web_app_name: Optional[str] = None, **__pydantic_kwargs: Any + __pydantic__self__, + *, + from_request: Optional[bool] = None, + web_app_name: Optional[str] = None, + from_attachment_menu: Optional[bool] = None, + **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! # This method was auto-generated via `butcher` # Is needed only for type checking and IDE support without any additional plugins - super().__init__(web_app_name=web_app_name, **__pydantic_kwargs) + super().__init__( + from_request=from_request, + web_app_name=web_app_name, + from_attachment_menu=from_attachment_menu, + **__pydantic_kwargs, + ) diff --git a/examples/multibot.py b/examples/multibot.py index 82fac4a1..d5dbe5fc 100644 --- a/examples/multibot.py +++ b/examples/multibot.py @@ -4,6 +4,7 @@ from os import getenv from typing import Any, Dict, Union from aiohttp import web +from finite_state_machine import form_router from aiogram import Bot, Dispatcher, F, Router from aiogram.client.session.aiohttp import AiohttpSession @@ -18,7 +19,6 @@ from aiogram.webhook.aiohttp_server import ( TokenBasedRequestHandler, setup_application, ) -from finite_state_machine import form_router main_router = Router() diff --git a/pyproject.toml b/pyproject.toml index aa31ab34..2f17fd81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -154,9 +154,9 @@ features = [ "test", "cli", ] -extra-dependencies = [ - "butcher @ git+https://github.com/aiogram/butcher.git@v0.1.22", -] +#extra-dependencies = [ +# "butcher @ git+https://github.com/aiogram/butcher.git@v0.1.22", +#] [tool.hatch.envs.dev.scripts] update = [