From e7c39cfdedbc02d1daa9d663d9460f4f51098b6a Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Thu, 21 Sep 2023 11:07:29 +0300 Subject: [PATCH] Added support for Bot API 6.9 --- .butcher/schema/schema.json | 100 ++++++++++++++---- .../types/ChatAdministratorRights/entity.json | 36 +++++-- .../types/ChatMemberAdministrator/entity.json | 36 +++++-- .butcher/types/Message/entity.json | 6 +- .butcher/types/WriteAccessAllowed/entity.json | 22 +++- aiogram/types/chat_administrator_rights.py | 16 ++- aiogram/types/chat_member_administrator.py | 16 ++- aiogram/types/message.py | 2 +- aiogram/types/write_access_allowed.py | 20 +++- 9 files changed, 210 insertions(+), 44 deletions(-) diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index d4ec9ad1..f035ca61 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -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 }, @@ -2460,11 +2460,27 @@ "annotations": [ { "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 + }, + { + "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 } ], "category": "types" @@ -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 }, @@ -3420,6 +3436,30 @@ "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only\n", "name": "can_manage_topics", "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 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 } ], "category": "types" @@ -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 }, @@ -3609,6 +3649,30 @@ "rst_description": "*Optional*. Custom title for this user\n", "name": "custom_title", "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 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 } ], "category": "types" diff --git a/.butcher/types/ChatAdministratorRights/entity.json b/.butcher/types/ChatAdministratorRights/entity.json index 6d5951e8..8c16341a 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 }, @@ -106,6 +106,30 @@ "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only\n", "name": "can_manage_topics", "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 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 } ], "category": "types" diff --git a/.butcher/types/ChatMemberAdministrator/entity.json b/.butcher/types/ChatMemberAdministrator/entity.json index 577d9daf..a4f18dfa 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 }, @@ -138,6 +138,30 @@ "rst_description": "*Optional*. Custom title for this user\n", "name": "custom_title", "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 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 } ], "category": "types" 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/WriteAccessAllowed/entity.json b/.butcher/types/WriteAccessAllowed/entity.json index 62d83fdd..60a6d80f 100644 --- a/.butcher/types/WriteAccessAllowed/entity.json +++ b/.butcher/types/WriteAccessAllowed/entity.json @@ -13,11 +13,27 @@ "annotations": [ { "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 + }, + { + "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 } ], "category": "types" diff --git a/aiogram/types/chat_administrator_rights.py b/aiogram/types/chat_administrator_rights.py index 1da998d1..cc0598f8 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,13 +32,19 @@ 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_manage_topics: Optional[bool] = None """*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only""" + can_delete_stories: Optional[bool] = None + """*Optional*. :code:`True`, if the administrator can delete stories posted by other users""" + 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""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -59,6 +65,9 @@ class ChatAdministratorRights(TelegramObject): can_edit_messages: Optional[bool] = None, can_pin_messages: Optional[bool] = None, can_manage_topics: Optional[bool] = None, + can_delete_stories: Optional[bool] = None, + can_post_stories: Optional[bool] = None, + can_edit_stories: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -78,5 +87,8 @@ class ChatAdministratorRights(TelegramObject): can_edit_messages=can_edit_messages, can_pin_messages=can_pin_messages, can_manage_topics=can_manage_topics, + can_delete_stories=can_delete_stories, + can_post_stories=can_post_stories, + can_edit_stories=can_edit_stories, **__pydantic_kwargs, ) diff --git a/aiogram/types/chat_member_administrator.py b/aiogram/types/chat_member_administrator.py index 02a3be39..7cfcd114 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,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 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 @@ -48,6 +48,12 @@ class ChatMemberAdministrator(ChatMember): """*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only""" custom_title: Optional[str] = None """*Optional*. Custom title for this user""" + can_delete_stories: Optional[bool] = None + """*Optional*. :code:`True`, if the administrator can delete stories posted by other users""" + 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""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -72,6 +78,9 @@ class ChatMemberAdministrator(ChatMember): can_pin_messages: Optional[bool] = None, can_manage_topics: Optional[bool] = None, custom_title: Optional[str] = None, + can_delete_stories: Optional[bool] = None, + can_post_stories: Optional[bool] = None, + can_edit_stories: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -95,5 +104,8 @@ class ChatMemberAdministrator(ChatMember): can_pin_messages=can_pin_messages, can_manage_topics=can_manage_topics, custom_title=custom_title, + can_delete_stories=can_delete_stories, + can_post_stories=can_post_stories, + can_edit_stories=can_edit_stories, **__pydantic_kwargs, ) 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/write_access_allowed.py b/aiogram/types/write_access_allowed.py index eb8b1d14..9f4d22d1 100644 --- a/aiogram/types/write_access_allowed.py +++ b/aiogram/types/write_access_allowed.py @@ -11,17 +11,31 @@ class WriteAccessAllowed(TelegramObject): """ 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""" + 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 `_""" 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__, + *, + web_app_name: Optional[str] = None, + from_attachment_menu: Optional[bool] = None, + from_request: 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__( + web_app_name=web_app_name, + from_attachment_menu=from_attachment_menu, + from_request=from_request, + **__pydantic_kwargs, + )