`_\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/.github/workflows/pull_request_changelog.yml b/.github/workflows/pull_request_changelog.yml
index f803153e..7f9d7b86 100644
--- a/.github/workflows/pull_request_changelog.yml
+++ b/.github/workflows/pull_request_changelog.yml
@@ -57,7 +57,7 @@ jobs:
For example, you can run `towncrier create .` to create a file in the change directory and then write a description on that file.
- Read more at [Towncrier docs](https://towncrier.readthedocs.io/en/latest/quickstart.html#creating-news-fragments)
+ Read more at [Towncrier docs](https://towncrier.readthedocs.io/en/latest/tutorial.html#creating-news-fragments)
- name: Changelog found
if: "success()"
diff --git a/CHANGES.rst b/CHANGES.rst
index 245c4f49..afeb8f86 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -16,6 +16,29 @@ Changelog
.. towncrier release notes start
+3.1.0 (2023-09-22)
+===================
+
+Features
+--------
+
+- Added support for custom encoders/decoders for payload (and also for deep-linking).
+ `#1262 `_
+- Added :class:`aiogram.utils.input_media.MediaGroupBuilder` for media group construction.
+ `#1293 `_
+- Added full support of `Bot API 6.9 `_
+ `#1319 `_
+
+
+Bugfixes
+--------
+
+- Added actual param hints for `InlineKeyboardBuilder` and `ReplyKeyboardBuilder`.
+ `#1303 `_
+- Fixed priority of events isolation, now user state will be loaded only after lock is acquired
+ `#1317 `_
+
+
3.0.0 (2023-09-01)
===================
diff --git a/CHANGES/1262.feature b/CHANGES/1262.feature
deleted file mode 100644
index 822c82ae..00000000
--- a/CHANGES/1262.feature
+++ /dev/null
@@ -1 +0,0 @@
-Added support for custom encoders/decoders for payload (and also for deep-linking).
diff --git a/CHANGES/1293.feature.rst b/CHANGES/1293.feature.rst
deleted file mode 100644
index f561be61..00000000
--- a/CHANGES/1293.feature.rst
+++ /dev/null
@@ -1 +0,0 @@
-Added :class:`aiogram.utils.input_media.MediaGroupBuilder` for media group construction.
diff --git a/LICENSE b/LICENSE
index f9721b14..caa060cc 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2017-2022 Alex Root Junior
+Copyright (c) 2017 - present Alex Root Junior
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
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/fsm/middleware.py b/aiogram/fsm/middleware.py
index 6de91a83..d1f1d973 100644
--- a/aiogram/fsm/middleware.py
+++ b/aiogram/fsm/middleware.py
@@ -34,8 +34,10 @@ class FSMContextMiddleware(BaseMiddleware):
context = self.resolve_event_context(bot, data)
data["fsm_storage"] = self.storage
if context:
- data.update({"state": context, "raw_state": await context.get_state()})
+ # Bugfix: https://github.com/aiogram/aiogram/issues/1317
+ # State should be loaded after lock is acquired
async with self.events_isolation.lock(key=context.key):
+ data.update({"state": context, "raw_state": await context.get_state()})
return await handler(event, data)
return await handler(event, data)
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/aiogram/utils/deep_linking.py b/aiogram/utils/deep_linking.py
index 7f9b3583..bfd62a16 100644
--- a/aiogram/utils/deep_linking.py
+++ b/aiogram/utils/deep_linking.py
@@ -56,10 +56,10 @@ __all__ = [
]
import re
-from typing import Callable, Literal, Optional, TYPE_CHECKING, cast
+from typing import TYPE_CHECKING, Callable, Literal, Optional, cast
from aiogram.utils.link import create_telegram_link
-from aiogram.utils.payload import encode_payload, decode_payload
+from aiogram.utils.payload import decode_payload, encode_payload
if TYPE_CHECKING:
from aiogram import Bot
diff --git a/aiogram/utils/keyboard.py b/aiogram/utils/keyboard.py
index 429cbe46..932f5865 100644
--- a/aiogram/utils/keyboard.py
+++ b/aiogram/utils/keyboard.py
@@ -28,6 +28,8 @@ from aiogram.types import (
KeyboardButtonPollType,
LoginUrl,
ReplyKeyboardMarkup,
+ SwitchInlineQueryChosenChat,
+ WebAppInfo,
)
ButtonType = TypeVar("ButtonType", InlineKeyboardButton, KeyboardButton)
@@ -299,10 +301,12 @@ class InlineKeyboardBuilder(KeyboardBuilder[InlineKeyboardButton]):
*,
text: str,
url: Optional[str] = None,
- login_url: Optional[LoginUrl] = None,
callback_data: Optional[Union[str, CallbackData]] = None,
+ web_app: Optional[WebAppInfo] = None,
+ login_url: Optional[LoginUrl] = None,
switch_inline_query: Optional[str] = None,
switch_inline_query_current_chat: Optional[str] = None,
+ switch_inline_query_chosen_chat: Optional[SwitchInlineQueryChosenChat] = None,
callback_game: Optional[CallbackGame] = None,
pay: Optional[bool] = None,
**kwargs: Any,
@@ -349,9 +353,12 @@ class ReplyKeyboardBuilder(KeyboardBuilder[KeyboardButton]):
self,
*,
text: str,
+ request_user: Optional[bool] = None,
+ request_chat: Optional[bool] = None,
request_contact: Optional[bool] = None,
request_location: Optional[bool] = None,
request_poll: Optional[KeyboardButtonPollType] = None,
+ web_app: Optional[WebAppInfo] = None,
**kwargs: Any,
) -> "KeyboardBuilder[KeyboardButton]":
...
diff --git a/docs/dispatcher/filters/index.rst b/docs/dispatcher/filters/index.rst
index 33442ec8..795cb4f3 100644
--- a/docs/dispatcher/filters/index.rst
+++ b/docs/dispatcher/filters/index.rst
@@ -6,8 +6,9 @@ Filtering events
Filters is needed for routing updates to the specific handler.
Searching of handler is always stops on first match set of filters are pass.
+By default, all handlers has empty set of filters, so all updates will be passed to first handler that has empty set of filters.
-*aiogram* has some builtin useful filters.
+*aiogram* has some builtin useful filters or you can write own filters.
Builtin filters
===============
diff --git a/docs/dispatcher/webhook.rst b/docs/dispatcher/webhook.rst
index 8cff6640..6869124e 100644
--- a/docs/dispatcher/webhook.rst
+++ b/docs/dispatcher/webhook.rst
@@ -18,7 +18,7 @@ Before start i'll recommend you to read `official Telegram's documentation about
After you read it, you can start to read this section.
Generally to use webhook with aiogram you should use any async web framework.
-Buy out of the box aiogram has an aiohttp integration, so we'll use it.
+By out of the box aiogram has an aiohttp integration, so we'll use it.
.. note::
diff --git a/docs/locale/en/LC_MESSAGES/dispatcher/webhook.po b/docs/locale/en/LC_MESSAGES/dispatcher/webhook.po
index b5cbbcad..6d9f582d 100644
--- a/docs/locale/en/LC_MESSAGES/dispatcher/webhook.po
+++ b/docs/locale/en/LC_MESSAGES/dispatcher/webhook.po
@@ -46,7 +46,7 @@ msgstr ""
#: ../../dispatcher/webhook.rst:20
msgid ""
"Generally to use webhook with aiogram you should use any async web "
-"framework. Buy out of the box aiogram has an aiohttp integration, so "
+"framework. By out of the box aiogram has an aiohttp integration, so "
"we'll use it."
msgstr ""
diff --git a/docs/locale/uk_UA/LC_MESSAGES/dispatcher/webhook.po b/docs/locale/uk_UA/LC_MESSAGES/dispatcher/webhook.po
index b5cbbcad..6d9f582d 100644
--- a/docs/locale/uk_UA/LC_MESSAGES/dispatcher/webhook.po
+++ b/docs/locale/uk_UA/LC_MESSAGES/dispatcher/webhook.po
@@ -46,7 +46,7 @@ msgstr ""
#: ../../dispatcher/webhook.rst:20
msgid ""
"Generally to use webhook with aiogram you should use any async web "
-"framework. Buy out of the box aiogram has an aiohttp integration, so "
+"framework. By out of the box aiogram has an aiohttp integration, so "
"we'll use it."
msgstr ""
diff --git a/docs/migration_2_to_3.rst b/docs/migration_2_to_3.rst
index 80910f84..93228c4d 100644
--- a/docs/migration_2_to_3.rst
+++ b/docs/migration_2_to_3.rst
@@ -133,3 +133,10 @@ Webhook
- Simplified aiohttp web app configuration
- By default added possibility to upload files when you use reply into webhook
+
+
+Telegram API Server
+===================
+
+- `server` param was moved from `Bot` instance to `api` in `BaseSession`.
+- `aiogram.bot.api.TELEGRAM_PRODUCTION` was moved to `aiogram.client.telegram.PRODUCTION`.
diff --git a/examples/error_handling.py b/examples/error_handling.py
index 3f8efdc4..83b5500d 100644
--- a/examples/error_handling.py
+++ b/examples/error_handling.py
@@ -59,7 +59,7 @@ async def handle_invalid_exceptions(event: ErrorEvent) -> None:
logger.error("Error `Invalid` caught: %r while processing %r", event.exception, event.update)
-@dp.message(Command(commands=["age"]))
+@dp.message(Command("age"))
async def handle_set_age(message: types.Message, command: CommandObject) -> None:
"""
This handler receives only messages with `/age` command.
@@ -83,7 +83,7 @@ async def handle_set_age(message: types.Message, command: CommandObject) -> None
await message.reply(text=f"Your age is {age}")
-@dp.message(Command(commands=["name"]))
+@dp.message(Command("name"))
async def handle_set_name(message: types.Message, command: CommandObject) -> None:
"""
This handler receives only messages with `/name` command.
diff --git a/examples/web_app/handlers.py b/examples/web_app/handlers.py
index 5ac6cc7d..5896c0b2 100644
--- a/examples/web_app/handlers.py
+++ b/examples/web_app/handlers.py
@@ -11,7 +11,7 @@ from aiogram.types import (
my_router = Router()
-@my_router.message(Command(commands=["start"]))
+@my_router.message(Command("start"))
async def command_start(message: Message, bot: Bot, base_url: str):
await bot.set_chat_menu_button(
chat_id=message.chat.id,
@@ -20,7 +20,7 @@ async def command_start(message: Message, bot: Bot, base_url: str):
await message.answer("""Hi!\nSend me any type of message to start.\nOr just send /webview""")
-@my_router.message(Command(commands=["webview"]))
+@my_router.message(Command("webview"))
async def command_webview(message: Message, base_url: str):
await message.answer(
"Good. Now you can try to send it via Webview",
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 = [
diff --git a/tests/test_api/test_types/test_reply_keyboard_remove.py b/tests/test_api/test_types/test_reply_keyboard_remove.py
index 984932a5..1d252cc5 100644
--- a/tests/test_api/test_types/test_reply_keyboard_remove.py
+++ b/tests/test_api/test_types/test_reply_keyboard_remove.py
@@ -1,3 +1,5 @@
+from typing import Dict
+
import pytest
from aiogram.types import ReplyKeyboardRemove
@@ -10,12 +12,12 @@ class TestReplyKeyboardRemove:
def test_remove_keyboard_default_is_true(self):
assert (
- ReplyKeyboardRemove.__fields__["remove_keyboard"].default is True
+ ReplyKeyboardRemove.model_fields["remove_keyboard"].default is True
), "Remove keyboard has incorrect default value!"
@pytest.mark.parametrize(
"kwargs,expected",
[[{}, True], [{"remove_keyboard": True}, True]],
)
- def test_remove_keyboard_values(self, kwargs, expected):
+ def test_remove_keyboard_values(self, kwargs: Dict[str, bool], expected: bool):
assert ReplyKeyboardRemove(**kwargs).remove_keyboard is expected
diff --git a/tests/test_issues/test_1317_state_vs_isolation.py b/tests/test_issues/test_1317_state_vs_isolation.py
new file mode 100644
index 00000000..31613fa4
--- /dev/null
+++ b/tests/test_issues/test_1317_state_vs_isolation.py
@@ -0,0 +1,81 @@
+import asyncio
+from datetime import datetime
+
+from aiogram import Dispatcher
+from aiogram.filters import Command
+from aiogram.fsm.context import FSMContext
+from aiogram.fsm.state import State, StatesGroup
+from aiogram.fsm.storage.memory import SimpleEventIsolation
+from aiogram.types import Chat, Message, Update, User
+from tests.mocked_bot import MockedBot
+
+
+class TestStateVSIsolation:
+ async def test_issue(self, bot: MockedBot):
+ dispatcher = Dispatcher(events_isolation=SimpleEventIsolation())
+ first = 0
+ second = 0
+ third = 0
+ stack = []
+
+ class TestState(StatesGroup):
+ foo = State()
+ bar = State()
+ baz = State()
+
+ @dispatcher.message(Command("test"))
+ async def command_top(message: Message, state: FSMContext):
+ nonlocal first
+ first += 1
+ stack.append("command")
+ await state.set_state(TestState.foo)
+
+ @dispatcher.message(TestState.foo)
+ async def handle_foo(message: Message, state: FSMContext):
+ nonlocal second
+ second += 1
+ stack.append("foo")
+ await state.set_state(TestState.bar)
+
+ @dispatcher.message(TestState.bar)
+ async def handle_bar(message: Message, state: FSMContext):
+ nonlocal third
+ third += 1
+ stack.append("bar")
+ await state.set_state(None)
+
+ @dispatcher.message()
+ async def handle_all(message: Message):
+ stack.append("all")
+
+ await asyncio.gather(
+ *(
+ dispatcher.feed_update(bot, update)
+ for update in [
+ create_message_update(index=1, text="/test"),
+ create_message_update(index=2, text="foo"),
+ create_message_update(index=3, text="bar"),
+ create_message_update(index=4, text="baz"),
+ ]
+ )
+ )
+
+ # Before bug fix:
+ # first == 1, second == 3, third == 0, stack == ["command", "foo", "foo", "foo"]
+ assert first == 1
+ assert second == 1
+ assert third == 1
+ assert stack == ["command", "foo", "bar", "all"]
+
+
+def create_message_update(index: int, text: str):
+ return Update(
+ update_id=index,
+ message=Message(
+ message_id=index,
+ date=datetime.now(),
+ chat=Chat(id=42, type="private"),
+ from_user=User(id=42, is_bot=False, first_name="Test", username="test"),
+ text=text,
+ ),
+ )
diff --git a/tests/test_utils/test_deep_linking.py b/tests/test_utils/test_deep_linking.py
index df06c1e5..85a6027b 100644
--- a/tests/test_utils/test_deep_linking.py
+++ b/tests/test_utils/test_deep_linking.py
@@ -1,9 +1,6 @@
import pytest
-from aiogram.utils.deep_linking import (
- create_start_link,
- create_startgroup_link,
-)
+from aiogram.utils.deep_linking import create_start_link, create_startgroup_link
from aiogram.utils.payload import decode_payload, encode_payload
from tests.mocked_bot import MockedBot