diff --git a/.apiversion b/.apiversion
index 1a2c3557..c3cae12b 100644
--- a/.apiversion
+++ b/.apiversion
@@ -1 +1 @@
-9.2
+9.3
diff --git a/.butcher/methods/copyMessage/entity.json b/.butcher/methods/copyMessage/entity.json
index 2a68a358..3818a19b 100644
--- a/.butcher/methods/copyMessage/entity.json
+++ b/.butcher/methods/copyMessage/entity.json
@@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "
`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance\n",
"name": "allow_paid_broadcast"
},
+ {
+ "type": "String",
+ "required": false,
+ "description": "Unique identifier of the message effect to be added to the message; only available when copying to private chats",
+ "html_description": "Unique identifier of the message effect to be added to the message; only available when copying to private chats | ",
+ "rst_description": "Unique identifier of the message effect to be added to the message; only available when copying to private chats\n",
+ "name": "message_effect_id"
+ },
{
"type": "SuggestedPostParameters",
"required": false,
diff --git a/.butcher/methods/copyMessages/entity.json b/.butcher/methods/copyMessages/entity.json
index 28fde87e..c6b38dc8 100644
--- a/.butcher/methods/copyMessages/entity.json
+++ b/.butcher/methods/copyMessages/entity.json
@@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/deleteForumTopic/entity.json b/.butcher/methods/deleteForumTopic/entity.json
index 4e231d5b..5afe09b0 100644
--- a/.butcher/methods/deleteForumTopic/entity.json
+++ b/.butcher/methods/deleteForumTopic/entity.json
@@ -7,9 +7,9 @@
"object": {
"anchor": "deleteforumtopic",
"name": "deleteForumTopic",
- "description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.",
- "html_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
",
- "rst_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.",
+ "description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.",
+ "html_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
",
+ "rst_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
diff --git a/.butcher/methods/editForumTopic/entity.json b/.butcher/methods/editForumTopic/entity.json
index 02261e1f..ebbdfbe3 100644
--- a/.butcher/methods/editForumTopic/entity.json
+++ b/.butcher/methods/editForumTopic/entity.json
@@ -7,9 +7,9 @@
"object": {
"anchor": "editforumtopic",
"name": "editForumTopic",
- "description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
- "html_description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
",
- "rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
+ "description": "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
+ "html_description": "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
",
+ "rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
diff --git a/.butcher/methods/forwardMessage/entity.json b/.butcher/methods/forwardMessage/entity.json
index 5237d730..13bd8cb4 100644
--- a/.butcher/methods/forwardMessage/entity.json
+++ b/.butcher/methods/forwardMessage/entity.json
@@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -67,6 +67,14 @@
"rst_description": "Protects the contents of the forwarded message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "String",
+ "required": false,
+ "description": "Unique identifier of the message effect to be added to the message; only available when forwarding to private chats",
+ "html_description": "Unique identifier of the message effect to be added to the message; only available when forwarding to private chats | ",
+ "rst_description": "Unique identifier of the message effect to be added to the message; only available when forwarding to private chats\n",
+ "name": "message_effect_id"
+ },
{
"type": "SuggestedPostParameters",
"required": false,
diff --git a/.butcher/methods/forwardMessages/entity.json b/.butcher/methods/forwardMessages/entity.json
index 8e4fe1c7..c08b6722 100644
--- a/.butcher/methods/forwardMessages/entity.json
+++ b/.butcher/methods/forwardMessages/entity.json
@@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/getBusinessAccountGifts/entity.json b/.butcher/methods/getBusinessAccountGifts/entity.json
index 1d61c1f3..0ff3d056 100644
--- a/.butcher/methods/getBusinessAccountGifts/entity.json
+++ b/.butcher/methods/getBusinessAccountGifts/entity.json
@@ -46,10 +46,18 @@
{
"type": "Boolean",
"required": false,
- "description": "Pass True to exclude gifts that can be purchased a limited number of times",
- "html_description": "Pass True to exclude gifts that can be purchased a limited number of times | ",
- "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times\n",
- "name": "exclude_limited"
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique\n",
+ "name": "exclude_limited_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique\n",
+ "name": "exclude_limited_non_upgradable"
},
{
"type": "Boolean",
@@ -59,6 +67,14 @@
"rst_description": "Pass :code:`True` to exclude unique gifts\n",
"name": "exclude_unique"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram",
+ "html_description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
+ "name": "exclude_from_blockchain"
+ },
{
"type": "Boolean",
"required": false,
@@ -82,6 +98,18 @@
"html_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100 | ",
"rst_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100\n",
"name": "limit"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times\n",
+ "name": "exclude_limited",
+ "deprecated": {
+ "version": "9.3",
+ "release_date": "2025-12-31"
+ }
}
],
"category": "methods"
diff --git a/.butcher/methods/getChatGifts/entity.json b/.butcher/methods/getChatGifts/entity.json
new file mode 100644
index 00000000..e3c13c21
--- /dev/null
+++ b/.butcher/methods/getChatGifts/entity.json
@@ -0,0 +1,105 @@
+{
+ "meta": {},
+ "group": {
+ "title": "Available methods",
+ "anchor": "available-methods"
+ },
+ "object": {
+ "anchor": "getchatgifts",
+ "name": "getChatGifts",
+ "description": "Returns the gifts owned by a chat. Returns OwnedGifts on success.",
+ "html_description": "Returns the gifts owned by a chat. Returns OwnedGifts on success.
",
+ "rst_description": "Returns the gifts owned by a chat. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.",
+ "annotations": [
+ {
+ "type": "Integer or String",
+ "required": true,
+ "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
+ "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername) | ",
+ "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
+ "name": "chat_id"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel.",
+ "html_description": "Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel. | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that aren't saved to the chat's profile page. Always :code:`True`, unless the bot has the *can_post_messages* administrator right in the channel.\n",
+ "name": "exclude_unsaved"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel.",
+ "html_description": "Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel. | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that are saved to the chat's profile page. Always :code:`False`, unless the bot has the *can_post_messages* administrator right in the channel.\n",
+ "name": "exclude_saved"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased an unlimited number of times",
+ "html_description": "Pass True to exclude gifts that can be purchased an unlimited number of times | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times\n",
+ "name": "exclude_unlimited"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique\n",
+ "name": "exclude_limited_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique\n",
+ "name": "exclude_limited_non_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram",
+ "html_description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
+ "name": "exclude_from_blockchain"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude unique gifts",
+ "html_description": "Pass True to exclude unique gifts | ",
+ "rst_description": "Pass :code:`True` to exclude unique gifts\n",
+ "name": "exclude_unique"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.",
+ "html_description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. | ",
+ "rst_description": "Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination.\n",
+ "name": "sort_by_price"
+ },
+ {
+ "type": "String",
+ "required": false,
+ "description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results",
+ "html_description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results | ",
+ "rst_description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results\n",
+ "name": "offset"
+ },
+ {
+ "type": "Integer",
+ "required": false,
+ "description": "The maximum number of gifts to be returned; 1-100. Defaults to 100",
+ "html_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100 | ",
+ "rst_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100\n",
+ "name": "limit"
+ }
+ ],
+ "category": "methods"
+ }
+}
diff --git a/.butcher/methods/getUserGifts/entity.json b/.butcher/methods/getUserGifts/entity.json
new file mode 100644
index 00000000..87b76f34
--- /dev/null
+++ b/.butcher/methods/getUserGifts/entity.json
@@ -0,0 +1,89 @@
+{
+ "meta": {},
+ "group": {
+ "title": "Available methods",
+ "anchor": "available-methods"
+ },
+ "object": {
+ "anchor": "getusergifts",
+ "name": "getUserGifts",
+ "description": "Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.",
+ "html_description": "Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.
",
+ "rst_description": "Returns the gifts owned and hosted by a user. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the user",
+ "html_description": "Unique identifier of the user | ",
+ "rst_description": "Unique identifier of the user\n",
+ "name": "user_id"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased an unlimited number of times",
+ "html_description": "Pass True to exclude gifts that can be purchased an unlimited number of times | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times\n",
+ "name": "exclude_unlimited"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique\n",
+ "name": "exclude_limited_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique\n",
+ "name": "exclude_limited_non_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram",
+ "html_description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
+ "name": "exclude_from_blockchain"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude unique gifts",
+ "html_description": "Pass True to exclude unique gifts | ",
+ "rst_description": "Pass :code:`True` to exclude unique gifts\n",
+ "name": "exclude_unique"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.",
+ "html_description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. | ",
+ "rst_description": "Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination.\n",
+ "name": "sort_by_price"
+ },
+ {
+ "type": "String",
+ "required": false,
+ "description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results",
+ "html_description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results | ",
+ "rst_description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results\n",
+ "name": "offset"
+ },
+ {
+ "type": "Integer",
+ "required": false,
+ "description": "The maximum number of gifts to be returned; 1-100. Defaults to 100",
+ "html_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100 | ",
+ "rst_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100\n",
+ "name": "limit"
+ }
+ ],
+ "category": "methods"
+ }
+}
diff --git a/.butcher/methods/promoteChatMember/entity.json b/.butcher/methods/promoteChatMember/entity.json
index fc12f7a1..4f0e4480 100644
--- a/.butcher/methods/promoteChatMember/entity.json
+++ b/.butcher/methods/promoteChatMember/entity.json
@@ -62,9 +62,9 @@
{
"type": "Boolean",
"required": false,
- "description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics",
- "html_description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics | ",
- "rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics\n",
+ "description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators",
+ "html_description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators | ",
+ "rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to :code:`True` for promotions of channel administrators\n",
"name": "can_restrict_members"
},
{
diff --git a/.butcher/methods/repostStory/entity.json b/.butcher/methods/repostStory/entity.json
new file mode 100644
index 00000000..198c0779
--- /dev/null
+++ b/.butcher/methods/repostStory/entity.json
@@ -0,0 +1,65 @@
+{
+ "meta": {},
+ "group": {
+ "title": "Available methods",
+ "anchor": "available-methods"
+ },
+ "object": {
+ "anchor": "repoststory",
+ "name": "repostStory",
+ "description": "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.",
+ "html_description": "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.
",
+ "rst_description": "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the *can_manage_stories* business bot right for both business accounts. Returns :class:`aiogram.types.story.Story` on success.",
+ "annotations": [
+ {
+ "type": "String",
+ "required": true,
+ "description": "Unique identifier of the business connection",
+ "html_description": "Unique identifier of the business connection | ",
+ "rst_description": "Unique identifier of the business connection\n",
+ "name": "business_connection_id"
+ },
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the chat which posted the story that should be reposted",
+ "html_description": "Unique identifier of the chat which posted the story that should be reposted | ",
+ "rst_description": "Unique identifier of the chat which posted the story that should be reposted\n",
+ "name": "from_chat_id"
+ },
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the story that should be reposted",
+ "html_description": "Unique identifier of the story that should be reposted | ",
+ "rst_description": "Unique identifier of the story that should be reposted\n",
+ "name": "from_story_id"
+ },
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400",
+ "html_description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 | ",
+ "rst_description": "Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`\n",
+ "name": "active_period"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to keep the story accessible after it expires",
+ "html_description": "Pass True to keep the story accessible after it expires | ",
+ "rst_description": "Pass :code:`True` to keep the story accessible after it expires\n",
+ "name": "post_to_chat_page"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True if the content of the story must be protected from forwarding and screenshotting",
+ "html_description": "Pass True if the content of the story must be protected from forwarding and screenshotting | ",
+ "rst_description": "Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting\n",
+ "name": "protect_content"
+ }
+ ],
+ "category": "methods"
+ }
+}
diff --git a/.butcher/methods/sendAnimation/entity.json b/.butcher/methods/sendAnimation/entity.json
index 5e9c2fff..38435475 100644
--- a/.butcher/methods/sendAnimation/entity.json
+++ b/.butcher/methods/sendAnimation/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendAudio/entity.json b/.butcher/methods/sendAudio/entity.json
index 5f336ce2..9886f752 100644
--- a/.butcher/methods/sendAudio/entity.json
+++ b/.butcher/methods/sendAudio/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendChatAction/entity.json b/.butcher/methods/sendChatAction/entity.json
index b56b1211..80ef4215 100644
--- a/.butcher/methods/sendChatAction/entity.json
+++ b/.butcher/methods/sendChatAction/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread; for supergroups only",
- "html_description": "Unique identifier for the target message thread; for supergroups only | ",
- "rst_description": "Unique identifier for the target message thread; for supergroups only\n",
+ "description": "Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendContact/entity.json b/.butcher/methods/sendContact/entity.json
index f9d13d40..d713e739 100644
--- a/.butcher/methods/sendContact/entity.json
+++ b/.butcher/methods/sendContact/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendDice/entity.json b/.butcher/methods/sendDice/entity.json
index 35afa97d..0d001776 100644
--- a/.butcher/methods/sendDice/entity.json
+++ b/.butcher/methods/sendDice/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendDocument/entity.json b/.butcher/methods/sendDocument/entity.json
index 11b6c8fe..320f1d54 100644
--- a/.butcher/methods/sendDocument/entity.json
+++ b/.butcher/methods/sendDocument/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendGame/entity.json b/.butcher/methods/sendGame/entity.json
index 6a2e71bc..594ed09f 100644
--- a/.butcher/methods/sendGame/entity.json
+++ b/.butcher/methods/sendGame/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendGift/entity.json b/.butcher/methods/sendGift/entity.json
index 10006635..1c428fc4 100644
--- a/.butcher/methods/sendGift/entity.json
+++ b/.butcher/methods/sendGift/entity.json
@@ -30,9 +30,9 @@
{
"type": "String",
"required": true,
- "description": "Identifier of the gift",
- "html_description": "Identifier of the gift | ",
- "rst_description": "Identifier of the gift\n",
+ "description": "Identifier of the gift; limited gifts can't be sent to channel chats",
+ "html_description": "Identifier of the gift; limited gifts can't be sent to channel chats | ",
+ "rst_description": "Identifier of the gift; limited gifts can't be sent to channel chats\n",
"name": "gift_id"
},
{
diff --git a/.butcher/methods/sendInvoice/entity.json b/.butcher/methods/sendInvoice/entity.json
index fb79ac29..99612e23 100644
--- a/.butcher/methods/sendInvoice/entity.json
+++ b/.butcher/methods/sendInvoice/entity.json
@@ -22,9 +22,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendLocation/entity.json b/.butcher/methods/sendLocation/entity.json
index 8385b971..ede4fdbf 100644
--- a/.butcher/methods/sendLocation/entity.json
+++ b/.butcher/methods/sendLocation/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendMediaGroup/entity.json b/.butcher/methods/sendMediaGroup/entity.json
index 4ed462cb..841f9b77 100644
--- a/.butcher/methods/sendMediaGroup/entity.json
+++ b/.butcher/methods/sendMediaGroup/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendMessage/entity.json b/.butcher/methods/sendMessage/entity.json
index 8e9db029..d4eff7f7 100644
--- a/.butcher/methods/sendMessage/entity.json
+++ b/.butcher/methods/sendMessage/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendMessageDraft/entity.json b/.butcher/methods/sendMessageDraft/entity.json
new file mode 100644
index 00000000..5d64e874
--- /dev/null
+++ b/.butcher/methods/sendMessageDraft/entity.json
@@ -0,0 +1,65 @@
+{
+ "meta": {},
+ "group": {
+ "title": "Available methods",
+ "anchor": "available-methods"
+ },
+ "object": {
+ "anchor": "sendmessagedraft",
+ "name": "sendMessageDraft",
+ "description": "Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.",
+ "html_description": "Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.
",
+ "rst_description": "Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns :code:`True` on success.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier for the target private chat",
+ "html_description": "Unique identifier for the target private chat | ",
+ "rst_description": "Unique identifier for the target private chat\n",
+ "name": "chat_id"
+ },
+ {
+ "type": "Integer",
+ "required": false,
+ "description": "Unique identifier for the target message thread",
+ "html_description": "Unique identifier for the target message thread | ",
+ "rst_description": "Unique identifier for the target message thread\n",
+ "name": "message_thread_id"
+ },
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated",
+ "html_description": "Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated | ",
+ "rst_description": "Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated\n",
+ "name": "draft_id"
+ },
+ {
+ "type": "String",
+ "required": true,
+ "description": "Text of the message to be sent, 1-4096 characters after entities parsing",
+ "html_description": "Text of the message to be sent, 1-4096 characters after entities parsing | ",
+ "rst_description": "Text of the message to be sent, 1-4096 characters after entities parsing\n",
+ "name": "text"
+ },
+ {
+ "type": "String",
+ "required": false,
+ "description": "Mode for parsing entities in the message text. See formatting options for more details.",
+ "html_description": "Mode for parsing entities in the message text. See formatting options for more details. | ",
+ "rst_description": "Mode for parsing entities in the message text. See `formatting options `_ for more details.\n",
+ "name": "parse_mode"
+ },
+ {
+ "type": "Array of MessageEntity",
+ "required": false,
+ "description": "A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode",
+ "html_description": "A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode | ",
+ "rst_description": "A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*\n",
+ "name": "entities"
+ }
+ ],
+ "category": "methods"
+ }
+}
diff --git a/.butcher/methods/sendPaidMedia/entity.json b/.butcher/methods/sendPaidMedia/entity.json
index 69a7a0cc..708eb6cd 100644
--- a/.butcher/methods/sendPaidMedia/entity.json
+++ b/.butcher/methods/sendPaidMedia/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -46,9 +46,9 @@
{
"type": "Integer",
"required": true,
- "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000",
- "html_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000 | ",
- "rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000\n",
+ "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-25000",
+ "html_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-25000 | ",
+ "rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-25000\n",
"name": "star_count"
},
{
diff --git a/.butcher/methods/sendPhoto/entity.json b/.butcher/methods/sendPhoto/entity.json
index 5d967505..594f00e2 100644
--- a/.butcher/methods/sendPhoto/entity.json
+++ b/.butcher/methods/sendPhoto/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendPoll/entity.json b/.butcher/methods/sendPoll/entity.json
index 604586c9..44e010c7 100644
--- a/.butcher/methods/sendPoll/entity.json
+++ b/.butcher/methods/sendPoll/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendSticker/entity.json b/.butcher/methods/sendSticker/entity.json
index d16594d4..b922d274 100644
--- a/.butcher/methods/sendSticker/entity.json
+++ b/.butcher/methods/sendSticker/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendVenue/entity.json b/.butcher/methods/sendVenue/entity.json
index 058afebf..6475e4b4 100644
--- a/.butcher/methods/sendVenue/entity.json
+++ b/.butcher/methods/sendVenue/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendVideo/entity.json b/.butcher/methods/sendVideo/entity.json
index ff25ddc7..68391db5 100644
--- a/.butcher/methods/sendVideo/entity.json
+++ b/.butcher/methods/sendVideo/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendVideoNote/entity.json b/.butcher/methods/sendVideoNote/entity.json
index 8e8eed5f..5f15f5e8 100644
--- a/.butcher/methods/sendVideoNote/entity.json
+++ b/.butcher/methods/sendVideoNote/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/sendVoice/entity.json b/.butcher/methods/sendVoice/entity.json
index e7c1ddfc..fa28daad 100644
--- a/.butcher/methods/sendVoice/entity.json
+++ b/.butcher/methods/sendVoice/entity.json
@@ -30,9 +30,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/methods/unpinAllForumTopicMessages/entity.json b/.butcher/methods/unpinAllForumTopicMessages/entity.json
index dc46ec72..b3b32d03 100644
--- a/.butcher/methods/unpinAllForumTopicMessages/entity.json
+++ b/.butcher/methods/unpinAllForumTopicMessages/entity.json
@@ -7,9 +7,9 @@
"object": {
"anchor": "unpinallforumtopicmessages",
"name": "unpinAllForumTopicMessages",
- "description": "Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.",
- "html_description": "Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
",
- "rst_description": "Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.",
+ "description": "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.",
+ "html_description": "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
",
+ "rst_description": "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json
index a88e681a..d492782d 100644
--- a/.butcher/schema/schema.json
+++ b/.butcher/schema/schema.json
@@ -1,7 +1,7 @@
{
"api": {
- "version": "9.2",
- "release_date": "2025-08-15"
+ "version": "9.3",
+ "release_date": "2025-12-31"
},
"items": [
{
@@ -544,6 +544,14 @@
"rst_description": "*Optional*. :code:`True`, if the bot has a main Web App. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n",
"name": "has_main_web_app",
"required": false
+ },
+ {
+ "type": "Boolean",
+ "description": "True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.",
+ "html_description": "Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. | ",
+ "rst_description": "*Optional*. :code:`True`, if the bot has forum topic mode enabled in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n",
+ "name": "has_topics_enabled",
+ "required": false
}
],
"category": "types"
@@ -1004,6 +1012,30 @@
"rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected\n",
"name": "location",
"required": false
+ },
+ {
+ "type": "UserRating",
+ "description": "For private chats, the rating of the user if any",
+ "html_description": "Optional. For private chats, the rating of the user if any | ",
+ "rst_description": "*Optional*. For private chats, the rating of the user if any\n",
+ "name": "rating",
+ "required": false
+ },
+ {
+ "type": "UniqueGiftColors",
+ "description": "The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews",
+ "html_description": "Optional. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews | ",
+ "rst_description": "*Optional*. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews\n",
+ "name": "unique_gift_colors",
+ "required": false
+ },
+ {
+ "type": "Integer",
+ "description": "The number of Telegram Stars a general user have to pay to send a message to the chat",
+ "html_description": "Optional. The number of Telegram Stars a general user have to pay to send a message to the chat | ",
+ "rst_description": "*Optional*. The number of Telegram Stars a general user have to pay to send a message to the chat\n",
+ "name": "paid_message_star_count",
+ "required": false
}
],
"category": "types"
@@ -1025,9 +1057,9 @@
},
{
"type": "Integer",
- "description": "Unique identifier of a message thread to which the message belongs; for supergroups only",
- "html_description": "Optional. Unique identifier of a message thread to which the message belongs; for supergroups only | ",
- "rst_description": "*Optional*. Unique identifier of a message thread to which the message belongs; for supergroups only\n",
+ "description": "Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only",
+ "html_description": "Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only | ",
+ "rst_description": "*Optional*. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only\n",
"name": "message_thread_id",
"required": false
},
@@ -1105,9 +1137,9 @@
},
{
"type": "True",
- "description": "True, if the message is sent to a forum topic",
- "html_description": "Optional. True, if the message is sent to a forum topic | ",
- "rst_description": "*Optional*. :code:`True`, if the message is sent to a forum topic\n",
+ "description": "True, if the message is sent to a topic in a forum supergroup or a private chat with the bot",
+ "html_description": "Optional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot | ",
+ "rst_description": "*Optional*. :code:`True`, if the message is sent to a topic in a forum supergroup or a private chat with the bot\n",
"name": "is_topic_message",
"required": false
},
@@ -1583,6 +1615,14 @@
"name": "unique_gift",
"required": false
},
+ {
+ "type": "GiftInfo",
+ "description": "Service message: upgrade of a gift was purchased after the gift was sent",
+ "html_description": "Optional. Service message: upgrade of a gift was purchased after the gift was sent | ",
+ "rst_description": "*Optional*. Service message: upgrade of a gift was purchased after the gift was sent\n",
+ "name": "gift_upgrade_sent",
+ "required": false
+ },
{
"type": "String",
"description": "The domain name of the website on which the user has logged in.",
@@ -3430,12 +3470,20 @@
},
{
"type": "User",
- "description": "User that completed the task; omitted if the task wasn't completed",
- "html_description": "Optional. User that completed the task; omitted if the task wasn't completed | ",
- "rst_description": "*Optional*. User that completed the task; omitted if the task wasn't completed\n",
+ "description": "User that completed the task; omitted if the task wasn't completed by a user",
+ "html_description": "Optional. User that completed the task; omitted if the task wasn't completed by a user | ",
+ "rst_description": "*Optional*. User that completed the task; omitted if the task wasn't completed by a user\n",
"name": "completed_by_user",
"required": false
},
+ {
+ "type": "Chat",
+ "description": "Chat that completed the task; omitted if the task wasn't completed by a chat",
+ "html_description": "Optional. Chat that completed the task; omitted if the task wasn't completed by a chat | ",
+ "rst_description": "*Optional*. Chat that completed the task; omitted if the task wasn't completed by a chat\n",
+ "name": "completed_by_chat",
+ "required": false
+ },
{
"type": "Integer",
"description": "Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed",
@@ -3523,8 +3571,8 @@
{
"type": "String",
"description": "Mode for parsing entities in the text. See formatting options for more details.",
- "html_description": "Optional. Mode for parsing entities in the text. See formatting options for more details. | ",
- "rst_description": "Optional. Mode for parsing entities in the text. See `formatting options `_ for more details.\n",
+ "html_description": "Optional. Mode for parsing entities in the text. See formatting options for more details. | ",
+ "rst_description": "*Optional*. Mode for parsing entities in the text. See `formatting options `_ for more details.\n",
"name": "parse_mode",
"required": false
},
@@ -3557,8 +3605,8 @@
{
"type": "String",
"description": "Mode for parsing entities in the title. See formatting options for more details.",
- "html_description": "Optional. Mode for parsing entities in the title. See formatting options for more details. | ",
- "rst_description": "Optional. Mode for parsing entities in the title. See `formatting options `_ for more details.\n",
+ "html_description": "Optional. Mode for parsing entities in the title. See formatting options for more details. | ",
+ "rst_description": "*Optional*. Mode for parsing entities in the title. See `formatting options `_ for more details.\n",
"name": "parse_mode",
"required": false
},
@@ -4205,6 +4253,14 @@
"rst_description": "*Optional*. Unique identifier of the custom emoji shown as the topic icon\n",
"name": "icon_custom_emoji_id",
"required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot",
+ "html_description": "Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot | ",
+ "rst_description": "*Optional*. :code:`True`, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot\n",
+ "name": "is_name_implicit",
+ "required": false
}
],
"category": "types"
@@ -4993,9 +5049,9 @@
{
"anchor": "suggestedpostprice",
"name": "SuggestedPostPrice",
- "description": "Desribes price of a suggested post.",
- "html_description": "Desribes price of a suggested post.
",
- "rst_description": "Desribes price of a suggested post.",
+ "description": "Describes the price of a suggested post.",
+ "html_description": "Describes the price of a suggested post.
",
+ "rst_description": "Describes the price of a suggested post.",
"annotations": [
{
"type": "String",
@@ -5085,9 +5141,9 @@
"annotations": [
{
"type": "Integer",
- "description": "Unique identifier of the topic",
- "html_description": "Unique identifier of the topic | ",
- "rst_description": "Unique identifier of the topic\n",
+ "description": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.",
+ "html_description": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. | ",
+ "rst_description": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.\n",
"name": "topic_id",
"required": true
},
@@ -5264,16 +5320,16 @@
{
"type": "KeyboardButtonRequestUsers",
"description": "If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.",
- "html_description": "Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. | ",
- "rst_description": "*Optional.* If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.\n",
+ "html_description": "Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. | ",
+ "rst_description": "*Optional*. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.\n",
"name": "request_users",
"required": false
},
{
"type": "KeyboardButtonRequestChat",
"description": "If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only.",
- "html_description": "Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. | ",
- "rst_description": "*Optional.* If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only.\n",
+ "html_description": "Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. | ",
+ "rst_description": "*Optional*. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only.\n",
"name": "request_chat",
"required": false
},
@@ -6993,6 +7049,48 @@
],
"category": "types"
},
+ {
+ "anchor": "userrating",
+ "name": "UserRating",
+ "description": "This object describes the rating of a user based on their Telegram Star spendings.",
+ "html_description": "This object describes the rating of a user based on their Telegram Star spendings.
",
+ "rst_description": "This object describes the rating of a user based on their Telegram Star spendings.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "description": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.",
+ "html_description": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern. | ",
+ "rst_description": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.\n",
+ "name": "level",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Numerical value of the user's rating; the higher the rating, the better",
+ "html_description": "Numerical value of the user's rating; the higher the rating, the better | ",
+ "rst_description": "Numerical value of the user's rating; the higher the rating, the better\n",
+ "name": "rating",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "The rating value required to get the current level",
+ "html_description": "The rating value required to get the current level | ",
+ "rst_description": "The rating value required to get the current level\n",
+ "name": "current_level_rating",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "The rating value required to get to the next level; omitted if the maximum level was reached",
+ "html_description": "Optional. The rating value required to get to the next level; omitted if the maximum level was reached | ",
+ "rst_description": "*Optional*. The rating value required to get to the next level; omitted if the maximum level was reached\n",
+ "name": "next_level_rating",
+ "required": false
+ }
+ ],
+ "category": "types"
+ },
{
"anchor": "storyareaposition",
"name": "StoryAreaPosition",
@@ -7583,6 +7681,48 @@
"rst_description": "*Optional*. Unique identifier of the custom emoji shown as the topic icon\n",
"name": "icon_custom_emoji_id",
"required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot",
+ "html_description": "Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot | ",
+ "rst_description": "*Optional*. :code:`True`, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot\n",
+ "name": "is_name_implicit",
+ "required": false
+ }
+ ],
+ "category": "types"
+ },
+ {
+ "anchor": "giftbackground",
+ "name": "GiftBackground",
+ "description": "This object describes the background of a gift.",
+ "html_description": "This object describes the background of a gift.
",
+ "rst_description": "This object describes the background of a gift.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "description": "Center color of the background in RGB format",
+ "html_description": "Center color of the background in RGB format | ",
+ "rst_description": "Center color of the background in RGB format\n",
+ "name": "center_color",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Edge color of the background in RGB format",
+ "html_description": "Edge color of the background in RGB format | ",
+ "rst_description": "Edge color of the background in RGB format\n",
+ "name": "edge_color",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Text color of the background in RGB format",
+ "html_description": "Text color of the background in RGB format | ",
+ "rst_description": "Text color of the background in RGB format\n",
+ "name": "text_color",
+ "required": true
}
],
"category": "types"
@@ -7626,22 +7766,70 @@
"name": "upgrade_star_count",
"required": false
},
+ {
+ "type": "True",
+ "description": "True, if the gift can only be purchased by Telegram Premium subscribers",
+ "html_description": "Optional. True, if the gift can only be purchased by Telegram Premium subscribers | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift can only be purchased by Telegram Premium subscribers\n",
+ "name": "is_premium",
+ "required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the gift can be used (after being upgraded) to customize a user's appearance",
+ "html_description": "Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift can be used (after being upgraded) to customize a user's appearance\n",
+ "name": "has_colors",
+ "required": false
+ },
{
"type": "Integer",
- "description": "The total number of the gifts of this type that can be sent; for limited gifts only",
- "html_description": "Optional. The total number of the gifts of this type that can be sent; for limited gifts only | ",
- "rst_description": "*Optional*. The total number of the gifts of this type that can be sent; for limited gifts only\n",
+ "description": "The total number of gifts of this type that can be sent by all users; for limited gifts only",
+ "html_description": "Optional. The total number of gifts of this type that can be sent by all users; for limited gifts only | ",
+ "rst_description": "*Optional*. The total number of gifts of this type that can be sent by all users; for limited gifts only\n",
"name": "total_count",
"required": false
},
{
"type": "Integer",
- "description": "The number of remaining gifts of this type that can be sent; for limited gifts only",
- "html_description": "Optional. The number of remaining gifts of this type that can be sent; for limited gifts only | ",
- "rst_description": "*Optional*. The number of remaining gifts of this type that can be sent; for limited gifts only\n",
+ "description": "The number of remaining gifts of this type that can be sent by all users; for limited gifts only",
+ "html_description": "Optional. The number of remaining gifts of this type that can be sent by all users; for limited gifts only | ",
+ "rst_description": "*Optional*. The number of remaining gifts of this type that can be sent by all users; for limited gifts only\n",
"name": "remaining_count",
"required": false
},
+ {
+ "type": "Integer",
+ "description": "The total number of gifts of this type that can be sent by the bot; for limited gifts only",
+ "html_description": "Optional. The total number of gifts of this type that can be sent by the bot; for limited gifts only | ",
+ "rst_description": "*Optional*. The total number of gifts of this type that can be sent by the bot; for limited gifts only\n",
+ "name": "personal_total_count",
+ "required": false
+ },
+ {
+ "type": "Integer",
+ "description": "The number of remaining gifts of this type that can be sent by the bot; for limited gifts only",
+ "html_description": "Optional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only | ",
+ "rst_description": "*Optional*. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only\n",
+ "name": "personal_remaining_count",
+ "required": false
+ },
+ {
+ "type": "GiftBackground",
+ "description": "Background of the gift",
+ "html_description": "Optional. Background of the gift | ",
+ "rst_description": "*Optional*. Background of the gift\n",
+ "name": "background",
+ "required": false
+ },
+ {
+ "type": "Integer",
+ "description": "The total number of different unique gifts that can be obtained by upgrading the gift",
+ "html_description": "Optional. The total number of different unique gifts that can be obtained by upgrading the gift | ",
+ "rst_description": "*Optional*. The total number of different unique gifts that can be obtained by upgrading the gift\n",
+ "name": "unique_gift_variant_count",
+ "required": false
+ },
{
"type": "Chat",
"description": "Information about the chat that published the gift",
@@ -7815,6 +8003,64 @@
],
"category": "types"
},
+ {
+ "anchor": "uniquegiftcolors",
+ "name": "UniqueGiftColors",
+ "description": "This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.",
+ "html_description": "This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.
",
+ "rst_description": "This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.",
+ "annotations": [
+ {
+ "type": "String",
+ "description": "Custom emoji identifier of the unique gift's model",
+ "html_description": "Custom emoji identifier of the unique gift's model | ",
+ "rst_description": "Custom emoji identifier of the unique gift's model\n",
+ "name": "model_custom_emoji_id",
+ "required": true
+ },
+ {
+ "type": "String",
+ "description": "Custom emoji identifier of the unique gift's symbol",
+ "html_description": "Custom emoji identifier of the unique gift's symbol | ",
+ "rst_description": "Custom emoji identifier of the unique gift's symbol\n",
+ "name": "symbol_custom_emoji_id",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Main color used in light themes; RGB format",
+ "html_description": "Main color used in light themes; RGB format | ",
+ "rst_description": "Main color used in light themes; RGB format\n",
+ "name": "light_theme_main_color",
+ "required": true
+ },
+ {
+ "type": "Array of Integer",
+ "description": "List of 1-3 additional colors used in light themes; RGB format",
+ "html_description": "List of 1-3 additional colors used in light themes; RGB format | ",
+ "rst_description": "List of 1-3 additional colors used in light themes; RGB format\n",
+ "name": "light_theme_other_colors",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Main color used in dark themes; RGB format",
+ "html_description": "Main color used in dark themes; RGB format | ",
+ "rst_description": "Main color used in dark themes; RGB format\n",
+ "name": "dark_theme_main_color",
+ "required": true
+ },
+ {
+ "type": "Array of Integer",
+ "description": "List of 1-3 additional colors used in dark themes; RGB format",
+ "html_description": "List of 1-3 additional colors used in dark themes; RGB format | ",
+ "rst_description": "List of 1-3 additional colors used in dark themes; RGB format\n",
+ "name": "dark_theme_other_colors",
+ "required": true
+ }
+ ],
+ "category": "types"
+ },
{
"anchor": "uniquegift",
"name": "UniqueGift",
@@ -7822,6 +8068,14 @@
"html_description": "This object describes a unique gift that was upgraded from a regular gift.
",
"rst_description": "This object describes a unique gift that was upgraded from a regular gift.",
"annotations": [
+ {
+ "type": "String",
+ "description": "Identifier of the regular gift from which the gift was upgraded",
+ "html_description": "Identifier of the regular gift from which the gift was upgraded | ",
+ "rst_description": "Identifier of the regular gift from which the gift was upgraded\n",
+ "name": "gift_id",
+ "required": true
+ },
{
"type": "String",
"description": "Human-readable name of the regular gift from which this unique gift was upgraded",
@@ -7870,6 +8124,30 @@
"name": "backdrop",
"required": true
},
+ {
+ "type": "True",
+ "description": "True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers",
+ "html_description": "Optional. True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers | ",
+ "rst_description": "*Optional*. :code:`True`, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers\n",
+ "name": "is_premium",
+ "required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram",
+ "html_description": "Optional. True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
+ "name": "is_from_blockchain",
+ "required": false
+ },
+ {
+ "type": "UniqueGiftColors",
+ "description": "The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only",
+ "html_description": "Optional. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only | ",
+ "rst_description": "*Optional*. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only\n",
+ "name": "colors",
+ "required": false
+ },
{
"type": "Chat",
"description": "Information about the chat that published the gift",
@@ -7914,12 +8192,20 @@
},
{
"type": "Integer",
- "description": "Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift",
- "html_description": "Optional. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift | ",
- "rst_description": "*Optional*. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift\n",
+ "description": "Number of Telegram Stars that were prepaid for the ability to upgrade the gift",
+ "html_description": "Optional. Number of Telegram Stars that were prepaid for the ability to upgrade the gift | ",
+ "rst_description": "*Optional*. Number of Telegram Stars that were prepaid for the ability to upgrade the gift\n",
"name": "prepaid_upgrade_star_count",
"required": false
},
+ {
+ "type": "True",
+ "description": "True, if the gift's upgrade was purchased after the gift was sent",
+ "html_description": "Optional. True, if the gift's upgrade was purchased after the gift was sent | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift's upgrade was purchased after the gift was sent\n",
+ "name": "is_upgrade_separate",
+ "required": false
+ },
{
"type": "True",
"description": "True, if the gift can be upgraded to a unique gift",
@@ -7951,6 +8237,14 @@
"rst_description": "*Optional*. :code:`True`, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them\n",
"name": "is_private",
"required": false
+ },
+ {
+ "type": "Integer",
+ "description": "Unique number reserved for this gift when upgraded. See the number field in UniqueGift",
+ "html_description": "Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift | ",
+ "rst_description": "*Optional*. Unique number reserved for this gift when upgraded. See the *number* field in :class:`aiogram.types.unique_gift.UniqueGift`\n",
+ "name": "unique_gift_number",
+ "required": false
}
],
"category": "types"
@@ -7972,18 +8266,26 @@
},
{
"type": "String",
- "description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, or 'resale' for gifts bought from other users",
- "html_description": "Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, or “resale” for gifts bought from other users | ",
- "rst_description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, or 'resale' for gifts bought from other users\n",
+ "description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, 'resale' for gifts bought from other users, 'gifted_upgrade' for upgrades purchased after the gift was sent, or 'offer' for gifts bought or sold through gift purchase offers",
+ "html_description": "Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers | ",
+ "rst_description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, 'resale' for gifts bought from other users, 'gifted_upgrade' for upgrades purchased after the gift was sent, or 'offer' for gifts bought or sold through gift purchase offers\n",
"name": "origin",
"required": true
},
+ {
+ "type": "String",
+ "description": "For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of 'XTR' for Telegram Stars or 'TON' for toncoins.",
+ "html_description": "Optional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins. | ",
+ "rst_description": "*Optional*. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of 'XTR' for Telegram Stars or 'TON' for toncoins.\n",
+ "name": "last_resale_currency",
+ "required": false
+ },
{
"type": "Integer",
- "description": "For gifts bought from other users, the price paid for the gift",
- "html_description": "Optional. For gifts bought from other users, the price paid for the gift | ",
- "rst_description": "*Optional*. For gifts bought from other users, the price paid for the gift\n",
- "name": "last_resale_star_count",
+ "description": "For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins",
+ "html_description": "Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins | ",
+ "rst_description": "*Optional*. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins\n",
+ "name": "last_resale_amount",
"required": false
},
{
@@ -8119,19 +8421,35 @@
},
{
"type": "Integer",
- "description": "Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars",
- "html_description": "Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars | ",
- "rst_description": "*Optional*. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars\n",
+ "description": "Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only",
+ "html_description": "Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only | ",
+ "rst_description": "*Optional*. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only\n",
"name": "convert_star_count",
"required": false
},
{
"type": "Integer",
- "description": "Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift",
- "html_description": "Optional. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift | ",
- "rst_description": "*Optional*. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift\n",
+ "description": "Number of Telegram Stars that were paid for the ability to upgrade the gift",
+ "html_description": "Optional. Number of Telegram Stars that were paid for the ability to upgrade the gift | ",
+ "rst_description": "*Optional*. Number of Telegram Stars that were paid for the ability to upgrade the gift\n",
"name": "prepaid_upgrade_star_count",
"required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only",
+ "html_description": "Optional. True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only\n",
+ "name": "is_upgrade_separate",
+ "required": false
+ },
+ {
+ "type": "Integer",
+ "description": "Unique number reserved for this gift when upgraded. See the number field in UniqueGift",
+ "html_description": "Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift | ",
+ "rst_description": "*Optional*. Unique number reserved for this gift when upgraded. See the *number* field in :class:`aiogram.types.unique_gift.UniqueGift`\n",
+ "name": "unique_gift_number",
+ "required": false
}
],
"category": "types"
@@ -8290,6 +8608,14 @@
"rst_description": ":code:`True`, if a Telegram Premium subscription is accepted\n",
"name": "premium_subscription",
"required": true
+ },
+ {
+ "type": "Boolean",
+ "description": "True, if transfers of unique gifts from channels are accepted",
+ "html_description": "True, if transfers of unique gifts from channels are accepted | ",
+ "rst_description": ":code:`True`, if transfers of unique gifts from channels are accepted\n",
+ "name": "gifts_from_channels",
+ "required": true
}
],
"category": "types"
@@ -9908,9 +10234,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -10030,9 +10356,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -10075,6 +10401,14 @@
"rst_description": "Protects the contents of the forwarded message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "String",
+ "required": false,
+ "description": "Unique identifier of the message effect to be added to the message; only available when forwarding to private chats",
+ "html_description": "Unique identifier of the message effect to be added to the message; only available when forwarding to private chats | ",
+ "rst_description": "Unique identifier of the message effect to be added to the message; only available when forwarding to private chats\n",
+ "name": "message_effect_id"
+ },
{
"type": "SuggestedPostParameters",
"required": false,
@@ -10112,9 +10446,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -10178,9 +10512,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -10271,6 +10605,14 @@
"rst_description": "Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance\n",
"name": "allow_paid_broadcast"
},
+ {
+ "type": "String",
+ "required": false,
+ "description": "Unique identifier of the message effect to be added to the message; only available when copying to private chats",
+ "html_description": "Unique identifier of the message effect to be added to the message; only available when copying to private chats | ",
+ "rst_description": "Unique identifier of the message effect to be added to the message; only available when copying to private chats\n",
+ "name": "message_effect_id"
+ },
{
"type": "SuggestedPostParameters",
"required": false,
@@ -10316,9 +10658,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -10398,9 +10740,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -10544,9 +10886,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -10706,9 +11048,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -10852,9 +11194,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -11054,9 +11396,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -11232,9 +11574,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -11370,9 +11712,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -11500,9 +11842,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -11516,9 +11858,9 @@
{
"type": "Integer",
"required": true,
- "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000",
- "html_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000 | ",
- "rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000\n",
+ "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-25000",
+ "html_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-25000 | ",
+ "rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-25000\n",
"name": "star_count"
},
{
@@ -11646,9 +11988,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -11736,9 +12078,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -11882,9 +12224,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -12044,9 +12386,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -12174,9 +12516,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -12442,9 +12784,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -12522,6 +12864,64 @@
],
"category": "methods"
},
+ {
+ "anchor": "sendmessagedraft",
+ "name": "sendMessageDraft",
+ "description": "Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.",
+ "html_description": "Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.
",
+ "rst_description": "Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns :code:`True` on success.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier for the target private chat",
+ "html_description": "Unique identifier for the target private chat | ",
+ "rst_description": "Unique identifier for the target private chat\n",
+ "name": "chat_id"
+ },
+ {
+ "type": "Integer",
+ "required": false,
+ "description": "Unique identifier for the target message thread",
+ "html_description": "Unique identifier for the target message thread | ",
+ "rst_description": "Unique identifier for the target message thread\n",
+ "name": "message_thread_id"
+ },
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated",
+ "html_description": "Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated | ",
+ "rst_description": "Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated\n",
+ "name": "draft_id"
+ },
+ {
+ "type": "String",
+ "required": true,
+ "description": "Text of the message to be sent, 1-4096 characters after entities parsing",
+ "html_description": "Text of the message to be sent, 1-4096 characters after entities parsing | ",
+ "rst_description": "Text of the message to be sent, 1-4096 characters after entities parsing\n",
+ "name": "text"
+ },
+ {
+ "type": "String",
+ "required": false,
+ "description": "Mode for parsing entities in the message text. See formatting options for more details.",
+ "html_description": "Mode for parsing entities in the message text. See formatting options for more details. | ",
+ "rst_description": "Mode for parsing entities in the message text. See `formatting options `_ for more details.\n",
+ "name": "parse_mode"
+ },
+ {
+ "type": "Array of MessageEntity",
+ "required": false,
+ "description": "A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode",
+ "html_description": "A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode | ",
+ "rst_description": "A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*\n",
+ "name": "entities"
+ }
+ ],
+ "category": "methods"
+ },
{
"anchor": "sendchataction",
"name": "sendChatAction",
@@ -12548,9 +12948,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread; for supergroups only",
- "html_description": "Unique identifier for the target message thread; for supergroups only | ",
- "rst_description": "Unique identifier for the target message thread; for supergroups only\n",
+ "description": "Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -12876,9 +13276,9 @@
{
"type": "Boolean",
"required": false,
- "description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics",
- "html_description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics | ",
- "rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics\n",
+ "description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators",
+ "html_description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators | ",
+ "rst_description": "Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to :code:`True` for promotions of channel administrators\n",
"name": "can_restrict_members"
},
{
@@ -13758,9 +14158,9 @@
{
"anchor": "editforumtopic",
"name": "editForumTopic",
- "description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
- "html_description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
",
- "rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
+ "description": "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
+ "html_description": "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
",
+ "rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
@@ -13852,9 +14252,9 @@
{
"anchor": "deleteforumtopic",
"name": "deleteForumTopic",
- "description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.",
- "html_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
",
- "rst_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.",
+ "description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.",
+ "html_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
",
+ "rst_description": "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
@@ -13878,9 +14278,9 @@
{
"anchor": "unpinallforumtopicmessages",
"name": "unpinAllForumTopicMessages",
- "description": "Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.",
- "html_description": "Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
",
- "rst_description": "Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.",
+ "description": "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.",
+ "html_description": "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
",
+ "rst_description": "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
@@ -14452,9 +14852,9 @@
{
"type": "String",
"required": true,
- "description": "Identifier of the gift",
- "html_description": "Identifier of the gift | ",
- "rst_description": "Identifier of the gift\n",
+ "description": "Identifier of the gift; limited gifts can't be sent to channel chats",
+ "html_description": "Identifier of the gift; limited gifts can't be sent to channel chats | ",
+ "rst_description": "Identifier of the gift; limited gifts can't be sent to channel chats\n",
"name": "gift_id"
},
{
@@ -14964,10 +15364,108 @@
{
"type": "Boolean",
"required": false,
- "description": "Pass True to exclude gifts that can be purchased a limited number of times",
- "html_description": "Pass True to exclude gifts that can be purchased a limited number of times | ",
- "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times\n",
- "name": "exclude_limited"
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique\n",
+ "name": "exclude_limited_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique\n",
+ "name": "exclude_limited_non_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude unique gifts",
+ "html_description": "Pass True to exclude unique gifts | ",
+ "rst_description": "Pass :code:`True` to exclude unique gifts\n",
+ "name": "exclude_unique"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram",
+ "html_description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
+ "name": "exclude_from_blockchain"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.",
+ "html_description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. | ",
+ "rst_description": "Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination.\n",
+ "name": "sort_by_price"
+ },
+ {
+ "type": "String",
+ "required": false,
+ "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results",
+ "html_description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results | ",
+ "rst_description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results\n",
+ "name": "offset"
+ },
+ {
+ "type": "Integer",
+ "required": false,
+ "description": "The maximum number of gifts to be returned; 1-100. Defaults to 100",
+ "html_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100 | ",
+ "rst_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100\n",
+ "name": "limit"
+ }
+ ],
+ "category": "methods"
+ },
+ {
+ "anchor": "getusergifts",
+ "name": "getUserGifts",
+ "description": "Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.",
+ "html_description": "Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.
",
+ "rst_description": "Returns the gifts owned and hosted by a user. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the user",
+ "html_description": "Unique identifier of the user | ",
+ "rst_description": "Unique identifier of the user\n",
+ "name": "user_id"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased an unlimited number of times",
+ "html_description": "Pass True to exclude gifts that can be purchased an unlimited number of times | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times\n",
+ "name": "exclude_unlimited"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique\n",
+ "name": "exclude_limited_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique\n",
+ "name": "exclude_limited_non_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram",
+ "html_description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
+ "name": "exclude_from_blockchain"
},
{
"type": "Boolean",
@@ -14988,9 +15486,107 @@
{
"type": "String",
"required": false,
- "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results",
- "html_description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results | ",
- "rst_description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results\n",
+ "description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results",
+ "html_description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results | ",
+ "rst_description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results\n",
+ "name": "offset"
+ },
+ {
+ "type": "Integer",
+ "required": false,
+ "description": "The maximum number of gifts to be returned; 1-100. Defaults to 100",
+ "html_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100 | ",
+ "rst_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100\n",
+ "name": "limit"
+ }
+ ],
+ "category": "methods"
+ },
+ {
+ "anchor": "getchatgifts",
+ "name": "getChatGifts",
+ "description": "Returns the gifts owned by a chat. Returns OwnedGifts on success.",
+ "html_description": "Returns the gifts owned by a chat. Returns OwnedGifts on success.
",
+ "rst_description": "Returns the gifts owned by a chat. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.",
+ "annotations": [
+ {
+ "type": "Integer or String",
+ "required": true,
+ "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
+ "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername) | ",
+ "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
+ "name": "chat_id"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel.",
+ "html_description": "Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel. | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that aren't saved to the chat's profile page. Always :code:`True`, unless the bot has the *can_post_messages* administrator right in the channel.\n",
+ "name": "exclude_unsaved"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel.",
+ "html_description": "Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel. | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that are saved to the chat's profile page. Always :code:`False`, unless the bot has the *can_post_messages* administrator right in the channel.\n",
+ "name": "exclude_saved"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased an unlimited number of times",
+ "html_description": "Pass True to exclude gifts that can be purchased an unlimited number of times | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times\n",
+ "name": "exclude_unlimited"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique\n",
+ "name": "exclude_limited_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique",
+ "html_description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique\n",
+ "name": "exclude_limited_non_upgradable"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram",
+ "html_description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram | ",
+ "rst_description": "Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
+ "name": "exclude_from_blockchain"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to exclude unique gifts",
+ "html_description": "Pass True to exclude unique gifts | ",
+ "rst_description": "Pass :code:`True` to exclude unique gifts\n",
+ "name": "exclude_unique"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.",
+ "html_description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. | ",
+ "rst_description": "Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination.\n",
+ "name": "sort_by_price"
+ },
+ {
+ "type": "String",
+ "required": false,
+ "description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results",
+ "html_description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results | ",
+ "rst_description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results\n",
"name": "offset"
},
{
@@ -15196,6 +15792,64 @@
],
"category": "methods"
},
+ {
+ "anchor": "repoststory",
+ "name": "repostStory",
+ "description": "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.",
+ "html_description": "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.
",
+ "rst_description": "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the *can_manage_stories* business bot right for both business accounts. Returns :class:`aiogram.types.story.Story` on success.",
+ "annotations": [
+ {
+ "type": "String",
+ "required": true,
+ "description": "Unique identifier of the business connection",
+ "html_description": "Unique identifier of the business connection | ",
+ "rst_description": "Unique identifier of the business connection\n",
+ "name": "business_connection_id"
+ },
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the chat which posted the story that should be reposted",
+ "html_description": "Unique identifier of the chat which posted the story that should be reposted | ",
+ "rst_description": "Unique identifier of the chat which posted the story that should be reposted\n",
+ "name": "from_chat_id"
+ },
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Unique identifier of the story that should be reposted",
+ "html_description": "Unique identifier of the story that should be reposted | ",
+ "rst_description": "Unique identifier of the story that should be reposted\n",
+ "name": "from_story_id"
+ },
+ {
+ "type": "Integer",
+ "required": true,
+ "description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400",
+ "html_description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 | ",
+ "rst_description": "Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`\n",
+ "name": "active_period"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True to keep the story accessible after it expires",
+ "html_description": "Pass True to keep the story accessible after it expires | ",
+ "rst_description": "Pass :code:`True` to keep the story accessible after it expires\n",
+ "name": "post_to_chat_page"
+ },
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass True if the content of the story must be protected from forwarding and screenshotting",
+ "html_description": "Pass True if the content of the story must be protected from forwarding and screenshotting | ",
+ "rst_description": "Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting\n",
+ "name": "protect_content"
+ }
+ ],
+ "category": "methods"
+ },
{
"anchor": "editstory",
"name": "editStory",
@@ -16232,9 +16886,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -19506,9 +20160,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
@@ -21700,9 +22354,9 @@
{
"type": "Integer",
"required": false,
- "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
- "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | ",
- "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n",
+ "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only",
+ "html_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only | ",
+ "rst_description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only\n",
"name": "message_thread_id"
},
{
diff --git a/.butcher/types/AcceptedGiftTypes/entity.json b/.butcher/types/AcceptedGiftTypes/entity.json
index 705f4f65..5292a643 100644
--- a/.butcher/types/AcceptedGiftTypes/entity.json
+++ b/.butcher/types/AcceptedGiftTypes/entity.json
@@ -42,6 +42,14 @@
"rst_description": ":code:`True`, if a Telegram Premium subscription is accepted\n",
"name": "premium_subscription",
"required": true
+ },
+ {
+ "type": "Boolean",
+ "description": "True, if transfers of unique gifts from channels are accepted",
+ "html_description": "True, if transfers of unique gifts from channels are accepted | ",
+ "rst_description": ":code:`True`, if transfers of unique gifts from channels are accepted\n",
+ "name": "gifts_from_channels",
+ "required": true
}
],
"category": "types"
diff --git a/.butcher/types/ChatFullInfo/entity.json b/.butcher/types/ChatFullInfo/entity.json
index 228bfc9b..937ed037 100644
--- a/.butcher/types/ChatFullInfo/entity.json
+++ b/.butcher/types/ChatFullInfo/entity.json
@@ -387,6 +387,30 @@
"name": "location",
"required": false
},
+ {
+ "type": "UserRating",
+ "description": "For private chats, the rating of the user if any",
+ "html_description": "Optional. For private chats, the rating of the user if any | ",
+ "rst_description": "*Optional*. For private chats, the rating of the user if any\n",
+ "name": "rating",
+ "required": false
+ },
+ {
+ "type": "UniqueGiftColors",
+ "description": "The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews",
+ "html_description": "Optional. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews | ",
+ "rst_description": "*Optional*. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews\n",
+ "name": "unique_gift_colors",
+ "required": false
+ },
+ {
+ "type": "Integer",
+ "description": "The number of Telegram Stars a general user have to pay to send a message to the chat",
+ "html_description": "Optional. The number of Telegram Stars a general user have to pay to send a message to the chat | ",
+ "rst_description": "*Optional*. The number of Telegram Stars a general user have to pay to send a message to the chat\n",
+ "name": "paid_message_star_count",
+ "required": false
+ },
{
"type": "True",
"description": "True, if gifts can be sent to the chat",
diff --git a/.butcher/types/ChecklistTask/entity.json b/.butcher/types/ChecklistTask/entity.json
index 6c9318c4..7dd1af45 100644
--- a/.butcher/types/ChecklistTask/entity.json
+++ b/.butcher/types/ChecklistTask/entity.json
@@ -37,12 +37,20 @@
},
{
"type": "User",
- "description": "User that completed the task; omitted if the task wasn't completed",
- "html_description": "Optional. User that completed the task; omitted if the task wasn't completed | ",
- "rst_description": "*Optional*. User that completed the task; omitted if the task wasn't completed\n",
+ "description": "User that completed the task; omitted if the task wasn't completed by a user",
+ "html_description": "Optional. User that completed the task; omitted if the task wasn't completed by a user | ",
+ "rst_description": "*Optional*. User that completed the task; omitted if the task wasn't completed by a user\n",
"name": "completed_by_user",
"required": false
},
+ {
+ "type": "Chat",
+ "description": "Chat that completed the task; omitted if the task wasn't completed by a chat",
+ "html_description": "Optional. Chat that completed the task; omitted if the task wasn't completed by a chat | ",
+ "rst_description": "*Optional*. Chat that completed the task; omitted if the task wasn't completed by a chat\n",
+ "name": "completed_by_chat",
+ "required": false
+ },
{
"type": "Integer",
"description": "Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed",
diff --git a/.butcher/types/DirectMessagesTopic/entity.json b/.butcher/types/DirectMessagesTopic/entity.json
index 975449d4..7139d8de 100644
--- a/.butcher/types/DirectMessagesTopic/entity.json
+++ b/.butcher/types/DirectMessagesTopic/entity.json
@@ -13,9 +13,9 @@
"annotations": [
{
"type": "Integer",
- "description": "Unique identifier of the topic",
- "html_description": "Unique identifier of the topic | ",
- "rst_description": "Unique identifier of the topic\n",
+ "description": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.",
+ "html_description": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. | ",
+ "rst_description": "Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.\n",
"name": "topic_id",
"required": true
},
diff --git a/.butcher/types/ForumTopic/entity.json b/.butcher/types/ForumTopic/entity.json
index 4198661a..d774fb7e 100644
--- a/.butcher/types/ForumTopic/entity.json
+++ b/.butcher/types/ForumTopic/entity.json
@@ -42,6 +42,14 @@
"rst_description": "*Optional*. Unique identifier of the custom emoji shown as the topic icon\n",
"name": "icon_custom_emoji_id",
"required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot",
+ "html_description": "Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot | ",
+ "rst_description": "*Optional*. :code:`True`, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot\n",
+ "name": "is_name_implicit",
+ "required": false
}
],
"category": "types"
diff --git a/.butcher/types/ForumTopicCreated/entity.json b/.butcher/types/ForumTopicCreated/entity.json
index f1832898..a2b39b66 100644
--- a/.butcher/types/ForumTopicCreated/entity.json
+++ b/.butcher/types/ForumTopicCreated/entity.json
@@ -34,6 +34,14 @@
"rst_description": "*Optional*. Unique identifier of the custom emoji shown as the topic icon\n",
"name": "icon_custom_emoji_id",
"required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot",
+ "html_description": "Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot | ",
+ "rst_description": "*Optional*. :code:`True`, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot\n",
+ "name": "is_name_implicit",
+ "required": false
}
],
"category": "types"
diff --git a/.butcher/types/Gift/entity.json b/.butcher/types/Gift/entity.json
index baabd8ba..be2f518f 100644
--- a/.butcher/types/Gift/entity.json
+++ b/.butcher/types/Gift/entity.json
@@ -43,22 +43,70 @@
"name": "upgrade_star_count",
"required": false
},
+ {
+ "type": "True",
+ "description": "True, if the gift can only be purchased by Telegram Premium subscribers",
+ "html_description": "Optional. True, if the gift can only be purchased by Telegram Premium subscribers | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift can only be purchased by Telegram Premium subscribers\n",
+ "name": "is_premium",
+ "required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the gift can be used (after being upgraded) to customize a user's appearance",
+ "html_description": "Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift can be used (after being upgraded) to customize a user's appearance\n",
+ "name": "has_colors",
+ "required": false
+ },
{
"type": "Integer",
- "description": "The total number of the gifts of this type that can be sent; for limited gifts only",
- "html_description": "Optional. The total number of the gifts of this type that can be sent; for limited gifts only | ",
- "rst_description": "*Optional*. The total number of the gifts of this type that can be sent; for limited gifts only\n",
+ "description": "The total number of gifts of this type that can be sent by all users; for limited gifts only",
+ "html_description": "Optional. The total number of gifts of this type that can be sent by all users; for limited gifts only | ",
+ "rst_description": "*Optional*. The total number of gifts of this type that can be sent by all users; for limited gifts only\n",
"name": "total_count",
"required": false
},
{
"type": "Integer",
- "description": "The number of remaining gifts of this type that can be sent; for limited gifts only",
- "html_description": "Optional. The number of remaining gifts of this type that can be sent; for limited gifts only | ",
- "rst_description": "*Optional*. The number of remaining gifts of this type that can be sent; for limited gifts only\n",
+ "description": "The number of remaining gifts of this type that can be sent by all users; for limited gifts only",
+ "html_description": "Optional. The number of remaining gifts of this type that can be sent by all users; for limited gifts only | ",
+ "rst_description": "*Optional*. The number of remaining gifts of this type that can be sent by all users; for limited gifts only\n",
"name": "remaining_count",
"required": false
},
+ {
+ "type": "Integer",
+ "description": "The total number of gifts of this type that can be sent by the bot; for limited gifts only",
+ "html_description": "Optional. The total number of gifts of this type that can be sent by the bot; for limited gifts only | ",
+ "rst_description": "*Optional*. The total number of gifts of this type that can be sent by the bot; for limited gifts only\n",
+ "name": "personal_total_count",
+ "required": false
+ },
+ {
+ "type": "Integer",
+ "description": "The number of remaining gifts of this type that can be sent by the bot; for limited gifts only",
+ "html_description": "Optional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only | ",
+ "rst_description": "*Optional*. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only\n",
+ "name": "personal_remaining_count",
+ "required": false
+ },
+ {
+ "type": "GiftBackground",
+ "description": "Background of the gift",
+ "html_description": "Optional. Background of the gift | ",
+ "rst_description": "*Optional*. Background of the gift\n",
+ "name": "background",
+ "required": false
+ },
+ {
+ "type": "Integer",
+ "description": "The total number of different unique gifts that can be obtained by upgrading the gift",
+ "html_description": "Optional. The total number of different unique gifts that can be obtained by upgrading the gift | ",
+ "rst_description": "*Optional*. The total number of different unique gifts that can be obtained by upgrading the gift\n",
+ "name": "unique_gift_variant_count",
+ "required": false
+ },
{
"type": "Chat",
"description": "Information about the chat that published the gift",
diff --git a/.butcher/types/GiftBackground/entity.json b/.butcher/types/GiftBackground/entity.json
new file mode 100644
index 00000000..34e3e0a6
--- /dev/null
+++ b/.butcher/types/GiftBackground/entity.json
@@ -0,0 +1,41 @@
+{
+ "meta": {},
+ "group": {
+ "title": "Available types",
+ "anchor": "available-types"
+ },
+ "object": {
+ "anchor": "giftbackground",
+ "name": "GiftBackground",
+ "description": "This object describes the background of a gift.",
+ "html_description": "This object describes the background of a gift.
",
+ "rst_description": "This object describes the background of a gift.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "description": "Center color of the background in RGB format",
+ "html_description": "Center color of the background in RGB format | ",
+ "rst_description": "Center color of the background in RGB format\n",
+ "name": "center_color",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Edge color of the background in RGB format",
+ "html_description": "Edge color of the background in RGB format | ",
+ "rst_description": "Edge color of the background in RGB format\n",
+ "name": "edge_color",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Text color of the background in RGB format",
+ "html_description": "Text color of the background in RGB format | ",
+ "rst_description": "Text color of the background in RGB format\n",
+ "name": "text_color",
+ "required": true
+ }
+ ],
+ "category": "types"
+ }
+}
diff --git a/.butcher/types/GiftInfo/entity.json b/.butcher/types/GiftInfo/entity.json
index 03af4484..daf00279 100644
--- a/.butcher/types/GiftInfo/entity.json
+++ b/.butcher/types/GiftInfo/entity.json
@@ -37,12 +37,20 @@
},
{
"type": "Integer",
- "description": "Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift",
- "html_description": "Optional. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift | ",
- "rst_description": "*Optional*. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift\n",
+ "description": "Number of Telegram Stars that were prepaid for the ability to upgrade the gift",
+ "html_description": "Optional. Number of Telegram Stars that were prepaid for the ability to upgrade the gift | ",
+ "rst_description": "*Optional*. Number of Telegram Stars that were prepaid for the ability to upgrade the gift\n",
"name": "prepaid_upgrade_star_count",
"required": false
},
+ {
+ "type": "True",
+ "description": "True, if the gift's upgrade was purchased after the gift was sent",
+ "html_description": "Optional. True, if the gift's upgrade was purchased after the gift was sent | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift's upgrade was purchased after the gift was sent\n",
+ "name": "is_upgrade_separate",
+ "required": false
+ },
{
"type": "True",
"description": "True, if the gift can be upgraded to a unique gift",
@@ -74,6 +82,14 @@
"rst_description": "*Optional*. :code:`True`, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them\n",
"name": "is_private",
"required": false
+ },
+ {
+ "type": "Integer",
+ "description": "Unique number reserved for this gift when upgraded. See the number field in UniqueGift",
+ "html_description": "Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift | ",
+ "rst_description": "*Optional*. Unique number reserved for this gift when upgraded. See the *number* field in :class:`aiogram.types.unique_gift.UniqueGift`\n",
+ "name": "unique_gift_number",
+ "required": false
}
],
"category": "types"
diff --git a/.butcher/types/InputChecklist/entity.json b/.butcher/types/InputChecklist/entity.json
index dd1dc8d5..a04bdf65 100644
--- a/.butcher/types/InputChecklist/entity.json
+++ b/.butcher/types/InputChecklist/entity.json
@@ -22,8 +22,8 @@
{
"type": "String",
"description": "Mode for parsing entities in the title. See formatting options for more details.",
- "html_description": "Optional. Mode for parsing entities in the title. See formatting options for more details. | ",
- "rst_description": "Optional. Mode for parsing entities in the title. See `formatting options `_ for more details.\n",
+ "html_description": "Optional. Mode for parsing entities in the title. See formatting options for more details. | ",
+ "rst_description": "*Optional*. Mode for parsing entities in the title. See `formatting options `_ for more details.\n",
"name": "parse_mode",
"required": false
},
diff --git a/.butcher/types/InputChecklistTask/entity.json b/.butcher/types/InputChecklistTask/entity.json
index b951262a..7fd5b8cd 100644
--- a/.butcher/types/InputChecklistTask/entity.json
+++ b/.butcher/types/InputChecklistTask/entity.json
@@ -30,8 +30,8 @@
{
"type": "String",
"description": "Mode for parsing entities in the text. See formatting options for more details.",
- "html_description": "Optional. Mode for parsing entities in the text. See formatting options for more details. | ",
- "rst_description": "Optional. Mode for parsing entities in the text. See `formatting options `_ for more details.\n",
+ "html_description": "Optional. Mode for parsing entities in the text. See formatting options for more details. | ",
+ "rst_description": "*Optional*. Mode for parsing entities in the text. See `formatting options `_ for more details.\n",
"name": "parse_mode",
"required": false
},
diff --git a/.butcher/types/KeyboardButton/entity.json b/.butcher/types/KeyboardButton/entity.json
index f98688ff..d0eff8d0 100644
--- a/.butcher/types/KeyboardButton/entity.json
+++ b/.butcher/types/KeyboardButton/entity.json
@@ -22,16 +22,16 @@
{
"type": "KeyboardButtonRequestUsers",
"description": "If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.",
- "html_description": "Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. | ",
- "rst_description": "*Optional.* If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.\n",
+ "html_description": "Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. | ",
+ "rst_description": "*Optional*. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.\n",
"name": "request_users",
"required": false
},
{
"type": "KeyboardButtonRequestChat",
"description": "If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only.",
- "html_description": "Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. | ",
- "rst_description": "*Optional.* If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only.\n",
+ "html_description": "Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. | ",
+ "rst_description": "*Optional*. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only.\n",
"name": "request_chat",
"required": false
},
diff --git a/.butcher/types/Message/entity.json b/.butcher/types/Message/entity.json
index 0fbb922b..d4dd8bc0 100644
--- a/.butcher/types/Message/entity.json
+++ b/.butcher/types/Message/entity.json
@@ -21,9 +21,9 @@
},
{
"type": "Integer",
- "description": "Unique identifier of a message thread to which the message belongs; for supergroups only",
- "html_description": "Optional. Unique identifier of a message thread to which the message belongs; for supergroups only | ",
- "rst_description": "*Optional*. Unique identifier of a message thread to which the message belongs; for supergroups only\n",
+ "description": "Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only",
+ "html_description": "Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only | ",
+ "rst_description": "*Optional*. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only\n",
"name": "message_thread_id",
"required": false
},
@@ -101,9 +101,9 @@
},
{
"type": "True",
- "description": "True, if the message is sent to a forum topic",
- "html_description": "Optional. True, if the message is sent to a forum topic | ",
- "rst_description": "*Optional*. :code:`True`, if the message is sent to a forum topic\n",
+ "description": "True, if the message is sent to a topic in a forum supergroup or a private chat with the bot",
+ "html_description": "Optional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot | ",
+ "rst_description": "*Optional*. :code:`True`, if the message is sent to a topic in a forum supergroup or a private chat with the bot\n",
"name": "is_topic_message",
"required": false
},
@@ -579,6 +579,14 @@
"name": "unique_gift",
"required": false
},
+ {
+ "type": "GiftInfo",
+ "description": "Service message: upgrade of a gift was purchased after the gift was sent",
+ "html_description": "Optional. Service message: upgrade of a gift was purchased after the gift was sent | ",
+ "rst_description": "*Optional*. Service message: upgrade of a gift was purchased after the gift was sent\n",
+ "name": "gift_upgrade_sent",
+ "required": false
+ },
{
"type": "String",
"description": "The domain name of the website on which the user has logged in.",
diff --git a/.butcher/types/OwnedGiftRegular/entity.json b/.butcher/types/OwnedGiftRegular/entity.json
index 35390001..27c3d590 100644
--- a/.butcher/types/OwnedGiftRegular/entity.json
+++ b/.butcher/types/OwnedGiftRegular/entity.json
@@ -101,19 +101,35 @@
},
{
"type": "Integer",
- "description": "Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars",
- "html_description": "Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars | ",
- "rst_description": "*Optional*. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars\n",
+ "description": "Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only",
+ "html_description": "Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only | ",
+ "rst_description": "*Optional*. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only\n",
"name": "convert_star_count",
"required": false
},
{
"type": "Integer",
- "description": "Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift",
- "html_description": "Optional. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift | ",
- "rst_description": "*Optional*. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift\n",
+ "description": "Number of Telegram Stars that were paid for the ability to upgrade the gift",
+ "html_description": "Optional. Number of Telegram Stars that were paid for the ability to upgrade the gift | ",
+ "rst_description": "*Optional*. Number of Telegram Stars that were paid for the ability to upgrade the gift\n",
"name": "prepaid_upgrade_star_count",
"required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only",
+ "html_description": "Optional. True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only\n",
+ "name": "is_upgrade_separate",
+ "required": false
+ },
+ {
+ "type": "Integer",
+ "description": "Unique number reserved for this gift when upgraded. See the number field in UniqueGift",
+ "html_description": "Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift | ",
+ "rst_description": "*Optional*. Unique number reserved for this gift when upgraded. See the *number* field in :class:`aiogram.types.unique_gift.UniqueGift`\n",
+ "name": "unique_gift_number",
+ "required": false
}
],
"category": "types"
diff --git a/.butcher/types/SuggestedPostPrice/entity.json b/.butcher/types/SuggestedPostPrice/entity.json
index 3234077d..192a6984 100644
--- a/.butcher/types/SuggestedPostPrice/entity.json
+++ b/.butcher/types/SuggestedPostPrice/entity.json
@@ -7,9 +7,9 @@
"object": {
"anchor": "suggestedpostprice",
"name": "SuggestedPostPrice",
- "description": "Desribes price of a suggested post.",
- "html_description": "Desribes price of a suggested post.
",
- "rst_description": "Desribes price of a suggested post.",
+ "description": "Describes the price of a suggested post.",
+ "html_description": "Describes the price of a suggested post.
",
+ "rst_description": "Describes the price of a suggested post.",
"annotations": [
{
"type": "String",
diff --git a/.butcher/types/UniqueGift/entity.json b/.butcher/types/UniqueGift/entity.json
index edb104ab..9d5f4a50 100644
--- a/.butcher/types/UniqueGift/entity.json
+++ b/.butcher/types/UniqueGift/entity.json
@@ -11,6 +11,14 @@
"html_description": "This object describes a unique gift that was upgraded from a regular gift.
",
"rst_description": "This object describes a unique gift that was upgraded from a regular gift.",
"annotations": [
+ {
+ "type": "String",
+ "description": "Identifier of the regular gift from which the gift was upgraded",
+ "html_description": "Identifier of the regular gift from which the gift was upgraded | ",
+ "rst_description": "Identifier of the regular gift from which the gift was upgraded\n",
+ "name": "gift_id",
+ "required": true
+ },
{
"type": "String",
"description": "Human-readable name of the regular gift from which this unique gift was upgraded",
@@ -59,6 +67,30 @@
"name": "backdrop",
"required": true
},
+ {
+ "type": "True",
+ "description": "True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers",
+ "html_description": "Optional. True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers | ",
+ "rst_description": "*Optional*. :code:`True`, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers\n",
+ "name": "is_premium",
+ "required": false
+ },
+ {
+ "type": "True",
+ "description": "True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram",
+ "html_description": "Optional. True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram | ",
+ "rst_description": "*Optional*. :code:`True`, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram\n",
+ "name": "is_from_blockchain",
+ "required": false
+ },
+ {
+ "type": "UniqueGiftColors",
+ "description": "The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only",
+ "html_description": "Optional. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only | ",
+ "rst_description": "*Optional*. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only\n",
+ "name": "colors",
+ "required": false
+ },
{
"type": "Chat",
"description": "Information about the chat that published the gift",
diff --git a/.butcher/types/UniqueGiftColors/entity.json b/.butcher/types/UniqueGiftColors/entity.json
new file mode 100644
index 00000000..70d9d3c9
--- /dev/null
+++ b/.butcher/types/UniqueGiftColors/entity.json
@@ -0,0 +1,65 @@
+{
+ "meta": {},
+ "group": {
+ "title": "Available types",
+ "anchor": "available-types"
+ },
+ "object": {
+ "anchor": "uniquegiftcolors",
+ "name": "UniqueGiftColors",
+ "description": "This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.",
+ "html_description": "This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.
",
+ "rst_description": "This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.",
+ "annotations": [
+ {
+ "type": "String",
+ "description": "Custom emoji identifier of the unique gift's model",
+ "html_description": "Custom emoji identifier of the unique gift's model | ",
+ "rst_description": "Custom emoji identifier of the unique gift's model\n",
+ "name": "model_custom_emoji_id",
+ "required": true
+ },
+ {
+ "type": "String",
+ "description": "Custom emoji identifier of the unique gift's symbol",
+ "html_description": "Custom emoji identifier of the unique gift's symbol | ",
+ "rst_description": "Custom emoji identifier of the unique gift's symbol\n",
+ "name": "symbol_custom_emoji_id",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Main color used in light themes; RGB format",
+ "html_description": "Main color used in light themes; RGB format | ",
+ "rst_description": "Main color used in light themes; RGB format\n",
+ "name": "light_theme_main_color",
+ "required": true
+ },
+ {
+ "type": "Array of Integer",
+ "description": "List of 1-3 additional colors used in light themes; RGB format",
+ "html_description": "List of 1-3 additional colors used in light themes; RGB format | ",
+ "rst_description": "List of 1-3 additional colors used in light themes; RGB format\n",
+ "name": "light_theme_other_colors",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Main color used in dark themes; RGB format",
+ "html_description": "Main color used in dark themes; RGB format | ",
+ "rst_description": "Main color used in dark themes; RGB format\n",
+ "name": "dark_theme_main_color",
+ "required": true
+ },
+ {
+ "type": "Array of Integer",
+ "description": "List of 1-3 additional colors used in dark themes; RGB format",
+ "html_description": "List of 1-3 additional colors used in dark themes; RGB format | ",
+ "rst_description": "List of 1-3 additional colors used in dark themes; RGB format\n",
+ "name": "dark_theme_other_colors",
+ "required": true
+ }
+ ],
+ "category": "types"
+ }
+}
diff --git a/.butcher/types/UniqueGiftInfo/entity.json b/.butcher/types/UniqueGiftInfo/entity.json
index 696a433f..c6693e33 100644
--- a/.butcher/types/UniqueGiftInfo/entity.json
+++ b/.butcher/types/UniqueGiftInfo/entity.json
@@ -21,18 +21,26 @@
},
{
"type": "String",
- "description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, or 'resale' for gifts bought from other users",
- "html_description": "Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, or “resale” for gifts bought from other users | ",
- "rst_description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, or 'resale' for gifts bought from other users\n",
+ "description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, 'resale' for gifts bought from other users, 'gifted_upgrade' for upgrades purchased after the gift was sent, or 'offer' for gifts bought or sold through gift purchase offers",
+ "html_description": "Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers | ",
+ "rst_description": "Origin of the gift. Currently, either 'upgrade' for gifts upgraded from regular gifts, 'transfer' for gifts transferred from other users or channels, 'resale' for gifts bought from other users, 'gifted_upgrade' for upgrades purchased after the gift was sent, or 'offer' for gifts bought or sold through gift purchase offers\n",
"name": "origin",
"required": true
},
+ {
+ "type": "String",
+ "description": "For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of 'XTR' for Telegram Stars or 'TON' for toncoins.",
+ "html_description": "Optional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins. | ",
+ "rst_description": "*Optional*. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of 'XTR' for Telegram Stars or 'TON' for toncoins.\n",
+ "name": "last_resale_currency",
+ "required": false
+ },
{
"type": "Integer",
- "description": "For gifts bought from other users, the price paid for the gift",
- "html_description": "Optional. For gifts bought from other users, the price paid for the gift | ",
- "rst_description": "*Optional*. For gifts bought from other users, the price paid for the gift\n",
- "name": "last_resale_star_count",
+ "description": "For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins",
+ "html_description": "Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins | ",
+ "rst_description": "*Optional*. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins\n",
+ "name": "last_resale_amount",
"required": false
},
{
@@ -58,6 +66,18 @@
"rst_description": "*Optional*. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now\n",
"name": "next_transfer_date",
"required": false
+ },
+ {
+ "type": "Integer",
+ "description": "For gifts bought from other users, the price paid for the gift",
+ "html_description": "Optional. For gifts bought from other users, the price paid for the gift | ",
+ "rst_description": "*Optional*. For gifts bought from other users, the price paid for the gift\n",
+ "name": "last_resale_star_count",
+ "required": false,
+ "deprecated": {
+ "version": "9.3",
+ "release_date": "2025-12-31"
+ }
}
],
"category": "types"
diff --git a/.butcher/types/User/entity.json b/.butcher/types/User/entity.json
index 820d7563..b444dbb3 100644
--- a/.butcher/types/User/entity.json
+++ b/.butcher/types/User/entity.json
@@ -114,6 +114,14 @@
"rst_description": "*Optional*. :code:`True`, if the bot has a main Web App. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n",
"name": "has_main_web_app",
"required": false
+ },
+ {
+ "type": "Boolean",
+ "description": "True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.",
+ "html_description": "Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. | ",
+ "rst_description": "*Optional*. :code:`True`, if the bot has forum topic mode enabled in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n",
+ "name": "has_topics_enabled",
+ "required": false
}
],
"category": "types"
diff --git a/.butcher/types/UserRating/entity.json b/.butcher/types/UserRating/entity.json
new file mode 100644
index 00000000..fb49d5b2
--- /dev/null
+++ b/.butcher/types/UserRating/entity.json
@@ -0,0 +1,49 @@
+{
+ "meta": {},
+ "group": {
+ "title": "Available types",
+ "anchor": "available-types"
+ },
+ "object": {
+ "anchor": "userrating",
+ "name": "UserRating",
+ "description": "This object describes the rating of a user based on their Telegram Star spendings.",
+ "html_description": "This object describes the rating of a user based on their Telegram Star spendings.
",
+ "rst_description": "This object describes the rating of a user based on their Telegram Star spendings.",
+ "annotations": [
+ {
+ "type": "Integer",
+ "description": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.",
+ "html_description": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern. | ",
+ "rst_description": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.\n",
+ "name": "level",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "Numerical value of the user's rating; the higher the rating, the better",
+ "html_description": "Numerical value of the user's rating; the higher the rating, the better | ",
+ "rst_description": "Numerical value of the user's rating; the higher the rating, the better\n",
+ "name": "rating",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "The rating value required to get the current level",
+ "html_description": "The rating value required to get the current level | ",
+ "rst_description": "The rating value required to get the current level\n",
+ "name": "current_level_rating",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "The rating value required to get to the next level; omitted if the maximum level was reached",
+ "html_description": "Optional. The rating value required to get to the next level; omitted if the maximum level was reached | ",
+ "rst_description": "*Optional*. The rating value required to get to the next level; omitted if the maximum level was reached\n",
+ "name": "next_level_rating",
+ "required": false
+ }
+ ],
+ "category": "types"
+ }
+}
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 6b2da3b6..c4430ef6 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,2 +1 @@
open_collective: aiogram
-
diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml
index ee7fc0be..d0084593 100644
--- a/.github/workflows/pypi-release.yml
+++ b/.github/workflows/pypi-release.yml
@@ -10,25 +10,22 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- - name: Set up Python 3.11
- uses: actions/setup-python@v5
+ - name: Set up Python 3.14
+ uses: actions/setup-python@v6
with:
- python-version: "3.11"
+ python-version: "3.14"
- - name: Install build dependencies
- run: python -m pip install --upgrade build
+ - name: Install uv
+ uses: astral-sh/setup-uv@v7
- name: Resolve version
id: package-version
run: echo "value=$(echo ${{ github.ref }} | sed -e 's/refs\/tags\/v//')" >> $GITHUB_OUTPUT
- # - name: Bump version
- # run: hatch version ${{ steps.package-version.outputs.value }}
-
- - name: Build source distribution
- run: python -m build .
+ - name: Build distribution
+ run: uv build
- name: Try install wheel
run: |
@@ -39,7 +36,7 @@ jobs:
venv/bin/pip install ../dist/aiogram-*.whl
venv/bin/python -c "import aiogram; print(aiogram.__version__)"
- name: Publish artifacts
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v6
with:
name: dist
path: dist/*
@@ -55,7 +52,7 @@ jobs:
id-token: write
steps:
- name: Download artifacts
- uses: actions/download-artifact@v4
+ uses: actions/download-artifact@v7
with:
name: dist
path: dist
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index a4d0b90b..122d6b1d 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -58,18 +58,21 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- cache: "pip"
- cache-dependency-path: pyproject.toml
+
+ - name: Install uv
+ uses: astral-sh/setup-uv@v7
+ with:
+ enable-cache: true
- name: Install project dependencies
run: |
- pip install -e .[dev,test,redis,mongo,proxy,i18n,fast,signature]
+ uv sync --all-extras --group dev --group test
- name: Lint code
run: |
- ruff check --output-format=github aiogram examples
- mypy aiogram
- black --check --diff aiogram tests
+ uv run ruff check --output-format=github aiogram examples
+ uv run mypy aiogram
+ uv run black --check --diff aiogram tests
- name: Setup redis
if: ${{ env.IS_WINDOWS == 'false' }}
@@ -91,10 +94,10 @@ jobs:
flags="$flags --cov=aiogram --cov-config .coveragerc --cov-report=xml"
[[ "$IS_WINDOWS" == "false" ]] && flags="$flags --redis redis://localhost:6379/0"
[[ "$IS_UBUNTU" == "true" ]] && flags="$flags --mongo mongodb://mongo:mongo@localhost:27017"
- pytest $flags
+ uv run pytest $flags
- name: Upload coverage data
- uses: codecov/codecov-action@v4
+ uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
@@ -123,20 +126,23 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
- uses: actions/setup-python@v5
+ uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- cache: "pip"
- cache-dependency-path: pyproject.toml
+
+ - name: Install uv
+ uses: astral-sh/setup-uv@v7
+ with:
+ enable-cache: true
- name: Install project dependencies
run: |
- pip install -e .[dev,test,redis,mongo,proxy,i18n,fast,signature]
+ uv sync --all-extras --group dev --group test
- name: Run tests
run: |
flags=""
- pytest $flags
+ uv run pytest $flags
diff --git a/CHANGES.rst b/CHANGES.rst
index 3e28c02f..4369caa7 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -16,6 +16,96 @@ Changelog
.. towncrier release notes start
+3.24.0 (2026-01-02)
+====================
+
+Features
+--------
+
+- Added full support for Telegram Bot API 9.3
+
+ **Topics in Private Chats**
+
+ Bot API 9.3 introduces forum topics functionality for private chats:
+
+ - Added new ``sendMessageDraft`` method for streaming partial messages while being generated (requires forum topic mode enabled)
+ - Added ``has_topics_enabled`` field to the ``User`` class to determine if forum topic mode is enabled in private chats
+ - Added ``message_thread_id`` and ``is_topic_message`` fields to the ``Message`` class for private chat topic support
+ - Added ``message_thread_id`` parameter support to messaging methods: ``sendMessage``, ``sendPhoto``, ``sendVideo``, ``sendAnimation``, ``sendAudio``, ``sendDocument``, ``sendPaidMedia``, ``sendSticker``, ``sendVideoNote``, ``sendVoice``, ``sendLocation``, ``sendVenue``, ``sendContact``, ``sendPoll``, ``sendDice``, ``sendInvoice``, ``sendGame``, ``sendMediaGroup``, ``copyMessage``, ``copyMessages``, ``forwardMessage``, ``forwardMessages``
+ - Updated ``sendChatAction`` to support ``message_thread_id`` parameter in private chats
+ - Updated ``editForumTopic``, ``deleteForumTopic``, ``unpinAllForumTopicMessages`` methods to manage private chat topics
+ - Added ``is_name_implicit`` field to ``ForumTopic`` class
+
+ **Gifts System Enhancements**
+
+ Enhanced gifts functionality with new methods and extended capabilities:
+
+ - Added ``getUserGifts`` method to retrieve gifts owned and hosted by a user
+ - Added ``getChatGifts`` method to retrieve gifts owned by a chat
+ - Updated ``UniqueGiftInfo`` class: replaced ``last_resale_star_count`` with ``last_resale_currency`` and ``last_resale_amount`` fields, added "gifted_upgrade" and "offer" as origin values
+ - Updated ``getBusinessAccountGifts`` method: replaced ``exclude_limited`` parameter with ``exclude_limited_upgradable`` and ``exclude_limited_non_upgradable``, added ``exclude_from_blockchain`` parameter
+ - Added new fields to ``Gift`` class: ``personal_total_count``, ``personal_remaining_count``, ``is_premium``, ``has_colors``, ``unique_gift_variant_count``, ``gift_background``
+ - Added new fields to ``UniqueGift`` class: ``gift_id``, ``is_from_blockchain``, ``is_premium``, ``colors``
+ - Added new fields to gift info classes: ``is_upgrade_separate``, ``unique_gift_number``
+ - Added ``gift_upgrade_sent`` field to the ``Message`` class
+ - Added ``gifts_from_channels`` field to the ``AcceptedGiftTypes`` class
+ - Added new ``UniqueGiftColors`` class for color schemes in user names and link previews
+ - Added new ``GiftBackground`` class for gift background styling
+
+ **Business Accounts & Stories**
+
+ - Added ``repostStory`` method to enable reposting stories across managed business accounts
+
+ **Miscellaneous Updates**
+
+ - Bots can now disable main usernames and set ``can_restrict_members`` rights in channels
+ - Maximum paid media price increased to 25000 Telegram Stars
+ - Added new ``UserRating`` class
+ - Added ``rating``, ``paid_message_star_count``, ``unique_gift_colors`` fields to the ``ChatFullInfo`` class
+ - Added support for ``message_effect_id`` parameter in forward/copy operations
+ - Added ``completed_by_chat`` field to the ``ChecklistTask`` class
+ `#1747 `_
+
+
+Bugfixes
+--------
+
+- Fixed I18n initialization with relative path
+ `#1740 `_
+- Fixed dependency injection for arguments that have "ForwardRef" annotations in Py3.14+
+ since `inspect.getfullargspec(callback)` can't process callback if it's arguments have "ForwardRef" annotations
+ `#1741 `_
+
+
+Misc
+----
+
+- Migrated from ``hatch`` to ``uv`` for dependency management and development workflows.
+
+ This change improves developer experience with significantly faster dependency resolution (10-100x faster than pip), automatic virtual environment management, and reproducible builds through lockfile support.
+
+ **What changed for contributors:**
+
+ - Install dependencies with ``uv sync --all-extras --group dev --group test`` instead of ``pip install -e .[dev,test,docs]``
+ - Run commands with ``uv run`` prefix (e.g., ``uv run pytest``, ``uv run black``)
+ - All Makefile commands now use ``uv`` internally (``make install``, ``make test``, ``make lint``, etc.)
+ - Version bumping now uses a custom ``scripts/bump_version.py`` script instead of ``hatch version``
+
+ **What stayed the same:**
+
+ - Build backend remains ``hatchling`` (no changes to package building)
+ - Dynamic version reading from ``aiogram/__meta__.py`` still works
+ - All GitHub Actions CI/CD workflows updated to use ``uv``
+ - ReadTheDocs builds continue to work without changes
+ - Development dependencies (``dev``, ``test``) moved to ``[dependency-groups]`` section
+ - Documentation dependencies (``docs``) remain in ``[project.optional-dependencies]`` for compatibility
+
+ Contributors can use either the traditional ``pip``/``venv`` workflow or the new ``uv`` workflow - both are documented in the contributing guide.
+ `#1748 `_
+- Updated type hints in the codebase to Python 3.10+ style unions and optionals.
+ `#1749 `_
+
+
3.23.0 (2025-12-07)
====================
diff --git a/Makefile b/Makefile
index e30d71aa..0c6ad5a3 100644
--- a/Makefile
+++ b/Makefile
@@ -28,8 +28,8 @@ clean:
.PHONY: install
install: clean
- pip install -e ."[dev,test,docs]" -U --upgrade-strategy=eager
- pre-commit install
+ uv sync --all-extras --group dev --group test
+ uv run pre-commit install
# =================================================================================================
# Code quality
@@ -37,15 +37,15 @@ install: clean
.PHONY: lint
lint:
- isort --check-only $(code_dir)
- black --check --diff $(code_dir)
- ruff check --show-fixes --preview $(package_dir) $(examples_dir)
- mypy $(package_dir)
+ uv run isort --check-only $(code_dir)
+ uv run black --check --diff $(code_dir)
+ uv run ruff check --show-fixes --preview $(package_dir) $(examples_dir)
+ uv run mypy $(package_dir)
.PHONY: reformat
reformat:
- black $(code_dir)
- isort $(code_dir)
+ uv run black $(code_dir)
+ uv run isort $(code_dir)
# =================================================================================================
# Tests
@@ -56,18 +56,18 @@ test-run-services:
.PHONY: test
test: test-run-services
- pytest --cov=aiogram --cov-config .coveragerc tests/ --redis $(redis_connection) --mongo $(mongo_connection)
+ uv run pytest --cov=aiogram --cov-config .coveragerc tests/ --redis $(redis_connection) --mongo $(mongo_connection)
.PHONY: test-coverage
test-coverage: test-run-services
mkdir -p $(reports_dir)/tests/
- pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/ --redis $(redis_connection) --mongo $(mongo_connection)
- coverage html -d $(reports_dir)/coverage
+ uv run pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/ --redis $(redis_connection) --mongo $(mongo_connection)
+ uv run coverage html -d $(reports_dir)/coverage
.PHONY: test-coverage-view
test-coverage-view:
- coverage html -d $(reports_dir)/coverage
- python -c "import webbrowser; webbrowser.open('file://$(shell pwd)/reports/coverage/index.html')"
+ uv run coverage html -d $(reports_dir)/coverage
+ uv run python -c "import webbrowser; webbrowser.open('file://$(shell pwd)/reports/coverage/index.html')"
# =================================================================================================
# Docs
@@ -79,12 +79,12 @@ locales_pot := _build/gettext
docs_dir := docs
docs-gettext:
- hatch run docs:bash -c 'cd $(docs_dir) && make gettext'
- hatch run docs:bash -c 'cd $(docs_dir) && sphinx-intl update -p $(locales_pot) $(addprefix -l , $(locales))'
+ uv run --extra docs bash -c 'cd $(docs_dir) && make gettext'
+ uv run --extra docs bash -c 'cd $(docs_dir) && sphinx-intl update -p $(locales_pot) $(addprefix -l , $(locales))'
.PHONY: docs-gettext
docs-serve:
- hatch run docs:sphinx-autobuild --watch aiogram/ --watch CHANGES.rst --watch README.rst docs/ docs/_build/ $(OPTS)
+ uv run --extra docs sphinx-autobuild --watch aiogram/ --watch CHANGES.rst --watch README.rst docs/ docs/_build/ $(OPTS)
.PHONY: docs-serve
$(locale_targets): docs-serve-%:
@@ -97,31 +97,31 @@ $(locale_targets): docs-serve-%:
.PHONY: build
build: clean
- hatch build
+ uv build
.PHONY: bump
bump:
- hatch version $(args)
- python scripts/bump_versions.py
+ uv run python scripts/bump_version.py $(args)
+ uv run python scripts/bump_versions.py
update-api:
- butcher parse
- butcher refresh
- butcher apply all
+ uv run --extra cli butcher parse
+ uv run --extra cli butcher refresh
+ uv run --extra cli butcher apply all
@$(MAKE) bump
.PHONY: towncrier-build
towncrier-build:
- hatch run docs:towncrier build --yes
+ uv run --extra docs towncrier build --yes
.PHONY: towncrier-draft
towncrier-draft:
- hatch run docs:towncrier build --draft
+ uv run --extra docs towncrier build --draft
.PHONY: towncrier-draft-github
towncrier-draft-github:
mkdir -p dist
- hatch run docs:towncrier build --draft | pandoc - -o dist/release.md
+ uv run --extra docs towncrier build --draft | pandoc - -o dist/release.md
.PHONY: prepare-release
prepare-release: bump towncrier-build
@@ -129,5 +129,5 @@ prepare-release: bump towncrier-build
.PHONY: release
release:
git add .
- git commit -m "Release $(shell poetry version -s)"
- git tag v$(shell hatch version -s)
+ git commit -m "Release $(shell uv run python -c 'from aiogram import __version__; print(__version__)')"
+ git tag v$(shell uv run python -c 'from aiogram import __version__; print(__version__)')
diff --git a/README.rst b/README.rst
index 350a05f8..52322104 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 9.2 `_ and gets fast updates to the latest versions of the Bot API
+- Supports `Telegram Bot API 9.3 `_ 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 cf908980..6f449426 100644
--- a/aiogram/__meta__.py
+++ b/aiogram/__meta__.py
@@ -1,2 +1,2 @@
-__version__ = "3.23.0"
-__api_version__ = "9.2"
+__version__ = "3.24.0"
+__api_version__ = "9.3"
diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py
index 10ac1477..fd5ba841 100644
--- a/aiogram/client/bot.py
+++ b/aiogram/client/bot.py
@@ -9,10 +9,7 @@ from typing import (
AsyncGenerator,
AsyncIterator,
BinaryIO,
- Optional,
- Type,
TypeVar,
- Union,
cast,
)
@@ -76,6 +73,7 @@ from ..methods import (
GetBusinessConnection,
GetChat,
GetChatAdministrators,
+ GetChatGifts,
GetChatMember,
GetChatMemberCount,
GetChatMenuButton,
@@ -94,6 +92,7 @@ from ..methods import (
GetStickerSet,
GetUpdates,
GetUserChatBoosts,
+ GetUserGifts,
GetUserProfilePhotos,
GetWebhookInfo,
GiftPremiumSubscription,
@@ -111,6 +110,7 @@ from ..methods import (
ReopenForumTopic,
ReopenGeneralForumTopic,
ReplaceStickerInSet,
+ RepostStory,
RestrictChatMember,
RevokeChatInviteLink,
SavePreparedInlineMessage,
@@ -127,6 +127,7 @@ from ..methods import (
SendLocation,
SendMediaGroup,
SendMessage,
+ SendMessageDraft,
SendPaidMedia,
SendPhoto,
SendPoll,
@@ -255,8 +256,8 @@ class Bot:
def __init__(
self,
token: str,
- session: Optional[BaseSession] = None,
- default: Optional[DefaultBotProperties] = None,
+ session: BaseSession | None = None,
+ default: DefaultBotProperties | None = None,
**kwargs: Any,
) -> None:
"""
@@ -307,16 +308,16 @@ class Bot:
self.default = default
self.__token = token
- self._me: Optional[User] = None
+ self._me: User | None = None
async def __aenter__(self) -> "Bot":
return self
async def __aexit__(
self,
- exc_type: Optional[Type[BaseException]],
- exc_value: Optional[BaseException],
- traceback: Optional[TracebackType],
+ exc_type: type[BaseException] | None,
+ exc_value: BaseException | None,
+ traceback: TracebackType | None,
) -> None:
await self.session.close()
@@ -370,7 +371,7 @@ class Bot:
@classmethod
async def __download_file(
- cls, destination: Union[str, pathlib.Path], stream: AsyncGenerator[bytes, None]
+ cls, destination: str | pathlib.Path, stream: AsyncGenerator[bytes, None]
) -> None:
async with aiofiles.open(destination, "wb") as f:
async for chunk in stream:
@@ -378,7 +379,7 @@ class Bot:
@classmethod
async def __aiofiles_reader(
- cls, file: Union[str, pathlib.Path], chunk_size: int = 65536
+ cls, file: str | pathlib.Path, chunk_size: int = 65536
) -> AsyncGenerator[bytes, None]:
async with aiofiles.open(file, "rb") as f:
while chunk := await f.read(chunk_size):
@@ -386,12 +387,12 @@ class Bot:
async def download_file(
self,
- file_path: Union[str, pathlib.Path],
- destination: Optional[Union[BinaryIO, pathlib.Path, str]] = None,
+ file_path: str | pathlib.Path,
+ destination: BinaryIO | pathlib.Path | str | None = None,
timeout: int = 30,
chunk_size: int = 65536,
seek: bool = True,
- ) -> Optional[BinaryIO]:
+ ) -> BinaryIO | None:
"""
Download file by file_path to destination.
@@ -435,12 +436,12 @@ class Bot:
async def download(
self,
- file: Union[str, Downloadable],
- destination: Optional[Union[BinaryIO, pathlib.Path, str]] = None,
+ file: str | Downloadable,
+ destination: BinaryIO | pathlib.Path | str | None = None,
timeout: int = 30,
chunk_size: int = 65536,
seek: bool = True,
- ) -> Optional[BinaryIO]:
+ ) -> BinaryIO | None:
"""
Download file by file_id or Downloadable object to destination.
@@ -457,7 +458,7 @@ class Bot:
file_id = file
else:
# type is ignored in due to:
- # Incompatible types in assignment (expression has type "Optional[Any]", variable has type "str")
+ # Incompatible types in assignment (expression has type "Any | None", variable has type "str")
file_id = getattr(file, "file_id", None) # type: ignore
if file_id is None:
raise TypeError("file can only be of the string or Downloadable type")
@@ -473,9 +474,7 @@ class Bot:
file_path, destination=destination, timeout=timeout, chunk_size=chunk_size, seek=seek
)
- async def __call__(
- self, method: TelegramMethod[T], request_timeout: Optional[int] = None
- ) -> T:
+ async def __call__(self, method: TelegramMethod[T], request_timeout: int | None = None) -> T:
"""
Call API method
@@ -508,7 +507,7 @@ class Bot:
user_id: int,
name: str,
sticker: InputSticker,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns :code:`True` on success.
@@ -532,11 +531,11 @@ class Bot:
async def answer_callback_query(
self,
callback_query_id: str,
- text: Optional[str] = None,
- show_alert: Optional[bool] = None,
- url: Optional[str] = None,
- cache_time: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ text: str | None = None,
+ show_alert: bool | None = None,
+ url: str | None = None,
+ cache_time: int | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to send answers to callback queries sent from `inline keyboards `_. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, :code:`True` is returned.
@@ -567,13 +566,13 @@ class Bot:
self,
inline_query_id: str,
results: list[InlineQueryResultUnion],
- cache_time: Optional[int] = None,
- is_personal: Optional[bool] = None,
- next_offset: Optional[str] = None,
- button: Optional[InlineQueryResultsButton] = None,
- switch_pm_parameter: Optional[str] = None,
- switch_pm_text: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ cache_time: int | None = None,
+ is_personal: bool | None = None,
+ next_offset: str | None = None,
+ button: InlineQueryResultsButton | None = None,
+ switch_pm_parameter: str | None = None,
+ switch_pm_text: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to send answers to an inline query. On success, :code:`True` is returned.
@@ -610,8 +609,8 @@ class Bot:
self,
pre_checkout_query_id: str,
ok: bool,
- error_message: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ error_message: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an :class:`aiogram.types.update.Update` with the field *pre_checkout_query*. Use this method to respond to such pre-checkout queries. On success, :code:`True` is returned. **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
@@ -636,9 +635,9 @@ class Bot:
self,
shipping_query_id: str,
ok: bool,
- shipping_options: Optional[list[ShippingOption]] = None,
- error_message: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ shipping_options: list[ShippingOption] | None = None,
+ error_message: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
If you sent an invoice requesting a shipping address and the parameter *is_flexible* was specified, the Bot API will send an :class:`aiogram.types.update.Update` with a *shipping_query* field to the bot. Use this method to reply to shipping queries. On success, :code:`True` is returned.
@@ -665,7 +664,7 @@ class Bot:
self,
web_app_query_id: str,
result: InlineQueryResultUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> SentWebAppMessage:
"""
Use this method to set the result of an interaction with a `Web App `_ and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a :class:`aiogram.types.sent_web_app_message.SentWebAppMessage` object is returned.
@@ -688,7 +687,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
user_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the *can_invite_users* administrator right. Returns :code:`True` on success.
@@ -711,9 +710,9 @@ class Bot:
self,
chat_id: ChatIdUnion,
user_id: int,
- until_date: Optional[DateTimeUnion] = None,
- revoke_messages: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ until_date: DateTimeUnion | None = None,
+ revoke_messages: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless `unbanned `_ first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
@@ -740,7 +739,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
sender_chat_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to ban a channel chat in a supergroup or a channel. Until the chat is `unbanned `_, the owner of the banned chat won't be able to send messages on behalf of **any of their channels**. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
@@ -761,7 +760,7 @@ class Bot:
async def close(
self,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns :code:`True` on success. Requires no parameters.
@@ -779,7 +778,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_thread_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
@@ -803,24 +802,23 @@ class Bot:
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_id: int,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- video_start_timestamp: Optional[DateTimeUnion] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ video_start_timestamp: DateTimeUnion | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> MessageId:
"""
Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success.
@@ -830,7 +828,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param from_chat_id: Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)
:param message_id: Message identifier in the chat specified in *from_chat_id*
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param video_start_timestamp: New start timestamp for the copied video in the message
:param caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
@@ -840,6 +838,7 @@ class Bot:
:param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; only available when copying to private chats
:param suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
:param reply_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user
@@ -863,6 +862,7 @@ class Bot:
disable_notification=disable_notification,
protect_content=protect_content,
allow_paid_broadcast=allow_paid_broadcast,
+ message_effect_id=message_effect_id,
suggested_post_parameters=suggested_post_parameters,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -874,11 +874,11 @@ class Bot:
async def create_chat_invite_link(
self,
chat_id: ChatIdUnion,
- name: Optional[str] = None,
- expire_date: Optional[DateTimeUnion] = None,
- member_limit: Optional[int] = None,
- creates_join_request: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ name: str | None = None,
+ expire_date: DateTimeUnion | None = None,
+ member_limit: int | None = None,
+ creates_join_request: bool | None = None,
+ request_timeout: int | None = None,
) -> ChatInviteLink:
"""
Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method :class:`aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink`. Returns the new invite link as :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
@@ -907,9 +907,9 @@ class Bot:
self,
chat_id: ChatIdUnion,
name: str,
- icon_color: Optional[int] = None,
- icon_custom_emoji_id: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ icon_color: int | None = None,
+ icon_custom_emoji_id: str | None = None,
+ request_timeout: int | None = None,
) -> ForumTopic:
"""
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object.
@@ -939,24 +939,24 @@ class Bot:
payload: str,
currency: str,
prices: list[LabeledPrice],
- business_connection_id: Optional[str] = None,
- provider_token: Optional[str] = None,
- subscription_period: Optional[int] = None,
- max_tip_amount: Optional[int] = None,
- suggested_tip_amounts: Optional[list[int]] = None,
- provider_data: Optional[str] = None,
- photo_url: Optional[str] = None,
- photo_size: Optional[int] = None,
- photo_width: Optional[int] = None,
- photo_height: Optional[int] = None,
- need_name: Optional[bool] = None,
- need_phone_number: Optional[bool] = None,
- need_email: Optional[bool] = None,
- need_shipping_address: Optional[bool] = None,
- send_phone_number_to_provider: Optional[bool] = None,
- send_email_to_provider: Optional[bool] = None,
- is_flexible: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ provider_token: str | None = None,
+ subscription_period: int | None = None,
+ max_tip_amount: int | None = None,
+ suggested_tip_amounts: list[int] | None = None,
+ provider_data: str | None = None,
+ photo_url: str | None = None,
+ photo_size: int | None = None,
+ photo_width: int | None = None,
+ photo_height: int | None = None,
+ need_name: bool | None = None,
+ need_phone_number: bool | None = None,
+ need_email: bool | None = None,
+ need_shipping_address: bool | None = None,
+ send_phone_number_to_provider: bool | None = None,
+ send_email_to_provider: bool | None = None,
+ is_flexible: bool | None = None,
+ request_timeout: int | None = None,
) -> str:
"""
Use this method to create a link for an invoice. Returns the created invoice link as *String* on success.
@@ -1021,10 +1021,10 @@ class Bot:
name: str,
title: str,
stickers: list[InputSticker],
- sticker_type: Optional[str] = None,
- needs_repainting: Optional[bool] = None,
- sticker_format: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ sticker_type: str | None = None,
+ needs_repainting: bool | None = None,
+ sticker_format: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns :code:`True` on success.
@@ -1057,7 +1057,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
user_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the *can_invite_users* administrator right. Returns :code:`True` on success.
@@ -1079,7 +1079,7 @@ class Bot:
async def delete_chat_photo(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
@@ -1099,7 +1099,7 @@ class Bot:
async def delete_chat_sticker_set(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field *can_set_sticker_set* optionally returned in :class:`aiogram.methods.get_chat.GetChat` requests to check if the bot can use this method. Returns :code:`True` on success.
@@ -1120,10 +1120,10 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_thread_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
- Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.
+ Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#deleteforumtopic
@@ -1143,7 +1143,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to delete a message, including service messages, with the following limitations:
@@ -1184,9 +1184,9 @@ class Bot:
async def delete_my_commands(
self,
- scope: Optional[BotCommandScopeUnion] = None,
- language_code: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ scope: BotCommandScopeUnion | None = None,
+ language_code: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, `higher level commands `_ will be shown to affected users. Returns :code:`True` on success.
@@ -1208,7 +1208,7 @@ class Bot:
async def delete_sticker_from_set(
self,
sticker: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to delete a sticker from a set created by the bot. Returns :code:`True` on success.
@@ -1227,8 +1227,8 @@ class Bot:
async def delete_webhook(
self,
- drop_pending_updates: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ drop_pending_updates: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to remove webhook integration if you decide to switch back to :class:`aiogram.methods.get_updates.GetUpdates`. Returns :code:`True` on success.
@@ -1249,11 +1249,11 @@ class Bot:
self,
chat_id: ChatIdUnion,
invite_link: str,
- name: Optional[str] = None,
- expire_date: Optional[DateTimeUnion] = None,
- member_limit: Optional[int] = None,
- creates_join_request: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ name: str | None = None,
+ expire_date: DateTimeUnion | None = None,
+ member_limit: int | None = None,
+ creates_join_request: bool | None = None,
+ request_timeout: int | None = None,
) -> ChatInviteLink:
"""
Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
@@ -1284,12 +1284,12 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_thread_id: int,
- name: Optional[str] = None,
- icon_custom_emoji_id: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ name: str | None = None,
+ icon_custom_emoji_id: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
- Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
+ Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#editforumtopic
@@ -1311,19 +1311,17 @@ class Bot:
async def edit_message_caption(
self,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- request_timeout: Optional[int] = None,
- ) -> Union[Message, bool]:
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ reply_markup: InlineKeyboardMarkup | None = None,
+ request_timeout: int | None = None,
+ ) -> Message | bool:
"""
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
@@ -1359,17 +1357,17 @@ class Bot:
self,
latitude: float,
longitude: float,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- live_period: Optional[int] = None,
- horizontal_accuracy: Optional[float] = None,
- heading: Optional[int] = None,
- proximity_alert_radius: Optional[int] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- request_timeout: Optional[int] = None,
- ) -> Union[Message, bool]:
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ live_period: int | None = None,
+ horizontal_accuracy: float | None = None,
+ heading: int | None = None,
+ proximity_alert_radius: int | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ request_timeout: int | None = None,
+ ) -> Message | bool:
"""
Use this method to edit live location messages. A location can be edited until its *live_period* expires or editing is explicitly disabled by a call to :class:`aiogram.methods.stop_message_live_location.StopMessageLiveLocation`. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned.
@@ -1408,13 +1406,13 @@ class Bot:
async def edit_message_media(
self,
media: InputMediaUnion,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- request_timeout: Optional[int] = None,
- ) -> Union[Message, bool]:
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ request_timeout: int | None = None,
+ ) -> Message | bool:
"""
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
@@ -1442,13 +1440,13 @@ class Bot:
async def edit_message_reply_markup(
self,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- request_timeout: Optional[int] = None,
- ) -> Union[Message, bool]:
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ request_timeout: int | None = None,
+ ) -> Message | bool:
"""
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
@@ -1475,21 +1473,17 @@ class Bot:
async def edit_message_text(
self,
text: str,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- entities: Optional[list[MessageEntity]] = None,
- link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
- "link_preview"
- ),
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- disable_web_page_preview: Optional[Union[bool, Default]] = Default(
- "link_preview_is_disabled"
- ),
- request_timeout: Optional[int] = None,
- ) -> Union[Message, bool]:
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ entities: list[MessageEntity] | None = None,
+ link_preview_options: LinkPreviewOptions | Default | None = Default("link_preview"),
+ reply_markup: InlineKeyboardMarkup | None = None,
+ disable_web_page_preview: bool | Default | None = Default("link_preview_is_disabled"),
+ request_timeout: int | None = None,
+ ) -> Message | bool:
"""
Use this method to edit text and `game `_ messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
@@ -1526,7 +1520,7 @@ class Bot:
async def export_chat_invite_link(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> str:
"""
Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as *String* on success.
@@ -1550,13 +1544,14 @@ class Bot:
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_id: int,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- video_start_timestamp: Optional[DateTimeUnion] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- request_timeout: Optional[int] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ video_start_timestamp: DateTimeUnion | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -1566,11 +1561,12 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param from_chat_id: Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)
:param message_id: Message identifier in the chat specified in *from_chat_id*
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat
:param video_start_timestamp: New start timestamp for the forwarded video in the message
:param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the forwarded message from forwarding and saving
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; only available when forwarding to private chats
:param suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only
:param request_timeout: Request timeout
:return: On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -1585,6 +1581,7 @@ class Bot:
video_start_timestamp=video_start_timestamp,
disable_notification=disable_notification,
protect_content=protect_content,
+ message_effect_id=message_effect_id,
suggested_post_parameters=suggested_post_parameters,
)
return await self(call, request_timeout=request_timeout)
@@ -1592,7 +1589,7 @@ class Bot:
async def get_chat(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> ChatFullInfo:
"""
Use this method to get up-to-date information about the chat. Returns a :class:`aiogram.types.chat_full_info.ChatFullInfo` object on success.
@@ -1612,7 +1609,7 @@ class Bot:
async def get_chat_administrators(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> list[ResultChatMemberUnion]:
"""
Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of :class:`aiogram.types.chat_member.ChatMember` objects.
@@ -1633,7 +1630,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
user_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> ResultChatMemberUnion:
"""
Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success.
@@ -1655,7 +1652,7 @@ class Bot:
async def get_chat_member_count(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> int:
"""
Use this method to get the number of members in a chat. Returns *Int* on success.
@@ -1674,8 +1671,8 @@ class Bot:
async def get_chat_menu_button(
self,
- chat_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ chat_id: int | None = None,
+ request_timeout: int | None = None,
) -> ResultMenuButtonUnion:
"""
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns :class:`aiogram.types.menu_button.MenuButton` on success.
@@ -1695,7 +1692,7 @@ class Bot:
async def get_custom_emoji_stickers(
self,
custom_emoji_ids: list[str],
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> list[Sticker]:
"""
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of :class:`aiogram.types.sticker.Sticker` objects.
@@ -1715,7 +1712,7 @@ class Bot:
async def get_file(
self,
file_id: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> File:
"""
Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a :class:`aiogram.types.file.File` object is returned. The file can then be downloaded via the link :code:`https://api.telegram.org/file/bot/`, where :code:`` is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling :class:`aiogram.methods.get_file.GetFile` again.
@@ -1735,7 +1732,7 @@ class Bot:
async def get_forum_topic_icon_stickers(
self,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> list[Sticker]:
"""
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of :class:`aiogram.types.sticker.Sticker` objects.
@@ -1752,10 +1749,10 @@ class Bot:
async def get_game_high_scores(
self,
user_id: int,
- chat_id: Optional[int] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ chat_id: int | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ request_timeout: int | None = None,
) -> list[GameHighScore]:
"""
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of :class:`aiogram.types.game_high_score.GameHighScore` objects.
@@ -1782,7 +1779,7 @@ class Bot:
async def get_me(
self,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> User:
"""
A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a :class:`aiogram.types.user.User` object.
@@ -1798,9 +1795,9 @@ class Bot:
async def get_my_commands(
self,
- scope: Optional[BotCommandScopeUnion] = None,
- language_code: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ scope: BotCommandScopeUnion | None = None,
+ language_code: str | None = None,
+ request_timeout: int | None = None,
) -> list[BotCommand]:
"""
Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of :class:`aiogram.types.bot_command.BotCommand` objects. If commands aren't set, an empty list is returned.
@@ -1821,8 +1818,8 @@ class Bot:
async def get_my_default_administrator_rights(
self,
- for_channels: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ for_channels: bool | None = None,
+ request_timeout: int | None = None,
) -> ChatAdministratorRights:
"""
Use this method to get the current default administrator rights of the bot. Returns :class:`aiogram.types.chat_administrator_rights.ChatAdministratorRights` on success.
@@ -1842,7 +1839,7 @@ class Bot:
async def get_sticker_set(
self,
name: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> StickerSet:
"""
Use this method to get a sticker set. On success, a :class:`aiogram.types.sticker_set.StickerSet` object is returned.
@@ -1861,11 +1858,11 @@ class Bot:
async def get_updates(
self,
- offset: Optional[int] = None,
- limit: Optional[int] = None,
- timeout: Optional[int] = None,
- allowed_updates: Optional[list[str]] = None,
- request_timeout: Optional[int] = None,
+ offset: int | None = None,
+ limit: int | None = None,
+ timeout: int | None = None,
+ allowed_updates: list[str] | None = None,
+ request_timeout: int | None = None,
) -> list[Update]:
"""
Use this method to receive incoming updates using long polling (`wiki `_). Returns an Array of :class:`aiogram.types.update.Update` objects.
@@ -1897,9 +1894,9 @@ class Bot:
async def get_user_profile_photos(
self,
user_id: int,
- offset: Optional[int] = None,
- limit: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ offset: int | None = None,
+ limit: int | None = None,
+ request_timeout: int | None = None,
) -> UserProfilePhotos:
"""
Use this method to get a list of profile pictures for a user. Returns a :class:`aiogram.types.user_profile_photos.UserProfilePhotos` object.
@@ -1922,7 +1919,7 @@ class Bot:
async def get_webhook_info(
self,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> WebhookInfo:
"""
Use this method to get current webhook status. Requires no parameters. On success, returns a :class:`aiogram.types.webhook_info.WebhookInfo` object. If the bot is using :class:`aiogram.methods.get_updates.GetUpdates`, will return an object with the *url* field empty.
@@ -1939,7 +1936,7 @@ class Bot:
async def leave_chat(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method for your bot to leave a group, supergroup or channel. Returns :code:`True` on success.
@@ -1958,7 +1955,7 @@ class Bot:
async def log_out(
self,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to log out from the cloud Bot API server before launching the bot locally. You **must** log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns :code:`True` on success. Requires no parameters.
@@ -1976,9 +1973,9 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_id: int,
- business_connection_id: Optional[str] = None,
- disable_notification: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ disable_notification: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns :code:`True` on success.
@@ -2005,23 +2002,23 @@ class Bot:
self,
chat_id: ChatIdUnion,
user_id: int,
- is_anonymous: Optional[bool] = None,
- can_manage_chat: Optional[bool] = None,
- can_delete_messages: Optional[bool] = None,
- can_manage_video_chats: Optional[bool] = None,
- can_restrict_members: Optional[bool] = None,
- can_promote_members: Optional[bool] = None,
- can_change_info: Optional[bool] = None,
- can_invite_users: Optional[bool] = None,
- can_post_stories: Optional[bool] = None,
- can_edit_stories: Optional[bool] = None,
- can_delete_stories: Optional[bool] = None,
- can_post_messages: Optional[bool] = None,
- can_edit_messages: Optional[bool] = None,
- can_pin_messages: Optional[bool] = None,
- can_manage_topics: Optional[bool] = None,
- can_manage_direct_messages: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ is_anonymous: bool | None = None,
+ can_manage_chat: bool | None = None,
+ can_delete_messages: bool | None = None,
+ can_manage_video_chats: bool | None = None,
+ can_restrict_members: bool | None = None,
+ can_promote_members: bool | None = None,
+ can_change_info: bool | None = None,
+ can_invite_users: bool | None = None,
+ can_post_stories: bool | None = None,
+ can_edit_stories: bool | None = None,
+ can_delete_stories: bool | None = None,
+ can_post_messages: bool | None = None,
+ can_edit_messages: bool | None = None,
+ can_pin_messages: bool | None = None,
+ can_manage_topics: bool | None = None,
+ can_manage_direct_messages: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass :code:`False` for all boolean parameters to demote a user. Returns :code:`True` on success.
@@ -2034,7 +2031,7 @@ class Bot:
:param can_manage_chat: Pass :code:`True` if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege.
:param can_delete_messages: Pass :code:`True` if the administrator can delete messages of other users
:param can_manage_video_chats: Pass :code:`True` if the administrator can manage video chats
- :param can_restrict_members: Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics
+ :param can_restrict_members: Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to :code:`True` for promotions of channel administrators
:param can_promote_members: Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
:param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings
:param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat
@@ -2076,7 +2073,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_thread_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
@@ -2100,9 +2097,9 @@ class Bot:
chat_id: ChatIdUnion,
user_id: int,
permissions: ChatPermissions,
- use_independent_chat_permissions: Optional[bool] = None,
- until_date: Optional[DateTimeUnion] = None,
- request_timeout: Optional[int] = None,
+ use_independent_chat_permissions: bool | None = None,
+ until_date: DateTimeUnion | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass :code:`True` for all permissions to lift restrictions from a user. Returns :code:`True` on success.
@@ -2131,7 +2128,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
invite_link: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> ChatInviteLink:
"""
Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
@@ -2154,30 +2151,28 @@ class Bot:
self,
chat_id: ChatIdUnion,
animation: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- duration: Optional[int] = None,
- width: Optional[int] = None,
- height: Optional[int] = None,
- thumbnail: Optional[InputFile] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- has_spoiler: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ duration: int | None = None,
+ width: int | None = None,
+ height: int | None = None,
+ thumbnail: InputFile | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ has_spoiler: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
@@ -2187,7 +2182,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » `
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param duration: Duration of sent animation in seconds
:param width: Animation width
@@ -2242,26 +2237,26 @@ class Bot:
self,
chat_id: ChatIdUnion,
audio: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- duration: Optional[int] = None,
- performer: Optional[str] = None,
- title: Optional[str] = None,
- thumbnail: Optional[InputFile] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ duration: int | None = None,
+ performer: str | None = None,
+ title: str | None = None,
+ thumbnail: InputFile | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
@@ -2272,7 +2267,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param caption: Audio caption, 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the audio caption. See `formatting options `_ for more details.
@@ -2323,9 +2318,9 @@ class Bot:
self,
chat_id: ChatIdUnion,
action: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns :code:`True` on success.
@@ -2339,7 +2334,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`). Channel chats and channel direct messages chats aren't supported.
:param action: Type of action to broadcast. Choose one, depending on what the user is about to receive: *typing* for `text messages `_, *upload_photo* for `photos `_, *record_video* or *upload_video* for `videos `_, *record_voice* or *upload_voice* for `voice notes `_, *upload_document* for `general files `_, *choose_sticker* for `stickers `_, *find_location* for `location data `_, *record_video_note* or *upload_video_note* for `video notes `_.
:param business_connection_id: Unique identifier of the business connection on behalf of which the action will be sent
- :param message_thread_id: Unique identifier for the target message thread; for supergroups only
+ :param message_thread_id: Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only
:param request_timeout: Request timeout
:return: The user will see a 'sending photo' status for the bot.
"""
@@ -2357,21 +2352,21 @@ class Bot:
chat_id: ChatIdUnion,
phone_number: str,
first_name: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- last_name: Optional[str] = None,
- vcard: Optional[str] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ last_name: str | None = None,
+ vcard: str | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -2382,7 +2377,7 @@ class Bot:
:param phone_number: Contact's phone number
:param first_name: Contact's first name
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param last_name: Contact's last name
:param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes
@@ -2423,20 +2418,20 @@ class Bot:
async def send_dice(
self,
chat_id: ChatIdUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- emoji: Optional[str] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ emoji: str | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send an animated emoji that will display a random value. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -2445,7 +2440,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲'
:param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound.
@@ -2483,24 +2478,24 @@ class Bot:
self,
chat_id: ChatIdUnion,
document: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- thumbnail: Optional[InputFile] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- disable_content_type_detection: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ thumbnail: InputFile | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ disable_content_type_detection: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send general files. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
@@ -2510,7 +2505,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `
:param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing
@@ -2557,17 +2552,17 @@ class Bot:
self,
chat_id: int,
game_short_name: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -2577,7 +2572,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat. Games can't be sent to channel direct messages chats and channel chats.
:param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_.
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
@@ -2614,34 +2609,34 @@ class Bot:
payload: str,
currency: str,
prices: list[LabeledPrice],
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- provider_token: Optional[str] = None,
- max_tip_amount: Optional[int] = None,
- suggested_tip_amounts: Optional[list[int]] = None,
- start_parameter: Optional[str] = None,
- provider_data: Optional[str] = None,
- photo_url: Optional[str] = None,
- photo_size: Optional[int] = None,
- photo_width: Optional[int] = None,
- photo_height: Optional[int] = None,
- need_name: Optional[bool] = None,
- need_phone_number: Optional[bool] = None,
- need_email: Optional[bool] = None,
- need_shipping_address: Optional[bool] = None,
- send_phone_number_to_provider: Optional[bool] = None,
- send_email_to_provider: Optional[bool] = None,
- is_flexible: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ provider_token: str | None = None,
+ max_tip_amount: int | None = None,
+ suggested_tip_amounts: list[int] | None = None,
+ start_parameter: str | None = None,
+ provider_data: str | None = None,
+ photo_url: str | None = None,
+ photo_size: int | None = None,
+ photo_width: int | None = None,
+ photo_height: int | None = None,
+ need_name: bool | None = None,
+ need_phone_number: bool | None = None,
+ need_email: bool | None = None,
+ need_shipping_address: bool | None = None,
+ send_phone_number_to_provider: bool | None = None,
+ send_email_to_provider: bool | None = None,
+ is_flexible: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send invoices. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -2654,7 +2649,7 @@ class Bot:
:param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.
:param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.
:param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.
:param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.
@@ -2727,23 +2722,23 @@ class Bot:
chat_id: ChatIdUnion,
latitude: float,
longitude: float,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- horizontal_accuracy: Optional[float] = None,
- live_period: Optional[int] = None,
- heading: Optional[int] = None,
- proximity_alert_radius: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ horizontal_accuracy: float | None = None,
+ live_period: int | None = None,
+ heading: int | None = None,
+ proximity_alert_radius: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send point on the map. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -2754,7 +2749,7 @@ class Bot:
:param latitude: Latitude of the location
:param longitude: Longitude of the location
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
:param live_period: Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
@@ -2800,17 +2795,17 @@ class Bot:
self,
chat_id: ChatIdUnion,
media: list[MediaUnion],
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> list[Message]:
"""
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of :class:`aiogram.types.message.Message` objects that were sent is returned.
@@ -2820,7 +2815,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param media: A JSON-serialized array describing messages to be sent, must include 2-10 items
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
:param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent messages from forwarding and saving
@@ -2853,27 +2848,23 @@ class Bot:
self,
chat_id: ChatIdUnion,
text: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- entities: Optional[list[MessageEntity]] = None,
- link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
- "link_preview"
- ),
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- disable_web_page_preview: Optional[Union[bool, Default]] = Default(
- "link_preview_is_disabled"
- ),
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ entities: list[MessageEntity] | None = None,
+ link_preview_options: LinkPreviewOptions | Default | None = Default("link_preview"),
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ disable_web_page_preview: bool | Default | None = Default("link_preview_is_disabled"),
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -2883,7 +2874,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param text: Text of the message to be sent, 1-4096 characters after entities parsing
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details.
:param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*
@@ -2928,26 +2919,24 @@ class Bot:
self,
chat_id: ChatIdUnion,
photo: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- has_spoiler: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ has_spoiler: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -2957,7 +2946,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » `
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details.
@@ -3005,29 +2994,29 @@ class Bot:
chat_id: ChatIdUnion,
question: str,
options: list[InputPollOptionUnion],
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- question_entities: Optional[list[MessageEntity]] = None,
- is_anonymous: Optional[bool] = None,
- type: Optional[str] = None,
- allows_multiple_answers: Optional[bool] = None,
- correct_option_id: Optional[int] = None,
- explanation: Optional[str] = None,
- explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- explanation_entities: Optional[list[MessageEntity]] = None,
- open_period: Optional[int] = None,
- close_date: Optional[DateTimeUnion] = None,
- is_closed: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ question_parse_mode: str | Default | None = Default("parse_mode"),
+ question_entities: list[MessageEntity] | None = None,
+ is_anonymous: bool | None = None,
+ type: str | None = None,
+ allows_multiple_answers: bool | None = None,
+ correct_option_id: int | None = None,
+ explanation: str | None = None,
+ explanation_parse_mode: str | Default | None = Default("parse_mode"),
+ explanation_entities: list[MessageEntity] | None = None,
+ open_period: int | None = None,
+ close_date: DateTimeUnion | None = None,
+ is_closed: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send a native poll. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -3038,7 +3027,7 @@ class Bot:
:param question: Poll question, 1-300 characters
:param options: A JSON-serialized list of 2-12 answer options
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param question_parse_mode: Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed
:param question_entities: A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode*
:param is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True`
@@ -3096,20 +3085,20 @@ class Bot:
self,
chat_id: ChatIdUnion,
sticker: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- emoji: Optional[str] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ emoji: str | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send static .WEBP, `animated `_ .TGS, or `video `_ .WEBM stickers. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -3119,7 +3108,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL.
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param emoji: Emoji associated with the sticker; only for just uploaded stickers
:param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound.
@@ -3161,23 +3150,23 @@ class Bot:
longitude: float,
title: str,
address: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- foursquare_id: Optional[str] = None,
- foursquare_type: Optional[str] = None,
- google_place_id: Optional[str] = None,
- google_place_type: Optional[str] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ foursquare_id: str | None = None,
+ foursquare_type: str | None = None,
+ google_place_id: str | None = None,
+ google_place_type: str | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send information about a venue. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -3190,7 +3179,7 @@ class Bot:
:param title: Name of the venue
:param address: Address of the venue
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param foursquare_id: Foursquare identifier of the venue
:param foursquare_type: Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.)
@@ -3238,33 +3227,31 @@ class Bot:
self,
chat_id: ChatIdUnion,
video: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- duration: Optional[int] = None,
- width: Optional[int] = None,
- height: Optional[int] = None,
- thumbnail: Optional[InputFile] = None,
- cover: Optional[InputFileUnion] = None,
- start_timestamp: Optional[DateTimeUnion] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- has_spoiler: Optional[bool] = None,
- supports_streaming: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ duration: int | None = None,
+ width: int | None = None,
+ height: int | None = None,
+ thumbnail: InputFile | None = None,
+ cover: InputFileUnion | None = None,
+ start_timestamp: DateTimeUnion | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ has_spoiler: bool | None = None,
+ supports_streaming: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
@@ -3274,7 +3261,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param duration: Duration of sent video in seconds
:param width: Video width
@@ -3335,22 +3322,22 @@ class Bot:
self,
chat_id: ChatIdUnion,
video_note: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- duration: Optional[int] = None,
- length: Optional[int] = None,
- thumbnail: Optional[InputFile] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ duration: int | None = None,
+ length: int | None = None,
+ thumbnail: InputFile | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
As of `v.4.0 `_, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -3360,7 +3347,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `. Sending video notes by a URL is currently unsupported
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param duration: Duration of sent video in seconds
:param length: Video width and height, i.e. diameter of the video message
@@ -3403,23 +3390,23 @@ class Bot:
self,
chat_id: ChatIdUnion,
voice: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- duration: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ duration: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
@@ -3429,7 +3416,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param caption: Voice message caption, 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the voice message caption. See `formatting options `_ for more details.
@@ -3475,7 +3462,7 @@ class Bot:
chat_id: ChatIdUnion,
user_id: int,
custom_title: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns :code:`True` on success.
@@ -3499,8 +3486,8 @@ class Bot:
async def set_chat_description(
self,
chat_id: ChatIdUnion,
- description: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ description: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
@@ -3521,9 +3508,9 @@ class Bot:
async def set_chat_menu_button(
self,
- chat_id: Optional[int] = None,
- menu_button: Optional[MenuButtonUnion] = None,
- request_timeout: Optional[int] = None,
+ chat_id: int | None = None,
+ menu_button: MenuButtonUnion | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns :code:`True` on success.
@@ -3546,8 +3533,8 @@ class Bot:
self,
chat_id: ChatIdUnion,
permissions: ChatPermissions,
- use_independent_chat_permissions: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ use_independent_chat_permissions: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the *can_restrict_members* administrator rights. Returns :code:`True` on success.
@@ -3572,7 +3559,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
photo: InputFile,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
@@ -3595,7 +3582,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
sticker_set_name: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field *can_set_sticker_set* optionally returned in :class:`aiogram.methods.get_chat.GetChat` requests to check if the bot can use this method. Returns :code:`True` on success.
@@ -3618,7 +3605,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
title: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
@@ -3641,13 +3628,13 @@ class Bot:
self,
user_id: int,
score: int,
- force: Optional[bool] = None,
- disable_edit_message: Optional[bool] = None,
- chat_id: Optional[int] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- request_timeout: Optional[int] = None,
- ) -> Union[Message, bool]:
+ force: bool | None = None,
+ disable_edit_message: bool | None = None,
+ chat_id: int | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ request_timeout: int | None = None,
+ ) -> Message | bool:
"""
Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Returns an error, if the new score is not greater than the user's current score in the chat and *force* is :code:`False`.
@@ -3678,9 +3665,9 @@ class Bot:
async def set_my_commands(
self,
commands: list[BotCommand],
- scope: Optional[BotCommandScopeUnion] = None,
- language_code: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ scope: BotCommandScopeUnion | None = None,
+ language_code: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the list of the bot's commands. See `this manual `_ for more details about bot commands. Returns :code:`True` on success.
@@ -3703,9 +3690,9 @@ class Bot:
async def set_my_default_administrator_rights(
self,
- rights: Optional[ChatAdministratorRights] = None,
- for_channels: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ rights: ChatAdministratorRights | None = None,
+ for_channels: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns :code:`True` on success.
@@ -3728,7 +3715,7 @@ class Bot:
self,
user_id: int,
errors: list[PassportElementErrorUnion],
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns :code:`True` on success.
@@ -3752,7 +3739,7 @@ class Bot:
self,
sticker: str,
position: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to move a sticker in a set created by the bot to a specific position. Returns :code:`True` on success.
@@ -3774,13 +3761,13 @@ class Bot:
async def set_webhook(
self,
url: str,
- certificate: Optional[InputFile] = None,
- ip_address: Optional[str] = None,
- max_connections: Optional[int] = None,
- allowed_updates: Optional[list[str]] = None,
- drop_pending_updates: Optional[bool] = None,
- secret_token: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ certificate: InputFile | None = None,
+ ip_address: str | None = None,
+ max_connections: int | None = None,
+ allowed_updates: list[str] | None = None,
+ drop_pending_updates: bool | None = None,
+ secret_token: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request (a request with response `HTTP status code `_ different from :code:`2XY`), we will repeat the request and give up after a reasonable amount of attempts. Returns :code:`True` on success.
@@ -3821,13 +3808,13 @@ class Bot:
async def stop_message_live_location(
self,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- request_timeout: Optional[int] = None,
- ) -> Union[Message, bool]:
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ request_timeout: int | None = None,
+ ) -> Message | bool:
"""
Use this method to stop updating a live location message before *live_period* expires. On success, if the message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned.
@@ -3855,9 +3842,9 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_id: int,
- business_connection_id: Optional[str] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ request_timeout: int | None = None,
) -> Poll:
"""
Use this method to stop a poll which was sent by the bot. On success, the stopped :class:`aiogram.types.poll.Poll` is returned.
@@ -3884,8 +3871,8 @@ class Bot:
self,
chat_id: ChatIdUnion,
user_id: int,
- only_if_banned: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ only_if_banned: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to unban a previously banned user in a supergroup or channel. The user will **not** return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be **removed** from the chat. If you don't want this, use the parameter *only_if_banned*. Returns :code:`True` on success.
@@ -3910,7 +3897,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
sender_chat_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns :code:`True` on success.
@@ -3932,7 +3919,7 @@ class Bot:
async def unpin_all_chat_messages(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns :code:`True` on success.
@@ -3953,10 +3940,10 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_thread_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
- Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.
+ Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#unpinallforumtopicmessages
@@ -3975,9 +3962,9 @@ class Bot:
async def unpin_chat_message(
self,
chat_id: ChatIdUnion,
- business_connection_id: Optional[str] = None,
- message_id: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_id: int | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns :code:`True` on success.
@@ -4003,7 +3990,7 @@ class Bot:
user_id: int,
sticker: InputFile,
sticker_format: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> File:
"""
Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet`, :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, or :class:`aiogram.methods.replace_sticker_in_set.ReplaceStickerInSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.
@@ -4027,7 +4014,7 @@ class Bot:
async def close_general_forum_topic(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns :code:`True` on success.
@@ -4048,7 +4035,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
name: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns :code:`True` on success.
@@ -4070,7 +4057,7 @@ class Bot:
async def hide_general_forum_topic(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. The topic will be automatically closed if it was open. Returns :code:`True` on success.
@@ -4090,7 +4077,7 @@ class Bot:
async def reopen_general_forum_topic(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. The topic will be automatically unhidden if it was hidden. Returns :code:`True` on success.
@@ -4110,7 +4097,7 @@ class Bot:
async def unhide_general_forum_topic(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns :code:`True` on success.
@@ -4130,7 +4117,7 @@ class Bot:
async def delete_sticker_set(
self,
name: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to delete a sticker set that was created by the bot. Returns :code:`True` on success.
@@ -4149,8 +4136,8 @@ class Bot:
async def get_my_description(
self,
- language_code: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ language_code: str | None = None,
+ request_timeout: int | None = None,
) -> BotDescription:
"""
Use this method to get the current bot description for the given user language. Returns :class:`aiogram.types.bot_description.BotDescription` on success.
@@ -4169,8 +4156,8 @@ class Bot:
async def get_my_short_description(
self,
- language_code: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ language_code: str | None = None,
+ request_timeout: int | None = None,
) -> BotShortDescription:
"""
Use this method to get the current bot short description for the given user language. Returns :class:`aiogram.types.bot_short_description.BotShortDescription` on success.
@@ -4190,8 +4177,8 @@ class Bot:
async def set_custom_emoji_sticker_set_thumbnail(
self,
name: str,
- custom_emoji_id: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ custom_emoji_id: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to set the thumbnail of a custom emoji sticker set. Returns :code:`True` on success.
@@ -4212,9 +4199,9 @@ class Bot:
async def set_my_description(
self,
- description: Optional[str] = None,
- language_code: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ description: str | None = None,
+ language_code: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns :code:`True` on success.
@@ -4235,9 +4222,9 @@ class Bot:
async def set_my_short_description(
self,
- short_description: Optional[str] = None,
- language_code: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ short_description: str | None = None,
+ language_code: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns :code:`True` on success.
@@ -4260,7 +4247,7 @@ class Bot:
self,
sticker: str,
emoji_list: list[str],
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns :code:`True` on success.
@@ -4282,8 +4269,8 @@ class Bot:
async def set_sticker_keywords(
self,
sticker: str,
- keywords: Optional[list[str]] = None,
- request_timeout: Optional[int] = None,
+ keywords: list[str] | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns :code:`True` on success.
@@ -4305,8 +4292,8 @@ class Bot:
async def set_sticker_mask_position(
self,
sticker: str,
- mask_position: Optional[MaskPosition] = None,
- request_timeout: Optional[int] = None,
+ mask_position: MaskPosition | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the `mask position `_ of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns :code:`True` on success.
@@ -4330,8 +4317,8 @@ class Bot:
name: str,
user_id: int,
format: str,
- thumbnail: Optional[InputFileUnion] = None,
- request_timeout: Optional[int] = None,
+ thumbnail: InputFileUnion | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns :code:`True` on success.
@@ -4358,7 +4345,7 @@ class Bot:
self,
name: str,
title: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to set the title of a created sticker set. Returns :code:`True` on success.
@@ -4379,8 +4366,8 @@ class Bot:
async def get_my_name(
self,
- language_code: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ language_code: str | None = None,
+ request_timeout: int | None = None,
) -> BotName:
"""
Use this method to get the current bot name for the given user language. Returns :class:`aiogram.types.bot_name.BotName` on success.
@@ -4399,9 +4386,9 @@ class Bot:
async def set_my_name(
self,
- name: Optional[str] = None,
- language_code: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ name: str | None = None,
+ language_code: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the bot's name. Returns :code:`True` on success.
@@ -4423,7 +4410,7 @@ class Bot:
async def unpin_all_general_forum_topic_messages(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.
@@ -4445,12 +4432,12 @@ class Bot:
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_ids: list[int],
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[bool] = None,
- remove_caption: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | None = None,
+ remove_caption: bool | None = None,
+ request_timeout: int | None = None,
) -> list[MessageId]:
"""
Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_messages.ForwardMessages`, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned.
@@ -4460,7 +4447,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param from_chat_id: Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)
:param message_ids: A JSON-serialized list of 1-100 identifiers of messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order.
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
:param disable_notification: Sends the messages `silently `_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent messages from forwarding and saving
@@ -4485,7 +4472,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_ids: list[int],
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns :code:`True` on success.
@@ -4509,11 +4496,11 @@ class Bot:
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_ids: list[int],
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | None = None,
+ request_timeout: int | None = None,
) -> list[MessageId]:
"""
Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned.
@@ -4523,7 +4510,7 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param from_chat_id: Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)
:param message_ids: A JSON-serialized list of 1-100 identifiers of messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order.
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat
:param disable_notification: Sends the messages `silently `_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the forwarded messages from forwarding and saving
@@ -4546,7 +4533,7 @@ class Bot:
self,
chat_id: ChatIdUnion,
user_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> UserChatBoosts:
"""
Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a :class:`aiogram.types.user_chat_boosts.UserChatBoosts` object.
@@ -4569,9 +4556,9 @@ class Bot:
self,
chat_id: ChatIdUnion,
message_id: int,
- reaction: Optional[list[ReactionTypeUnion]] = None,
- is_big: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ reaction: list[ReactionTypeUnion] | None = None,
+ is_big: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success.
@@ -4597,7 +4584,7 @@ class Bot:
async def get_business_connection(
self,
business_connection_id: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> BusinessConnection:
"""
Use this method to get information about the connection of the bot with a business account. Returns a :class:`aiogram.types.business_connection.BusinessConnection` object on success.
@@ -4620,7 +4607,7 @@ class Bot:
name: str,
old_sticker: str,
sticker: InputSticker,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling :class:`aiogram.methods.delete_sticker_from_set.DeleteStickerFromSet`, then :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, then :class:`aiogram.methods.set_sticker_position_in_set.SetStickerPositionInSet`. Returns :code:`True` on success.
@@ -4647,7 +4634,7 @@ class Bot:
self,
user_id: int,
telegram_payment_charge_id: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Refunds a successful payment in `Telegram Stars `_. Returns :code:`True` on success.
@@ -4668,9 +4655,9 @@ class Bot:
async def get_star_transactions(
self,
- offset: Optional[int] = None,
- limit: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ offset: int | None = None,
+ limit: int | None = None,
+ request_timeout: int | None = None,
) -> StarTransactions:
"""
Returns the bot's Telegram Star transactions in chronological order. On success, returns a :class:`aiogram.types.star_transactions.StarTransactions` object.
@@ -4694,21 +4681,21 @@ class Bot:
chat_id: ChatIdUnion,
star_count: int,
media: list[InputPaidMediaUnion],
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- payload: Optional[str] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[str] = None,
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[bool] = None,
- allow_paid_broadcast: Optional[bool] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- request_timeout: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ payload: str | None = None,
+ caption: str | None = None,
+ parse_mode: str | None = None,
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | None = None,
+ allow_paid_broadcast: bool | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send paid media. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -4716,10 +4703,10 @@ class Bot:
Source: https://core.telegram.org/bots/api#sendpaidmedia
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.
- :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-10000
+ :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-25000
:param media: A JSON-serialized array describing the media to be sent; up to 10 items
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
- :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
:param payload: Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes.
:param caption: Media caption, 0-1024 characters after entities parsing
@@ -4762,8 +4749,8 @@ class Bot:
chat_id: ChatIdUnion,
subscription_period: DateTimeUnion,
subscription_price: int,
- name: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ name: str | None = None,
+ request_timeout: int | None = None,
) -> ChatInviteLink:
"""
Use this method to create a `subscription invite link `_ for a channel chat. The bot must have the *can_invite_users* administrator rights. The link can be edited using the method :class:`aiogram.methods.edit_chat_subscription_invite_link.EditChatSubscriptionInviteLink` or revoked using the method :class:`aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink`. Returns the new invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
@@ -4790,8 +4777,8 @@ class Bot:
self,
chat_id: ChatIdUnion,
invite_link: str,
- name: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ name: str | None = None,
+ request_timeout: int | None = None,
) -> ChatInviteLink:
"""
Use this method to edit a subscription invite link created by the bot. The bot must have the *can_invite_users* administrator rights. Returns the edited invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
@@ -4817,7 +4804,7 @@ class Bot:
user_id: int,
telegram_payment_charge_id: str,
is_canceled: bool,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns :code:`True` on success.
@@ -4840,7 +4827,7 @@ class Bot:
async def get_available_gifts(
self,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> Gifts:
"""
Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object.
@@ -4858,11 +4845,11 @@ class Bot:
self,
user_id: int,
result: InlineQueryResultUnion,
- allow_user_chats: Optional[bool] = None,
- allow_bot_chats: Optional[bool] = None,
- allow_group_chats: Optional[bool] = None,
- allow_channel_chats: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ allow_user_chats: bool | None = None,
+ allow_bot_chats: bool | None = None,
+ allow_group_chats: bool | None = None,
+ allow_channel_chats: bool | None = None,
+ request_timeout: int | None = None,
) -> PreparedInlineMessage:
"""
Stores a message that can be sent by a user of a Mini App. Returns a :class:`aiogram.types.prepared_inline_message.PreparedInlineMessage` object.
@@ -4892,20 +4879,20 @@ class Bot:
async def send_gift(
self,
gift_id: str,
- user_id: Optional[int] = None,
- chat_id: Optional[ChatIdUnion] = None,
- pay_for_upgrade: Optional[bool] = None,
- text: Optional[str] = None,
- text_parse_mode: Optional[str] = None,
- text_entities: Optional[list[MessageEntity]] = None,
- request_timeout: Optional[int] = None,
+ user_id: int | None = None,
+ chat_id: ChatIdUnion | None = None,
+ pay_for_upgrade: bool | None = None,
+ text: str | None = None,
+ text_parse_mode: str | None = None,
+ text_entities: list[MessageEntity] | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#sendgift
- :param gift_id: Identifier of the gift
+ :param gift_id: Identifier of the gift; limited gifts can't be sent to channel chats
:param user_id: Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift.
:param chat_id: Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift.
:param pay_for_upgrade: Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
@@ -4930,9 +4917,9 @@ class Bot:
async def set_user_emoji_status(
self,
user_id: int,
- emoji_status_custom_emoji_id: Optional[str] = None,
- emoji_status_expiration_date: Optional[DateTimeUnion] = None,
- request_timeout: Optional[int] = None,
+ emoji_status_custom_emoji_id: str | None = None,
+ emoji_status_expiration_date: DateTimeUnion | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method `requestEmojiStatusAccess `_. Returns :code:`True` on success.
@@ -4956,7 +4943,7 @@ class Bot:
async def remove_chat_verification(
self,
chat_id: ChatIdUnion,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Removes verification from a chat that is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success.
@@ -4976,7 +4963,7 @@ class Bot:
async def remove_user_verification(
self,
user_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Removes verification from a user who is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success.
@@ -4996,8 +4983,8 @@ class Bot:
async def verify_chat(
self,
chat_id: ChatIdUnion,
- custom_description: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ custom_description: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Verifies a chat `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success.
@@ -5019,8 +5006,8 @@ class Bot:
async def verify_user(
self,
user_id: int,
- custom_description: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ custom_description: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Verifies a user `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success.
@@ -5043,7 +5030,7 @@ class Bot:
self,
business_connection_id: str,
owned_gift_id: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Converts a given regular gift to Telegram Stars. Requires the *can_convert_gifts_to_stars* business bot right. Returns :code:`True` on success.
@@ -5066,7 +5053,7 @@ class Bot:
self,
business_connection_id: str,
message_ids: list[int],
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Delete messages on behalf of a business account. Requires the *can_delete_sent_messages* business bot right to delete messages sent by the bot itself, or the *can_delete_all_messages* business bot right to delete any message. Returns :code:`True` on success.
@@ -5089,7 +5076,7 @@ class Bot:
self,
business_connection_id: str,
story_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Deletes a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :code:`True` on success.
@@ -5113,11 +5100,11 @@ class Bot:
business_connection_id: str,
story_id: int,
content: InputStoryContentUnion,
- caption: Optional[str] = None,
- parse_mode: Optional[str] = None,
- caption_entities: Optional[list[MessageEntity]] = None,
- areas: Optional[list[StoryArea]] = None,
- request_timeout: Optional[int] = None,
+ caption: str | None = None,
+ parse_mode: str | None = None,
+ caption_entities: list[MessageEntity] | None = None,
+ areas: list[StoryArea] | None = None,
+ request_timeout: int | None = None,
) -> Story:
"""
Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.
@@ -5149,15 +5136,18 @@ class Bot:
async def get_business_account_gifts(
self,
business_connection_id: str,
- exclude_unsaved: Optional[bool] = None,
- exclude_saved: Optional[bool] = None,
- exclude_unlimited: Optional[bool] = None,
- exclude_limited: Optional[bool] = None,
- exclude_unique: Optional[bool] = None,
- sort_by_price: Optional[bool] = None,
- offset: Optional[str] = None,
- limit: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ exclude_unsaved: bool | None = None,
+ exclude_saved: bool | None = None,
+ exclude_unlimited: bool | None = None,
+ exclude_limited_upgradable: bool | None = None,
+ exclude_limited_non_upgradable: bool | None = None,
+ exclude_unique: bool | None = None,
+ exclude_from_blockchain: bool | None = None,
+ sort_by_price: bool | None = None,
+ offset: str | None = None,
+ limit: int | None = None,
+ exclude_limited: bool | None = None,
+ request_timeout: int | None = None,
) -> OwnedGifts:
"""
Returns the gifts received and owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
@@ -5168,11 +5158,14 @@ class Bot:
:param exclude_unsaved: Pass :code:`True` to exclude gifts that aren't saved to the account's profile page
:param exclude_saved: Pass :code:`True` to exclude gifts that are saved to the account's profile page
:param exclude_unlimited: Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times
- :param exclude_limited: Pass :code:`True` to exclude gifts that can be purchased a limited number of times
+ :param exclude_limited_upgradable: Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
+ :param exclude_limited_non_upgradable: Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
:param exclude_unique: Pass :code:`True` to exclude unique gifts
+ :param exclude_from_blockchain: Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
:param sort_by_price: Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination.
:param offset: Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
:param limit: The maximum number of gifts to be returned; 1-100. Defaults to 100
+ :param exclude_limited: Pass :code:`True` to exclude gifts that can be purchased a limited number of times
:param request_timeout: Request timeout
:return: Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
"""
@@ -5182,18 +5175,21 @@ class Bot:
exclude_unsaved=exclude_unsaved,
exclude_saved=exclude_saved,
exclude_unlimited=exclude_unlimited,
- exclude_limited=exclude_limited,
+ exclude_limited_upgradable=exclude_limited_upgradable,
+ exclude_limited_non_upgradable=exclude_limited_non_upgradable,
exclude_unique=exclude_unique,
+ exclude_from_blockchain=exclude_from_blockchain,
sort_by_price=sort_by_price,
offset=offset,
limit=limit,
+ exclude_limited=exclude_limited,
)
return await self(call, request_timeout=request_timeout)
async def get_business_account_star_balance(
self,
business_connection_id: str,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> StarAmount:
"""
Returns the amount of Telegram Stars owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.star_amount.StarAmount` on success.
@@ -5215,10 +5211,10 @@ class Bot:
user_id: int,
month_count: int,
star_count: int,
- text: Optional[str] = None,
- text_parse_mode: Optional[str] = None,
- text_entities: Optional[list[MessageEntity]] = None,
- request_timeout: Optional[int] = None,
+ text: str | None = None,
+ text_parse_mode: str | None = None,
+ text_entities: list[MessageEntity] | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Gifts a Telegram Premium subscription to the given user. Returns :code:`True` on success.
@@ -5250,13 +5246,13 @@ class Bot:
business_connection_id: str,
content: InputStoryContentUnion,
active_period: int,
- caption: Optional[str] = None,
- parse_mode: Optional[str] = None,
- caption_entities: Optional[list[MessageEntity]] = None,
- areas: Optional[list[StoryArea]] = None,
- post_to_chat_page: Optional[bool] = None,
- protect_content: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ caption: str | None = None,
+ parse_mode: str | None = None,
+ caption_entities: list[MessageEntity] | None = None,
+ areas: list[StoryArea] | None = None,
+ post_to_chat_page: bool | None = None,
+ protect_content: bool | None = None,
+ request_timeout: int | None = None,
) -> Story:
"""
Posts a story on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.
@@ -5294,7 +5290,7 @@ class Bot:
business_connection_id: str,
chat_id: int,
message_id: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Marks incoming message as read on behalf of a business account. Requires the *can_read_messages* business bot right. Returns :code:`True` on success.
@@ -5318,8 +5314,8 @@ class Bot:
async def remove_business_account_profile_photo(
self,
business_connection_id: str,
- is_public: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ is_public: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Removes the current profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.
@@ -5341,8 +5337,8 @@ class Bot:
async def set_business_account_bio(
self,
business_connection_id: str,
- bio: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ bio: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Changes the bio of a managed business account. Requires the *can_change_bio* business bot right. Returns :code:`True` on success.
@@ -5366,7 +5362,7 @@ class Bot:
business_connection_id: str,
show_gift_button: bool,
accepted_gift_types: AcceptedGiftTypes,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can_change_gift_settings* business bot right. Returns :code:`True` on success.
@@ -5391,8 +5387,8 @@ class Bot:
self,
business_connection_id: str,
first_name: str,
- last_name: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ last_name: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Changes the first and last name of a managed business account. Requires the *can_change_name* business bot right. Returns :code:`True` on success.
@@ -5417,8 +5413,8 @@ class Bot:
self,
business_connection_id: str,
photo: InputProfilePhotoUnion,
- is_public: Optional[bool] = None,
- request_timeout: Optional[int] = None,
+ is_public: bool | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Changes the profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.
@@ -5442,8 +5438,8 @@ class Bot:
async def set_business_account_username(
self,
business_connection_id: str,
- username: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ username: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Changes the username of a managed business account. Requires the *can_change_username* business bot right. Returns :code:`True` on success.
@@ -5466,7 +5462,7 @@ class Bot:
self,
business_connection_id: str,
star_count: int,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Transfers Telegram Stars from the business account balance to the bot's balance. Requires the *can_transfer_stars* business bot right. Returns :code:`True` on success.
@@ -5490,8 +5486,8 @@ class Bot:
business_connection_id: str,
owned_gift_id: str,
new_owner_chat_id: int,
- star_count: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ star_count: int | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Transfers an owned unique gift to another user. Requires the *can_transfer_and_upgrade_gifts* business bot right. Requires *can_transfer_stars* business bot right if the transfer is paid. Returns :code:`True` on success.
@@ -5518,9 +5514,9 @@ class Bot:
self,
business_connection_id: str,
owned_gift_id: str,
- keep_original_details: Optional[bool] = None,
- star_count: Optional[int] = None,
- request_timeout: Optional[int] = None,
+ keep_original_details: bool | None = None,
+ star_count: int | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Upgrades a given regular gift to a unique gift. Requires the *can_transfer_and_upgrade_gifts* business bot right. Additionally requires the *can_transfer_stars* business bot right if the upgrade is paid. Returns :code:`True` on success.
@@ -5549,8 +5545,8 @@ class Bot:
chat_id: int,
message_id: int,
checklist: InputChecklist,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- request_timeout: Optional[int] = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to edit a checklist on behalf of a connected business account. On success, the edited :class:`aiogram.types.message.Message` is returned.
@@ -5577,7 +5573,7 @@ class Bot:
async def get_my_star_balance(
self,
- request_timeout: Optional[int] = None,
+ request_timeout: int | None = None,
) -> StarAmount:
"""
A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a :class:`aiogram.types.star_amount.StarAmount` object.
@@ -5596,12 +5592,12 @@ class Bot:
business_connection_id: str,
chat_id: int,
checklist: InputChecklist,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- request_timeout: Optional[int] = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | None = None,
+ message_effect_id: str | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ request_timeout: int | None = None,
) -> Message:
"""
Use this method to send a checklist on behalf of a connected business account. On success, the sent :class:`aiogram.types.message.Message` is returned.
@@ -5636,8 +5632,8 @@ class Bot:
self,
chat_id: int,
message_id: int,
- send_date: Optional[DateTimeUnion] = None,
- request_timeout: Optional[int] = None,
+ send_date: DateTimeUnion | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns :code:`True` on success.
@@ -5662,8 +5658,8 @@ class Bot:
self,
chat_id: int,
message_id: int,
- comment: Optional[str] = None,
- request_timeout: Optional[int] = None,
+ comment: str | None = None,
+ request_timeout: int | None = None,
) -> bool:
"""
Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns :code:`True` on success.
@@ -5683,3 +5679,167 @@ class Bot:
comment=comment,
)
return await self(call, request_timeout=request_timeout)
+
+ async def get_chat_gifts(
+ self,
+ chat_id: ChatIdUnion,
+ exclude_unsaved: bool | None = None,
+ exclude_saved: bool | None = None,
+ exclude_unlimited: bool | None = None,
+ exclude_limited_upgradable: bool | None = None,
+ exclude_limited_non_upgradable: bool | None = None,
+ exclude_from_blockchain: bool | None = None,
+ exclude_unique: bool | None = None,
+ sort_by_price: bool | None = None,
+ offset: str | None = None,
+ limit: int | None = None,
+ request_timeout: int | None = None,
+ ) -> OwnedGifts:
+ """
+ Returns the gifts owned by a chat. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
+
+ Source: https://core.telegram.org/bots/api#getchatgifts
+
+ :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
+ :param exclude_unsaved: Pass :code:`True` to exclude gifts that aren't saved to the chat's profile page. Always :code:`True`, unless the bot has the *can_post_messages* administrator right in the channel.
+ :param exclude_saved: Pass :code:`True` to exclude gifts that are saved to the chat's profile page. Always :code:`False`, unless the bot has the *can_post_messages* administrator right in the channel.
+ :param exclude_unlimited: Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times
+ :param exclude_limited_upgradable: Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
+ :param exclude_limited_non_upgradable: Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
+ :param exclude_from_blockchain: Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
+ :param exclude_unique: Pass :code:`True` to exclude unique gifts
+ :param sort_by_price: Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination.
+ :param offset: Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
+ :param limit: The maximum number of gifts to be returned; 1-100. Defaults to 100
+ :param request_timeout: Request timeout
+ :return: Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
+ """
+
+ call = GetChatGifts(
+ chat_id=chat_id,
+ exclude_unsaved=exclude_unsaved,
+ exclude_saved=exclude_saved,
+ exclude_unlimited=exclude_unlimited,
+ exclude_limited_upgradable=exclude_limited_upgradable,
+ exclude_limited_non_upgradable=exclude_limited_non_upgradable,
+ exclude_from_blockchain=exclude_from_blockchain,
+ exclude_unique=exclude_unique,
+ sort_by_price=sort_by_price,
+ offset=offset,
+ limit=limit,
+ )
+ return await self(call, request_timeout=request_timeout)
+
+ async def get_user_gifts(
+ self,
+ user_id: int,
+ exclude_unlimited: bool | None = None,
+ exclude_limited_upgradable: bool | None = None,
+ exclude_limited_non_upgradable: bool | None = None,
+ exclude_from_blockchain: bool | None = None,
+ exclude_unique: bool | None = None,
+ sort_by_price: bool | None = None,
+ offset: str | None = None,
+ limit: int | None = None,
+ request_timeout: int | None = None,
+ ) -> OwnedGifts:
+ """
+ Returns the gifts owned and hosted by a user. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
+
+ Source: https://core.telegram.org/bots/api#getusergifts
+
+ :param user_id: Unique identifier of the user
+ :param exclude_unlimited: Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times
+ :param exclude_limited_upgradable: Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
+ :param exclude_limited_non_upgradable: Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
+ :param exclude_from_blockchain: Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
+ :param exclude_unique: Pass :code:`True` to exclude unique gifts
+ :param sort_by_price: Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination.
+ :param offset: Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
+ :param limit: The maximum number of gifts to be returned; 1-100. Defaults to 100
+ :param request_timeout: Request timeout
+ :return: Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
+ """
+
+ call = GetUserGifts(
+ user_id=user_id,
+ exclude_unlimited=exclude_unlimited,
+ exclude_limited_upgradable=exclude_limited_upgradable,
+ exclude_limited_non_upgradable=exclude_limited_non_upgradable,
+ exclude_from_blockchain=exclude_from_blockchain,
+ exclude_unique=exclude_unique,
+ sort_by_price=sort_by_price,
+ offset=offset,
+ limit=limit,
+ )
+ return await self(call, request_timeout=request_timeout)
+
+ async def repost_story(
+ self,
+ business_connection_id: str,
+ from_chat_id: int,
+ from_story_id: int,
+ active_period: int,
+ post_to_chat_page: bool | None = None,
+ protect_content: bool | None = None,
+ request_timeout: int | None = None,
+ ) -> Story:
+ """
+ Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the *can_manage_stories* business bot right for both business accounts. Returns :class:`aiogram.types.story.Story` on success.
+
+ Source: https://core.telegram.org/bots/api#repoststory
+
+ :param business_connection_id: Unique identifier of the business connection
+ :param from_chat_id: Unique identifier of the chat which posted the story that should be reposted
+ :param from_story_id: Unique identifier of the story that should be reposted
+ :param active_period: Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`
+ :param post_to_chat_page: Pass :code:`True` to keep the story accessible after it expires
+ :param protect_content: Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting
+ :param request_timeout: Request timeout
+ :return: Returns :class:`aiogram.types.story.Story` on success.
+ """
+
+ call = RepostStory(
+ business_connection_id=business_connection_id,
+ from_chat_id=from_chat_id,
+ from_story_id=from_story_id,
+ active_period=active_period,
+ post_to_chat_page=post_to_chat_page,
+ protect_content=protect_content,
+ )
+ return await self(call, request_timeout=request_timeout)
+
+ async def send_message_draft(
+ self,
+ chat_id: int,
+ draft_id: int,
+ text: str,
+ message_thread_id: int | None = None,
+ parse_mode: str | None = None,
+ entities: list[MessageEntity] | None = None,
+ request_timeout: int | None = None,
+ ) -> bool:
+ """
+ Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#sendmessagedraft
+
+ :param chat_id: Unique identifier for the target private chat
+ :param draft_id: Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated
+ :param text: Text of the message to be sent, 1-4096 characters after entities parsing
+ :param message_thread_id: Unique identifier for the target message thread
+ :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details.
+ :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*
+ :param request_timeout: Request timeout
+ :return: Returns :code:`True` on success.
+ """
+
+ call = SendMessageDraft(
+ chat_id=chat_id,
+ draft_id=draft_id,
+ text=text,
+ message_thread_id=message_thread_id,
+ parse_mode=parse_mode,
+ entities=entities,
+ )
+ return await self(call, request_timeout=request_timeout)
diff --git a/aiogram/client/context_controller.py b/aiogram/client/context_controller.py
index 18788e49..7f739fc3 100644
--- a/aiogram/client/context_controller.py
+++ b/aiogram/client/context_controller.py
@@ -1,4 +1,6 @@
-from typing import TYPE_CHECKING, Any, Optional
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any
from pydantic import BaseModel, PrivateAttr
from typing_extensions import Self
@@ -8,12 +10,12 @@ if TYPE_CHECKING:
class BotContextController(BaseModel):
- _bot: Optional["Bot"] = PrivateAttr()
+ _bot: Bot | None = PrivateAttr()
def model_post_init(self, __context: Any) -> None: # noqa: PYI063
self._bot = __context.get("bot") if __context else None
- def as_(self, bot: Optional["Bot"]) -> Self:
+ def as_(self, bot: Bot | None) -> Self:
"""
Bind object to a bot instance.
@@ -24,7 +26,7 @@ class BotContextController(BaseModel):
return self
@property
- def bot(self) -> Optional["Bot"]:
+ def bot(self) -> Bot | None:
"""
Get bot instance.
diff --git a/aiogram/dispatcher/dispatcher.py b/aiogram/dispatcher/dispatcher.py
index 807c0e21..5aff6a01 100644
--- a/aiogram/dispatcher/dispatcher.py
+++ b/aiogram/dispatcher/dispatcher.py
@@ -679,6 +679,6 @@ class Dispatcher(Router):
if sys.version_info >= (3, 11):
with asyncio.Runner(loop_factory=uvloop.new_event_loop) as runner:
return runner.run(coro)
- else:
+ else: # pragma: no cover
uvloop.install()
return asyncio.run(coro)
diff --git a/aiogram/dispatcher/event/handler.py b/aiogram/dispatcher/event/handler.py
index 7aeaab96..204a548d 100644
--- a/aiogram/dispatcher/event/handler.py
+++ b/aiogram/dispatcher/event/handler.py
@@ -1,5 +1,6 @@
import asyncio
import inspect
+import sys
import warnings
from collections.abc import Callable
from dataclasses import dataclass, field
@@ -16,6 +17,12 @@ from aiogram.utils.warnings import Recommendation
CallbackType = Callable[..., Any]
+_ACCEPTED_PARAM_KINDS = {
+ inspect.Parameter.POSITIONAL_ONLY,
+ inspect.Parameter.POSITIONAL_OR_KEYWORD,
+ inspect.Parameter.KEYWORD_ONLY,
+}
+
@dataclass
class CallableObject:
@@ -27,9 +34,30 @@ class CallableObject:
def __post_init__(self) -> None:
callback = inspect.unwrap(self.callback)
self.awaitable = inspect.isawaitable(callback) or inspect.iscoroutinefunction(callback)
- spec = inspect.getfullargspec(callback)
- self.params = {*spec.args, *spec.kwonlyargs}
- self.varkw = spec.varkw is not None
+
+ kwargs: dict[str, Any] = {}
+ if sys.version_info >= (3, 14):
+ import annotationlib
+
+ kwargs["annotation_format"] = annotationlib.Format.FORWARDREF
+
+ try:
+ signature = inspect.signature(callback, **kwargs)
+ except (ValueError, TypeError): # pragma: no cover
+ self.params = set()
+ self.varkw = False
+ return
+
+ params: set[str] = set()
+ varkw: bool = False
+
+ for p in signature.parameters.values():
+ if p.kind in _ACCEPTED_PARAM_KINDS:
+ params.add(p.name)
+ elif p.kind == inspect.Parameter.VAR_KEYWORD:
+ varkw = True
+ self.params = params
+ self.varkw = varkw
def _prepare_kwargs(self, kwargs: dict[str, Any]) -> dict[str, Any]:
if self.varkw:
diff --git a/aiogram/dispatcher/flags.py b/aiogram/dispatcher/flags.py
index ad5a886b..f7b6a76d 100644
--- a/aiogram/dispatcher/flags.py
+++ b/aiogram/dispatcher/flags.py
@@ -1,6 +1,8 @@
+from __future__ import annotations
+
from collections.abc import Callable
from dataclasses import dataclass
-from typing import TYPE_CHECKING, Any, Union, cast, overload
+from typing import TYPE_CHECKING, Any, cast, overload
from magic_filter import AttrDict, MagicFilter
@@ -42,7 +44,7 @@ class FlagDecorator:
self,
value: Any | None = None,
**kwargs: Any,
- ) -> Union[Callable[..., Any], "FlagDecorator"]:
+ ) -> Callable[..., Any] | FlagDecorator:
if value and kwargs:
msg = "The arguments `value` and **kwargs can not be used together"
raise ValueError(msg)
@@ -86,7 +88,7 @@ def extract_flags_from_object(obj: Any) -> dict[str, Any]:
return cast(dict[str, Any], obj.aiogram_flag)
-def extract_flags(handler: Union["HandlerObject", dict[str, Any]]) -> dict[str, Any]:
+def extract_flags(handler: HandlerObject | dict[str, Any]) -> dict[str, Any]:
"""
Extract flags from handler or middleware context data
@@ -101,7 +103,7 @@ def extract_flags(handler: Union["HandlerObject", dict[str, Any]]) -> dict[str,
def get_flag(
- handler: Union["HandlerObject", dict[str, Any]],
+ handler: HandlerObject | dict[str, Any],
name: str,
*,
default: Any | None = None,
@@ -118,7 +120,7 @@ def get_flag(
return flags.get(name, default)
-def check_flags(handler: Union["HandlerObject", dict[str, Any]], magic: MagicFilter) -> Any:
+def check_flags(handler: HandlerObject | dict[str, Any], magic: MagicFilter) -> Any:
"""
Check flags via magic filter
diff --git a/aiogram/enums/content_type.py b/aiogram/enums/content_type.py
index a08919d5..0c1c4b29 100644
--- a/aiogram/enums/content_type.py
+++ b/aiogram/enums/content_type.py
@@ -45,6 +45,7 @@ class ContentType(str, Enum):
CHAT_SHARED = "chat_shared"
GIFT = "gift"
UNIQUE_GIFT = "unique_gift"
+ GIFT_UPGRADE_SENT = "gift_upgrade_sent"
CONNECTED_WEBSITE = "connected_website"
WRITE_ACCESS_ALLOWED = "write_access_allowed"
PASSPORT_DATA = "passport_data"
diff --git a/aiogram/exceptions.py b/aiogram/exceptions.py
index 2b8efcbb..47feea5f 100644
--- a/aiogram/exceptions.py
+++ b/aiogram/exceptions.py
@@ -1,4 +1,4 @@
-from typing import Any, Optional
+from typing import Any
from aiogram.methods import TelegramMethod
from aiogram.methods.base import TelegramType
diff --git a/aiogram/filters/base.py b/aiogram/filters/base.py
index 34c88115..e0445cb4 100644
--- a/aiogram/filters/base.py
+++ b/aiogram/filters/base.py
@@ -27,7 +27,7 @@ class Filter(ABC): # noqa: B024
Accepts incoming event and should return boolean or dict.
- :return: :class:`bool` or :class:`Dict[str, Any]`
+ :return: :class:`bool` or :class:`dict[str, Any]`
"""
def __invert__(self) -> "_InvertFilter":
diff --git a/aiogram/filters/chat_member_updated.py b/aiogram/filters/chat_member_updated.py
index 08538f55..dc86fe21 100644
--- a/aiogram/filters/chat_member_updated.py
+++ b/aiogram/filters/chat_member_updated.py
@@ -1,4 +1,6 @@
-from typing import Any, TypeVar, Union
+from __future__ import annotations
+
+from typing import Any, TypeVar
from typing_extensions import Self
@@ -34,7 +36,7 @@ class _MemberStatusMarker:
def __or__(
self,
- other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
+ other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusGroupMarker":
if isinstance(other, _MemberStatusMarker):
return _MemberStatusGroupMarker(self, other)
@@ -50,7 +52,7 @@ class _MemberStatusMarker:
def __rshift__(
self,
- other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
+ other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusTransition":
old = _MemberStatusGroupMarker(self)
if isinstance(other, _MemberStatusMarker):
@@ -65,7 +67,7 @@ class _MemberStatusMarker:
def __lshift__(
self,
- other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
+ other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusTransition":
new = _MemberStatusGroupMarker(self)
if isinstance(other, _MemberStatusMarker):
@@ -101,7 +103,7 @@ class _MemberStatusGroupMarker:
def __or__(
self,
- other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
+ other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> Self:
if isinstance(other, _MemberStatusMarker):
return type(self)(*self.statuses, other)
@@ -115,7 +117,7 @@ class _MemberStatusGroupMarker:
def __rshift__(
self,
- other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
+ other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusTransition":
if isinstance(other, _MemberStatusMarker):
return _MemberStatusTransition(old=self, new=_MemberStatusGroupMarker(other))
@@ -129,7 +131,7 @@ class _MemberStatusGroupMarker:
def __lshift__(
self,
- other: Union["_MemberStatusMarker", "_MemberStatusGroupMarker"],
+ other: _MemberStatusMarker | _MemberStatusGroupMarker,
) -> "_MemberStatusTransition":
if isinstance(other, _MemberStatusMarker):
return _MemberStatusTransition(old=_MemberStatusGroupMarker(other), new=self)
diff --git a/aiogram/filters/command.py b/aiogram/filters/command.py
index cce14491..cab50969 100644
--- a/aiogram/filters/command.py
+++ b/aiogram/filters/command.py
@@ -65,8 +65,7 @@ class Command(Filter):
if not isinstance(commands, Iterable):
msg = (
- "Command filter only supports str, re.Pattern, BotCommand object"
- " or their Iterable"
+ "Command filter only supports str, re.Pattern, BotCommand object or their Iterable"
)
raise ValueError(msg)
diff --git a/aiogram/handlers/callback_query.py b/aiogram/handlers/callback_query.py
index acea76d9..a4be9ff3 100644
--- a/aiogram/handlers/callback_query.py
+++ b/aiogram/handlers/callback_query.py
@@ -1,5 +1,4 @@
from abc import ABC
-from typing import Optional
from aiogram.handlers import BaseHandler
from aiogram.types import CallbackQuery, MaybeInaccessibleMessage, User
diff --git a/aiogram/handlers/message.py b/aiogram/handlers/message.py
index 8660dde9..b726b908 100644
--- a/aiogram/handlers/message.py
+++ b/aiogram/handlers/message.py
@@ -1,5 +1,5 @@
from abc import ABC
-from typing import Optional, cast
+from typing import cast
from aiogram.filters import CommandObject
from aiogram.handlers.base import BaseHandler, BaseHandlerMixin
diff --git a/aiogram/methods/__init__.py b/aiogram/methods/__init__.py
index 766c18e8..9c1ebccd 100644
--- a/aiogram/methods/__init__.py
+++ b/aiogram/methods/__init__.py
@@ -54,6 +54,7 @@ from .get_business_account_star_balance import GetBusinessAccountStarBalance
from .get_business_connection import GetBusinessConnection
from .get_chat import GetChat
from .get_chat_administrators import GetChatAdministrators
+from .get_chat_gifts import GetChatGifts
from .get_chat_member import GetChatMember
from .get_chat_member_count import GetChatMemberCount
from .get_chat_menu_button import GetChatMenuButton
@@ -72,6 +73,7 @@ from .get_star_transactions import GetStarTransactions
from .get_sticker_set import GetStickerSet
from .get_updates import GetUpdates
from .get_user_chat_boosts import GetUserChatBoosts
+from .get_user_gifts import GetUserGifts
from .get_user_profile_photos import GetUserProfilePhotos
from .get_webhook_info import GetWebhookInfo
from .gift_premium_subscription import GiftPremiumSubscription
@@ -89,6 +91,7 @@ from .remove_user_verification import RemoveUserVerification
from .reopen_forum_topic import ReopenForumTopic
from .reopen_general_forum_topic import ReopenGeneralForumTopic
from .replace_sticker_in_set import ReplaceStickerInSet
+from .repost_story import RepostStory
from .restrict_chat_member import RestrictChatMember
from .revoke_chat_invite_link import RevokeChatInviteLink
from .save_prepared_inline_message import SavePreparedInlineMessage
@@ -105,6 +108,7 @@ from .send_invoice import SendInvoice
from .send_location import SendLocation
from .send_media_group import SendMediaGroup
from .send_message import SendMessage
+from .send_message_draft import SendMessageDraft
from .send_paid_media import SendPaidMedia
from .send_photo import SendPhoto
from .send_poll import SendPoll
@@ -214,6 +218,7 @@ __all__ = (
"GetBusinessConnection",
"GetChat",
"GetChatAdministrators",
+ "GetChatGifts",
"GetChatMember",
"GetChatMemberCount",
"GetChatMenuButton",
@@ -232,6 +237,7 @@ __all__ = (
"GetStickerSet",
"GetUpdates",
"GetUserChatBoosts",
+ "GetUserGifts",
"GetUserProfilePhotos",
"GetWebhookInfo",
"GiftPremiumSubscription",
@@ -249,6 +255,7 @@ __all__ = (
"ReopenForumTopic",
"ReopenGeneralForumTopic",
"ReplaceStickerInSet",
+ "RepostStory",
"Request",
"Response",
"RestrictChatMember",
@@ -267,6 +274,7 @@ __all__ = (
"SendLocation",
"SendMediaGroup",
"SendMessage",
+ "SendMessageDraft",
"SendPaidMedia",
"SendPhoto",
"SendPoll",
diff --git a/aiogram/methods/answer_callback_query.py b/aiogram/methods/answer_callback_query.py
index 15ed1bf5..822354ec 100644
--- a/aiogram/methods/answer_callback_query.py
+++ b/aiogram/methods/answer_callback_query.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@@ -19,13 +19,13 @@ class AnswerCallbackQuery(TelegramMethod[bool]):
callback_query_id: str
"""Unique identifier for the query to be answered"""
- text: Optional[str] = None
+ text: str | None = None
"""Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters"""
- show_alert: Optional[bool] = None
+ show_alert: bool | None = None
"""If :code:`True`, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to *false*."""
- url: Optional[str] = None
+ url: str | None = None
"""URL that will be opened by the user's client. If you have created a :class:`aiogram.types.game.Game` and accepted the conditions via `@BotFather `_, specify the URL that opens your game - note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton `_ *callback_game* button."""
- cache_time: Optional[int] = None
+ cache_time: int | None = None
"""The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0."""
if TYPE_CHECKING:
@@ -36,10 +36,10 @@ class AnswerCallbackQuery(TelegramMethod[bool]):
__pydantic__self__,
*,
callback_query_id: str,
- text: Optional[str] = None,
- show_alert: Optional[bool] = None,
- url: Optional[str] = None,
- cache_time: Optional[int] = None,
+ text: str | None = None,
+ show_alert: bool | None = None,
+ url: str | None = None,
+ cache_time: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/answer_inline_query.py b/aiogram/methods/answer_inline_query.py
index 28848673..7e4f7191 100644
--- a/aiogram/methods/answer_inline_query.py
+++ b/aiogram/methods/answer_inline_query.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -24,20 +24,20 @@ class AnswerInlineQuery(TelegramMethod[bool]):
"""Unique identifier for the answered query"""
results: list[InlineQueryResultUnion]
"""A JSON-serialized array of results for the inline query"""
- cache_time: Optional[int] = None
+ cache_time: int | None = None
"""The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300."""
- is_personal: Optional[bool] = None
+ is_personal: bool | None = None
"""Pass :code:`True` if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query."""
- next_offset: Optional[str] = None
+ next_offset: str | None = None
"""Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes."""
- button: Optional[InlineQueryResultsButton] = None
+ button: InlineQueryResultsButton | None = None
"""A JSON-serialized object describing a button to be shown above inline query results"""
- switch_pm_parameter: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
+ switch_pm_parameter: str | None = Field(None, json_schema_extra={"deprecated": True})
"""`Deep-linking `_ parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed.
.. deprecated:: API:6.7
https://core.telegram.org/bots/api-changelog#april-21-2023"""
- switch_pm_text: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
+ switch_pm_text: str | None = Field(None, json_schema_extra={"deprecated": True})
"""If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter *switch_pm_parameter*
.. deprecated:: API:6.7
@@ -52,12 +52,12 @@ class AnswerInlineQuery(TelegramMethod[bool]):
*,
inline_query_id: str,
results: list[InlineQueryResultUnion],
- cache_time: Optional[int] = None,
- is_personal: Optional[bool] = None,
- next_offset: Optional[str] = None,
- button: Optional[InlineQueryResultsButton] = None,
- switch_pm_parameter: Optional[str] = None,
- switch_pm_text: Optional[str] = None,
+ cache_time: int | None = None,
+ is_personal: bool | None = None,
+ next_offset: str | None = None,
+ button: InlineQueryResultsButton | None = None,
+ switch_pm_parameter: str | None = None,
+ switch_pm_text: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/answer_pre_checkout_query.py b/aiogram/methods/answer_pre_checkout_query.py
index 479d76c9..f014be3e 100644
--- a/aiogram/methods/answer_pre_checkout_query.py
+++ b/aiogram/methods/answer_pre_checkout_query.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@@ -19,7 +19,7 @@ class AnswerPreCheckoutQuery(TelegramMethod[bool]):
"""Unique identifier for the query to be answered"""
ok: bool
"""Specify :code:`True` if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use :code:`False` if there are any problems."""
- error_message: Optional[str] = None
+ error_message: str | None = None
"""Required if *ok* is :code:`False`. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user."""
if TYPE_CHECKING:
@@ -31,7 +31,7 @@ class AnswerPreCheckoutQuery(TelegramMethod[bool]):
*,
pre_checkout_query_id: str,
ok: bool,
- error_message: Optional[str] = None,
+ error_message: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/answer_shipping_query.py b/aiogram/methods/answer_shipping_query.py
index eec59864..2f5601dc 100644
--- a/aiogram/methods/answer_shipping_query.py
+++ b/aiogram/methods/answer_shipping_query.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ShippingOption
from .base import TelegramMethod
@@ -20,9 +20,9 @@ class AnswerShippingQuery(TelegramMethod[bool]):
"""Unique identifier for the query to be answered"""
ok: bool
"""Pass :code:`True` if delivery to the specified address is possible and :code:`False` if there are any problems (for example, if delivery to the specified address is not possible)"""
- shipping_options: Optional[list[ShippingOption]] = None
+ shipping_options: list[ShippingOption] | None = None
"""Required if *ok* is :code:`True`. A JSON-serialized array of available shipping options."""
- error_message: Optional[str] = None
+ error_message: str | None = None
"""Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. 'Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user."""
if TYPE_CHECKING:
@@ -34,8 +34,8 @@ class AnswerShippingQuery(TelegramMethod[bool]):
*,
shipping_query_id: str,
ok: bool,
- shipping_options: Optional[list[ShippingOption]] = None,
- error_message: Optional[str] = None,
+ shipping_options: list[ShippingOption] | None = None,
+ error_message: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/approve_suggested_post.py b/aiogram/methods/approve_suggested_post.py
index 5fd36981..dddaa0af 100644
--- a/aiogram/methods/approve_suggested_post.py
+++ b/aiogram/methods/approve_suggested_post.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import DateTimeUnion
from .base import TelegramMethod
@@ -20,7 +20,7 @@ class ApproveSuggestedPost(TelegramMethod[bool]):
"""Unique identifier for the target direct messages chat"""
message_id: int
"""Identifier of a suggested post message to approve"""
- send_date: Optional[DateTimeUnion] = None
+ send_date: DateTimeUnion | None = None
"""Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future"""
if TYPE_CHECKING:
@@ -32,7 +32,7 @@ class ApproveSuggestedPost(TelegramMethod[bool]):
*,
chat_id: int,
message_id: int,
- send_date: Optional[DateTimeUnion] = None,
+ send_date: DateTimeUnion | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/ban_chat_member.py b/aiogram/methods/ban_chat_member.py
index 57e2f532..ee728ad6 100644
--- a/aiogram/methods/ban_chat_member.py
+++ b/aiogram/methods/ban_chat_member.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, DateTimeUnion
from .base import TelegramMethod
@@ -20,9 +20,9 @@ class BanChatMember(TelegramMethod[bool]):
"""Unique identifier for the target group or username of the target supergroup or channel (in the format :code:`@channelusername`)"""
user_id: int
"""Unique identifier of the target user"""
- until_date: Optional[DateTimeUnion] = None
+ until_date: DateTimeUnion | None = 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."""
- revoke_messages: Optional[bool] = None
+ revoke_messages: bool | None = 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."""
if TYPE_CHECKING:
@@ -34,8 +34,8 @@ class BanChatMember(TelegramMethod[bool]):
*,
chat_id: ChatIdUnion,
user_id: int,
- until_date: Optional[DateTimeUnion] = None,
- revoke_messages: Optional[bool] = None,
+ until_date: DateTimeUnion | None = None,
+ revoke_messages: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/base.py b/aiogram/methods/base.py
index 36878a84..ca97dd7d 100644
--- a/aiogram/methods/base.py
+++ b/aiogram/methods/base.py
@@ -5,10 +5,8 @@ from typing import (
TYPE_CHECKING,
Any,
ClassVar,
- Dict,
Generator,
Generic,
- Optional,
TypeVar,
)
@@ -31,16 +29,16 @@ class Request(BaseModel):
method: str
- data: Dict[str, Optional[Any]]
- files: Optional[Dict[str, InputFile]]
+ data: dict[str, Any | None]
+ files: dict[str, InputFile] | None
class Response(BaseModel, Generic[TelegramType]):
ok: bool
- result: Optional[TelegramType] = None
- description: Optional[str] = None
- error_code: Optional[int] = None
- parameters: Optional[ResponseParameters] = None
+ result: TelegramType | None = None
+ description: str | None = None
+ error_code: int | None = None
+ parameters: ResponseParameters | None = None
class TelegramMethod(BotContextController, BaseModel, Generic[TelegramType], ABC):
@@ -52,7 +50,7 @@ class TelegramMethod(BotContextController, BaseModel, Generic[TelegramType], ABC
@model_validator(mode="before")
@classmethod
- def remove_unset(cls, values: Dict[str, Any]) -> Dict[str, Any]:
+ def remove_unset(cls, values: dict[str, Any]) -> dict[str, Any]:
"""
Remove UNSET before fields validation.
diff --git a/aiogram/methods/copy_message.py b/aiogram/methods/copy_message.py
index 7cab7ce9..6d840851 100644
--- a/aiogram/methods/copy_message.py
+++ b/aiogram/methods/copy_message.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -33,40 +33,40 @@ class CopyMessage(TelegramMethod[MessageId]):
"""Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)"""
message_id: int
"""Message identifier in the chat specified in *from_chat_id*"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- video_start_timestamp: Optional[DateTimeUnion] = None
+ video_start_timestamp: DateTimeUnion | None = None
"""New start timestamp for the copied video in the message"""
- caption: Optional[str] = None
+ caption: str | None = None
"""New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept"""
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the new caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode*"""
- show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media")
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media")
"""Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified."""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ message_effect_id: str | None = None
+ """Unique identifier of the message effect to be added to the message; only available when copying to private chats"""
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -82,23 +82,22 @@ class CopyMessage(TelegramMethod[MessageId]):
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_id: int,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- video_start_timestamp: Optional[DateTimeUnion] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ video_start_timestamp: DateTimeUnion | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
@@ -119,6 +118,7 @@ class CopyMessage(TelegramMethod[MessageId]):
disable_notification=disable_notification,
protect_content=protect_content,
allow_paid_broadcast=allow_paid_broadcast,
+ message_effect_id=message_effect_id,
suggested_post_parameters=suggested_post_parameters,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/copy_messages.py b/aiogram/methods/copy_messages.py
index 61215335..02afd270 100644
--- a/aiogram/methods/copy_messages.py
+++ b/aiogram/methods/copy_messages.py
@@ -1,4 +1,4 @@
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, MessageId
from .base import TelegramMethod
@@ -20,15 +20,15 @@ class CopyMessages(TelegramMethod[list[MessageId]]):
"""Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)"""
message_ids: list[int]
"""A JSON-serialized list of 1-100 identifiers of messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order."""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the messages `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[bool] = None
+ protect_content: bool | None = None
"""Protects the contents of the sent messages from forwarding and saving"""
- remove_caption: Optional[bool] = None
+ remove_caption: bool | None = None
"""Pass :code:`True` to copy the messages without their captions"""
if TYPE_CHECKING:
@@ -41,11 +41,11 @@ class CopyMessages(TelegramMethod[list[MessageId]]):
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_ids: list[int],
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[bool] = None,
- remove_caption: Optional[bool] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | None = None,
+ remove_caption: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/create_chat_invite_link.py b/aiogram/methods/create_chat_invite_link.py
index dcca1ed3..e42572ae 100644
--- a/aiogram/methods/create_chat_invite_link.py
+++ b/aiogram/methods/create_chat_invite_link.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ChatInviteLink, DateTimeUnion
from .base import TelegramMethod
@@ -18,13 +18,13 @@ class CreateChatInviteLink(TelegramMethod[ChatInviteLink]):
chat_id: ChatIdUnion
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
- name: Optional[str] = None
+ name: str | None = None
"""Invite link name; 0-32 characters"""
- expire_date: Optional[DateTimeUnion] = None
+ expire_date: DateTimeUnion | None = None
"""Point in time (Unix timestamp) when the link will expire"""
- member_limit: Optional[int] = None
+ member_limit: int | None = None
"""The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
- creates_join_request: Optional[bool] = None
+ creates_join_request: bool | None = None
""":code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified"""
if TYPE_CHECKING:
@@ -35,10 +35,10 @@ class CreateChatInviteLink(TelegramMethod[ChatInviteLink]):
__pydantic__self__,
*,
chat_id: ChatIdUnion,
- name: Optional[str] = None,
- expire_date: Optional[DateTimeUnion] = None,
- member_limit: Optional[int] = None,
- creates_join_request: Optional[bool] = None,
+ name: str | None = None,
+ expire_date: DateTimeUnion | None = None,
+ member_limit: int | None = None,
+ creates_join_request: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/create_chat_subscription_invite_link.py b/aiogram/methods/create_chat_subscription_invite_link.py
index 62327523..55ee9435 100644
--- a/aiogram/methods/create_chat_subscription_invite_link.py
+++ b/aiogram/methods/create_chat_subscription_invite_link.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ChatInviteLink, DateTimeUnion
from .base import TelegramMethod
@@ -22,7 +22,7 @@ class CreateChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
"""The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days)."""
subscription_price: int
"""The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000"""
- name: Optional[str] = None
+ name: str | None = None
"""Invite link name; 0-32 characters"""
if TYPE_CHECKING:
@@ -35,7 +35,7 @@ class CreateChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
chat_id: ChatIdUnion,
subscription_period: DateTimeUnion,
subscription_price: int,
- name: Optional[str] = None,
+ name: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/create_forum_topic.py b/aiogram/methods/create_forum_topic.py
index c88f240b..0d7940a3 100644
--- a/aiogram/methods/create_forum_topic.py
+++ b/aiogram/methods/create_forum_topic.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ForumTopic
from .base import TelegramMethod
@@ -20,9 +20,9 @@ class CreateForumTopic(TelegramMethod[ForumTopic]):
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
name: str
"""Topic name, 1-128 characters"""
- icon_color: Optional[int] = None
+ icon_color: int | None = None
"""Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)"""
- icon_custom_emoji_id: Optional[str] = None
+ icon_custom_emoji_id: str | None = None
"""Unique identifier of the custom emoji shown as the topic icon. Use :class:`aiogram.methods.get_forum_topic_icon_stickers.GetForumTopicIconStickers` to get all allowed custom emoji identifiers."""
if TYPE_CHECKING:
@@ -34,8 +34,8 @@ class CreateForumTopic(TelegramMethod[ForumTopic]):
*,
chat_id: ChatIdUnion,
name: str,
- icon_color: Optional[int] = None,
- icon_custom_emoji_id: Optional[str] = None,
+ icon_color: int | None = None,
+ icon_custom_emoji_id: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/create_invoice_link.py b/aiogram/methods/create_invoice_link.py
index 93c90a2b..d4eb3115 100644
--- a/aiogram/methods/create_invoice_link.py
+++ b/aiogram/methods/create_invoice_link.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import LabeledPrice
from .base import TelegramMethod
@@ -26,39 +26,39 @@ class CreateInvoiceLink(TelegramMethod[str]):
"""Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_."""
prices: list[LabeledPrice]
"""Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_."""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the link will be created. For payments in `Telegram Stars `_ only."""
- provider_token: Optional[str] = None
+ provider_token: str | None = None
"""Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_."""
- subscription_period: Optional[int] = None
+ subscription_period: int | None = None
"""The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars."""
- max_tip_amount: Optional[int] = None
+ max_tip_amount: int | None = None
"""The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_."""
- suggested_tip_amounts: Optional[list[int]] = None
+ suggested_tip_amounts: list[int] | None = None
"""A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*."""
- provider_data: Optional[str] = None
+ provider_data: str | None = None
"""JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider."""
- photo_url: Optional[str] = None
+ photo_url: str | None = None
"""URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service."""
- photo_size: Optional[int] = None
+ photo_size: int | None = None
"""Photo size in bytes"""
- photo_width: Optional[int] = None
+ photo_width: int | None = None
"""Photo width"""
- photo_height: Optional[int] = None
+ photo_height: int | None = None
"""Photo height"""
- need_name: Optional[bool] = None
+ need_name: bool | None = None
"""Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_."""
- need_phone_number: Optional[bool] = None
+ need_phone_number: bool | None = None
"""Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_."""
- need_email: Optional[bool] = None
+ need_email: bool | None = None
"""Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_."""
- need_shipping_address: Optional[bool] = None
+ need_shipping_address: bool | None = None
"""Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_."""
- send_phone_number_to_provider: Optional[bool] = None
+ send_phone_number_to_provider: bool | None = None
"""Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_."""
- send_email_to_provider: Optional[bool] = None
+ send_email_to_provider: bool | None = None
"""Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_."""
- is_flexible: Optional[bool] = None
+ is_flexible: bool | None = None
"""Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_."""
if TYPE_CHECKING:
@@ -73,23 +73,23 @@ class CreateInvoiceLink(TelegramMethod[str]):
payload: str,
currency: str,
prices: list[LabeledPrice],
- business_connection_id: Optional[str] = None,
- provider_token: Optional[str] = None,
- subscription_period: Optional[int] = None,
- max_tip_amount: Optional[int] = None,
- suggested_tip_amounts: Optional[list[int]] = None,
- provider_data: Optional[str] = None,
- photo_url: Optional[str] = None,
- photo_size: Optional[int] = None,
- photo_width: Optional[int] = None,
- photo_height: Optional[int] = None,
- need_name: Optional[bool] = None,
- need_phone_number: Optional[bool] = None,
- need_email: Optional[bool] = None,
- need_shipping_address: Optional[bool] = None,
- send_phone_number_to_provider: Optional[bool] = None,
- send_email_to_provider: Optional[bool] = None,
- is_flexible: Optional[bool] = None,
+ business_connection_id: str | None = None,
+ provider_token: str | None = None,
+ subscription_period: int | None = None,
+ max_tip_amount: int | None = None,
+ suggested_tip_amounts: list[int] | None = None,
+ provider_data: str | None = None,
+ photo_url: str | None = None,
+ photo_size: int | None = None,
+ photo_width: int | None = None,
+ photo_height: int | None = None,
+ need_name: bool | None = None,
+ need_phone_number: bool | None = None,
+ need_email: bool | None = None,
+ need_shipping_address: bool | None = None,
+ send_phone_number_to_provider: bool | None = None,
+ send_email_to_provider: bool | None = None,
+ is_flexible: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/create_new_sticker_set.py b/aiogram/methods/create_new_sticker_set.py
index 842f9faf..258c7ce8 100644
--- a/aiogram/methods/create_new_sticker_set.py
+++ b/aiogram/methods/create_new_sticker_set.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -26,11 +26,11 @@ class CreateNewStickerSet(TelegramMethod[bool]):
"""Sticker set title, 1-64 characters"""
stickers: list[InputSticker]
"""A JSON-serialized list of 1-50 initial stickers to be added to the sticker set"""
- sticker_type: Optional[str] = None
+ sticker_type: str | None = None
"""Type of stickers in the set, pass 'regular', 'mask', or 'custom_emoji'. By default, a regular sticker set is created."""
- needs_repainting: Optional[bool] = None
+ needs_repainting: bool | None = None
"""Pass :code:`True` if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only"""
- sticker_format: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
+ sticker_format: str | None = Field(None, json_schema_extra={"deprecated": True})
"""Format of stickers in the set, must be one of 'static', 'animated', 'video'
.. deprecated:: API:7.2
@@ -47,9 +47,9 @@ class CreateNewStickerSet(TelegramMethod[bool]):
name: str,
title: str,
stickers: list[InputSticker],
- sticker_type: Optional[str] = None,
- needs_repainting: Optional[bool] = None,
- sticker_format: Optional[str] = None,
+ sticker_type: str | None = None,
+ needs_repainting: bool | None = None,
+ sticker_format: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/decline_suggested_post.py b/aiogram/methods/decline_suggested_post.py
index 56f2fb99..70331257 100644
--- a/aiogram/methods/decline_suggested_post.py
+++ b/aiogram/methods/decline_suggested_post.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@@ -19,7 +19,7 @@ class DeclineSuggestedPost(TelegramMethod[bool]):
"""Unique identifier for the target direct messages chat"""
message_id: int
"""Identifier of a suggested post message to decline"""
- comment: Optional[str] = None
+ comment: str | None = None
"""Comment for the creator of the suggested post; 0-128 characters"""
if TYPE_CHECKING:
@@ -31,7 +31,7 @@ class DeclineSuggestedPost(TelegramMethod[bool]):
*,
chat_id: int,
message_id: int,
- comment: Optional[str] = None,
+ comment: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/delete_forum_topic.py b/aiogram/methods/delete_forum_topic.py
index b221a555..f168c74e 100644
--- a/aiogram/methods/delete_forum_topic.py
+++ b/aiogram/methods/delete_forum_topic.py
@@ -8,7 +8,7 @@ from .base import TelegramMethod
class DeleteForumTopic(TelegramMethod[bool]):
"""
- Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.
+ Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_delete_messages* administrator rights. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#deleteforumtopic
"""
diff --git a/aiogram/methods/delete_my_commands.py b/aiogram/methods/delete_my_commands.py
index 0d32d753..067cca85 100644
--- a/aiogram/methods/delete_my_commands.py
+++ b/aiogram/methods/delete_my_commands.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import BotCommandScopeUnion
from .base import TelegramMethod
@@ -16,9 +16,9 @@ class DeleteMyCommands(TelegramMethod[bool]):
__returning__ = bool
__api_method__ = "deleteMyCommands"
- scope: Optional[BotCommandScopeUnion] = None
+ scope: BotCommandScopeUnion | None = None
"""A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to :class:`aiogram.types.bot_command_scope_default.BotCommandScopeDefault`."""
- language_code: Optional[str] = None
+ language_code: str | None = None
"""A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands"""
if TYPE_CHECKING:
@@ -28,8 +28,8 @@ class DeleteMyCommands(TelegramMethod[bool]):
def __init__(
__pydantic__self__,
*,
- scope: Optional[BotCommandScopeUnion] = None,
- language_code: Optional[str] = None,
+ scope: BotCommandScopeUnion | None = None,
+ language_code: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/delete_webhook.py b/aiogram/methods/delete_webhook.py
index 05c39f4e..a42100f1 100644
--- a/aiogram/methods/delete_webhook.py
+++ b/aiogram/methods/delete_webhook.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@@ -15,7 +15,7 @@ class DeleteWebhook(TelegramMethod[bool]):
__returning__ = bool
__api_method__ = "deleteWebhook"
- drop_pending_updates: Optional[bool] = None
+ drop_pending_updates: bool | None = None
"""Pass :code:`True` to drop all pending updates"""
if TYPE_CHECKING:
@@ -25,7 +25,7 @@ class DeleteWebhook(TelegramMethod[bool]):
def __init__(
__pydantic__self__,
*,
- drop_pending_updates: Optional[bool] = None,
+ drop_pending_updates: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_chat_invite_link.py b/aiogram/methods/edit_chat_invite_link.py
index 5a1ec211..cc71252f 100644
--- a/aiogram/methods/edit_chat_invite_link.py
+++ b/aiogram/methods/edit_chat_invite_link.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ChatInviteLink, DateTimeUnion
from .base import TelegramMethod
@@ -20,13 +20,13 @@ class EditChatInviteLink(TelegramMethod[ChatInviteLink]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
invite_link: str
"""The invite link to edit"""
- name: Optional[str] = None
+ name: str | None = None
"""Invite link name; 0-32 characters"""
- expire_date: Optional[DateTimeUnion] = None
+ expire_date: DateTimeUnion | None = None
"""Point in time (Unix timestamp) when the link will expire"""
- member_limit: Optional[int] = None
+ member_limit: int | None = None
"""The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
- creates_join_request: Optional[bool] = None
+ creates_join_request: bool | None = None
""":code:`True`, if users joining the chat via the link need to be approved by chat administrators. If :code:`True`, *member_limit* can't be specified"""
if TYPE_CHECKING:
@@ -38,10 +38,10 @@ class EditChatInviteLink(TelegramMethod[ChatInviteLink]):
*,
chat_id: ChatIdUnion,
invite_link: str,
- name: Optional[str] = None,
- expire_date: Optional[DateTimeUnion] = None,
- member_limit: Optional[int] = None,
- creates_join_request: Optional[bool] = None,
+ name: str | None = None,
+ expire_date: DateTimeUnion | None = None,
+ member_limit: int | None = None,
+ creates_join_request: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_chat_subscription_invite_link.py b/aiogram/methods/edit_chat_subscription_invite_link.py
index f83882c3..8b8a7d36 100644
--- a/aiogram/methods/edit_chat_subscription_invite_link.py
+++ b/aiogram/methods/edit_chat_subscription_invite_link.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ChatInviteLink
from .base import TelegramMethod
@@ -20,7 +20,7 @@ class EditChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
invite_link: str
"""The invite link to edit"""
- name: Optional[str] = None
+ name: str | None = None
"""Invite link name; 0-32 characters"""
if TYPE_CHECKING:
@@ -32,7 +32,7 @@ class EditChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
*,
chat_id: ChatIdUnion,
invite_link: str,
- name: Optional[str] = None,
+ name: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_forum_topic.py b/aiogram/methods/edit_forum_topic.py
index 7bac4456..169e9829 100644
--- a/aiogram/methods/edit_forum_topic.py
+++ b/aiogram/methods/edit_forum_topic.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion
from .base import TelegramMethod
@@ -8,7 +8,7 @@ from .base import TelegramMethod
class EditForumTopic(TelegramMethod[bool]):
"""
- Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
+ Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#editforumtopic
"""
@@ -20,9 +20,9 @@ class EditForumTopic(TelegramMethod[bool]):
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
message_thread_id: int
"""Unique identifier for the target message thread of the forum topic"""
- name: Optional[str] = None
+ name: str | None = None
"""New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept"""
- icon_custom_emoji_id: Optional[str] = None
+ icon_custom_emoji_id: str | None = None
"""New unique identifier of the custom emoji shown as the topic icon. Use :class:`aiogram.methods.get_forum_topic_icon_stickers.GetForumTopicIconStickers` to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept"""
if TYPE_CHECKING:
@@ -34,8 +34,8 @@ class EditForumTopic(TelegramMethod[bool]):
*,
chat_id: ChatIdUnion,
message_thread_id: int,
- name: Optional[str] = None,
- icon_custom_emoji_id: Optional[str] = None,
+ name: str | None = None,
+ icon_custom_emoji_id: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_message_caption.py b/aiogram/methods/edit_message_caption.py
index f045f7b4..f790f9e2 100644
--- a/aiogram/methods/edit_message_caption.py
+++ b/aiogram/methods/edit_message_caption.py
@@ -1,39 +1,39 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from ..client.default import Default
from ..types import ChatIdUnion, InlineKeyboardMarkup, Message, MessageEntity
from .base import TelegramMethod
-class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
+class EditMessageCaption(TelegramMethod[Message | bool]):
"""
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
Source: https://core.telegram.org/bots/api#editmessagecaption
"""
- __returning__ = Union[Message, bool]
+ __returning__ = Message | bool
__api_method__ = "editMessageCaption"
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message to be edited was sent"""
- chat_id: Optional[ChatIdUnion] = None
+ chat_id: ChatIdUnion | None = None
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
- message_id: Optional[int] = None
+ message_id: int | None = None
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
- inline_message_id: Optional[str] = None
+ inline_message_id: str | None = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
- caption: Optional[str] = None
+ caption: str | None = None
"""New caption of the message, 0-1024 characters after entities parsing"""
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the message caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
- show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media")
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media")
"""Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages."""
- reply_markup: Optional[InlineKeyboardMarkup] = None
+ reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for an `inline keyboard `_."""
if TYPE_CHECKING:
@@ -43,17 +43,15 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
def __init__(
__pydantic__self__,
*,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- reply_markup: Optional[InlineKeyboardMarkup] = None,
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_message_checklist.py b/aiogram/methods/edit_message_checklist.py
index f1895eef..6f7bbf7d 100644
--- a/aiogram/methods/edit_message_checklist.py
+++ b/aiogram/methods/edit_message_checklist.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import InlineKeyboardMarkup, InputChecklist, Message
from .base import TelegramMethod
@@ -24,7 +24,7 @@ class EditMessageChecklist(TelegramMethod[Message]):
"""Unique identifier for the target message"""
checklist: InputChecklist
"""A JSON-serialized object for the new checklist"""
- reply_markup: Optional[InlineKeyboardMarkup] = None
+ reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for the new inline keyboard for the message"""
if TYPE_CHECKING:
@@ -38,7 +38,7 @@ class EditMessageChecklist(TelegramMethod[Message]):
chat_id: int,
message_id: int,
checklist: InputChecklist,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_message_live_location.py b/aiogram/methods/edit_message_live_location.py
index d68bd837..82471ad3 100644
--- a/aiogram/methods/edit_message_live_location.py
+++ b/aiogram/methods/edit_message_live_location.py
@@ -1,42 +1,42 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, InlineKeyboardMarkup, Message
from .base import TelegramMethod
-class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
+class EditMessageLiveLocation(TelegramMethod[Message | bool]):
"""
Use this method to edit live location messages. A location can be edited until its *live_period* expires or editing is explicitly disabled by a call to :class:`aiogram.methods.stop_message_live_location.StopMessageLiveLocation`. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned.
Source: https://core.telegram.org/bots/api#editmessagelivelocation
"""
- __returning__ = Union[Message, bool]
+ __returning__ = Message | bool
__api_method__ = "editMessageLiveLocation"
latitude: float
"""Latitude of new location"""
longitude: float
"""Longitude of new location"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message to be edited was sent"""
- chat_id: Optional[ChatIdUnion] = None
+ chat_id: ChatIdUnion | None = None
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
- message_id: Optional[int] = None
+ message_id: int | None = None
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
- inline_message_id: Optional[str] = None
+ inline_message_id: str | None = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
- live_period: Optional[int] = None
+ live_period: int | None = None
"""New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current *live_period* by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then *live_period* remains unchanged"""
- horizontal_accuracy: Optional[float] = None
+ horizontal_accuracy: float | None = None
"""The radius of uncertainty for the location, measured in meters; 0-1500"""
- heading: Optional[int] = None
+ heading: int | None = None
"""Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."""
- proximity_alert_radius: Optional[int] = None
+ proximity_alert_radius: int | None = None
"""The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."""
- reply_markup: Optional[InlineKeyboardMarkup] = None
+ reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for a new `inline keyboard `_."""
if TYPE_CHECKING:
@@ -48,15 +48,15 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
*,
latitude: float,
longitude: float,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- live_period: Optional[int] = None,
- horizontal_accuracy: Optional[float] = None,
- heading: Optional[int] = None,
- proximity_alert_radius: Optional[int] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ live_period: int | None = None,
+ horizontal_accuracy: float | None = None,
+ heading: int | None = None,
+ proximity_alert_radius: int | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_message_media.py b/aiogram/methods/edit_message_media.py
index 71189536..d0bdb776 100644
--- a/aiogram/methods/edit_message_media.py
+++ b/aiogram/methods/edit_message_media.py
@@ -1,32 +1,32 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, InlineKeyboardMarkup, InputMediaUnion, Message
from .base import TelegramMethod
-class EditMessageMedia(TelegramMethod[Union[Message, bool]]):
+class EditMessageMedia(TelegramMethod[Message | bool]):
"""
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
Source: https://core.telegram.org/bots/api#editmessagemedia
"""
- __returning__ = Union[Message, bool]
+ __returning__ = Message | bool
__api_method__ = "editMessageMedia"
media: InputMediaUnion
"""A JSON-serialized object for a new media content of the message"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message to be edited was sent"""
- chat_id: Optional[ChatIdUnion] = None
+ chat_id: ChatIdUnion | None = None
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
- message_id: Optional[int] = None
+ message_id: int | None = None
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
- inline_message_id: Optional[str] = None
+ inline_message_id: str | None = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
- reply_markup: Optional[InlineKeyboardMarkup] = None
+ reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for a new `inline keyboard `_."""
if TYPE_CHECKING:
@@ -37,11 +37,11 @@ class EditMessageMedia(TelegramMethod[Union[Message, bool]]):
__pydantic__self__,
*,
media: InputMediaUnion,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_message_reply_markup.py b/aiogram/methods/edit_message_reply_markup.py
index a8379a0a..e5bd47b6 100644
--- a/aiogram/methods/edit_message_reply_markup.py
+++ b/aiogram/methods/edit_message_reply_markup.py
@@ -1,30 +1,30 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, InlineKeyboardMarkup, Message
from .base import TelegramMethod
-class EditMessageReplyMarkup(TelegramMethod[Union[Message, bool]]):
+class EditMessageReplyMarkup(TelegramMethod[Message | bool]):
"""
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
Source: https://core.telegram.org/bots/api#editmessagereplymarkup
"""
- __returning__ = Union[Message, bool]
+ __returning__ = Message | bool
__api_method__ = "editMessageReplyMarkup"
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message to be edited was sent"""
- chat_id: Optional[ChatIdUnion] = None
+ chat_id: ChatIdUnion | None = None
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
- message_id: Optional[int] = None
+ message_id: int | None = None
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
- inline_message_id: Optional[str] = None
+ inline_message_id: str | None = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
- reply_markup: Optional[InlineKeyboardMarkup] = None
+ reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for an `inline keyboard `_."""
if TYPE_CHECKING:
@@ -34,11 +34,11 @@ class EditMessageReplyMarkup(TelegramMethod[Union[Message, bool]]):
def __init__(
__pydantic__self__,
*,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_message_text.py b/aiogram/methods/edit_message_text.py
index 5e5cbb65..3622d293 100644
--- a/aiogram/methods/edit_message_text.py
+++ b/aiogram/methods/edit_message_text.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -15,35 +15,35 @@ from ..types import (
from .base import TelegramMethod
-class EditMessageText(TelegramMethod[Union[Message, bool]]):
+class EditMessageText(TelegramMethod[Message | bool]):
"""
Use this method to edit text and `game `_ messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
Source: https://core.telegram.org/bots/api#editmessagetext
"""
- __returning__ = Union[Message, bool]
+ __returning__ = Message | bool
__api_method__ = "editMessageText"
text: str
"""New text of the message, 1-4096 characters after entities parsing"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message to be edited was sent"""
- chat_id: Optional[ChatIdUnion] = None
+ chat_id: ChatIdUnion | None = None
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
- message_id: Optional[int] = None
+ message_id: int | None = None
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
- inline_message_id: Optional[str] = None
+ inline_message_id: str | None = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the message text. See `formatting options `_ for more details."""
- entities: Optional[list[MessageEntity]] = None
+ entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*"""
- link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default("link_preview")
+ link_preview_options: LinkPreviewOptions | Default | None = Default("link_preview")
"""Link preview generation options for the message"""
- reply_markup: Optional[InlineKeyboardMarkup] = None
+ reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for an `inline keyboard `_."""
- disable_web_page_preview: Optional[Union[bool, Default]] = Field(
+ disable_web_page_preview: bool | Default | None = Field(
Default("link_preview_is_disabled"), json_schema_extra={"deprecated": True}
)
"""Disables link previews for links in this message
@@ -59,19 +59,15 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]):
__pydantic__self__,
*,
text: str,
- business_connection_id: Optional[str] = None,
- chat_id: Optional[ChatIdUnion] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- entities: Optional[list[MessageEntity]] = None,
- link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
- "link_preview"
- ),
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- disable_web_page_preview: Optional[Union[bool, Default]] = Default(
- "link_preview_is_disabled"
- ),
+ business_connection_id: str | None = None,
+ chat_id: ChatIdUnion | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ entities: list[MessageEntity] | None = None,
+ link_preview_options: LinkPreviewOptions | Default | None = Default("link_preview"),
+ reply_markup: InlineKeyboardMarkup | None = None,
+ disable_web_page_preview: bool | Default | None = Default("link_preview_is_disabled"),
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/edit_story.py b/aiogram/methods/edit_story.py
index d425e4d5..888707ec 100644
--- a/aiogram/methods/edit_story.py
+++ b/aiogram/methods/edit_story.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import InputStoryContentUnion, MessageEntity, Story, StoryArea
from .base import TelegramMethod
@@ -22,13 +22,13 @@ class EditStory(TelegramMethod[Story]):
"""Unique identifier of the story to edit"""
content: InputStoryContentUnion
"""Content of the story"""
- caption: Optional[str] = None
+ caption: str | None = None
"""Caption of the story, 0-2048 characters after entities parsing"""
- parse_mode: Optional[str] = None
+ parse_mode: str | None = None
"""Mode for parsing entities in the story caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
- areas: Optional[list[StoryArea]] = None
+ areas: list[StoryArea] | None = None
"""A JSON-serialized list of clickable areas to be shown on the story"""
if TYPE_CHECKING:
@@ -41,10 +41,10 @@ class EditStory(TelegramMethod[Story]):
business_connection_id: str,
story_id: int,
content: InputStoryContentUnion,
- caption: Optional[str] = None,
- parse_mode: Optional[str] = None,
- caption_entities: Optional[list[MessageEntity]] = None,
- areas: Optional[list[StoryArea]] = None,
+ caption: str | None = None,
+ parse_mode: str | None = None,
+ caption_entities: list[MessageEntity] | None = None,
+ areas: list[StoryArea] | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/forward_message.py b/aiogram/methods/forward_message.py
index d8b51d8e..c52d4de0 100644
--- a/aiogram/methods/forward_message.py
+++ b/aiogram/methods/forward_message.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from ..client.default import Default
from ..types import ChatIdUnion, DateTimeUnion, Message, SuggestedPostParameters
@@ -23,17 +23,19 @@ class ForwardMessage(TelegramMethod[Message]):
"""Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)"""
message_id: int
"""Message identifier in the chat specified in *from_chat_id*"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat"""
- video_start_timestamp: Optional[DateTimeUnion] = None
+ video_start_timestamp: DateTimeUnion | None = None
"""New start timestamp for the forwarded video in the message"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the forwarded message from forwarding and saving"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ message_effect_id: str | None = None
+ """Unique identifier of the message effect to be added to the message; only available when forwarding to private chats"""
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only"""
if TYPE_CHECKING:
@@ -46,12 +48,13 @@ class ForwardMessage(TelegramMethod[Message]):
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_id: int,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- video_start_timestamp: Optional[DateTimeUnion] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ video_start_timestamp: DateTimeUnion | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
@@ -67,6 +70,7 @@ class ForwardMessage(TelegramMethod[Message]):
video_start_timestamp=video_start_timestamp,
disable_notification=disable_notification,
protect_content=protect_content,
+ message_effect_id=message_effect_id,
suggested_post_parameters=suggested_post_parameters,
**__pydantic_kwargs,
)
diff --git a/aiogram/methods/forward_messages.py b/aiogram/methods/forward_messages.py
index 2d74f5aa..0a70b3c9 100644
--- a/aiogram/methods/forward_messages.py
+++ b/aiogram/methods/forward_messages.py
@@ -1,4 +1,4 @@
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, MessageId
from .base import TelegramMethod
@@ -20,13 +20,13 @@ class ForwardMessages(TelegramMethod[list[MessageId]]):
"""Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)"""
message_ids: list[int]
"""A JSON-serialized list of 1-100 identifiers of messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order."""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the messages `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[bool] = None
+ protect_content: bool | None = None
"""Protects the contents of the forwarded messages from forwarding and saving"""
if TYPE_CHECKING:
@@ -39,10 +39,10 @@ class ForwardMessages(TelegramMethod[list[MessageId]]):
chat_id: ChatIdUnion,
from_chat_id: ChatIdUnion,
message_ids: list[int],
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[bool] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/get_business_account_gifts.py b/aiogram/methods/get_business_account_gifts.py
index 25050705..27fcaa7d 100644
--- a/aiogram/methods/get_business_account_gifts.py
+++ b/aiogram/methods/get_business_account_gifts.py
@@ -1,6 +1,8 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
+
+from pydantic import Field
from ..types import OwnedGifts
from .base import TelegramMethod
@@ -18,22 +20,31 @@ class GetBusinessAccountGifts(TelegramMethod[OwnedGifts]):
business_connection_id: str
"""Unique identifier of the business connection"""
- exclude_unsaved: Optional[bool] = None
+ exclude_unsaved: bool | None = None
"""Pass :code:`True` to exclude gifts that aren't saved to the account's profile page"""
- exclude_saved: Optional[bool] = None
+ exclude_saved: bool | None = None
"""Pass :code:`True` to exclude gifts that are saved to the account's profile page"""
- exclude_unlimited: Optional[bool] = None
+ exclude_unlimited: bool | None = None
"""Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times"""
- exclude_limited: Optional[bool] = None
- """Pass :code:`True` to exclude gifts that can be purchased a limited number of times"""
- exclude_unique: Optional[bool] = None
+ exclude_limited_upgradable: bool | None = None
+ """Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique"""
+ exclude_limited_non_upgradable: bool | None = None
+ """Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique"""
+ exclude_unique: bool | None = None
"""Pass :code:`True` to exclude unique gifts"""
- sort_by_price: Optional[bool] = None
+ exclude_from_blockchain: bool | None = None
+ """Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram"""
+ sort_by_price: bool | None = None
"""Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination."""
- offset: Optional[str] = None
+ offset: str | None = None
"""Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results"""
- limit: Optional[int] = None
+ limit: int | None = None
"""The maximum number of gifts to be returned; 1-100. Defaults to 100"""
+ exclude_limited: bool | None = Field(None, json_schema_extra={"deprecated": True})
+ """Pass :code:`True` to exclude gifts that can be purchased a limited number of times
+
+.. deprecated:: API:9.3
+ https://core.telegram.org/bots/api-changelog#december-31-2025"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
@@ -43,14 +54,17 @@ class GetBusinessAccountGifts(TelegramMethod[OwnedGifts]):
__pydantic__self__,
*,
business_connection_id: str,
- exclude_unsaved: Optional[bool] = None,
- exclude_saved: Optional[bool] = None,
- exclude_unlimited: Optional[bool] = None,
- exclude_limited: Optional[bool] = None,
- exclude_unique: Optional[bool] = None,
- sort_by_price: Optional[bool] = None,
- offset: Optional[str] = None,
- limit: Optional[int] = None,
+ exclude_unsaved: bool | None = None,
+ exclude_saved: bool | None = None,
+ exclude_unlimited: bool | None = None,
+ exclude_limited_upgradable: bool | None = None,
+ exclude_limited_non_upgradable: bool | None = None,
+ exclude_unique: bool | None = None,
+ exclude_from_blockchain: bool | None = None,
+ sort_by_price: bool | None = None,
+ offset: str | None = None,
+ limit: int | None = None,
+ exclude_limited: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
@@ -62,10 +76,13 @@ class GetBusinessAccountGifts(TelegramMethod[OwnedGifts]):
exclude_unsaved=exclude_unsaved,
exclude_saved=exclude_saved,
exclude_unlimited=exclude_unlimited,
- exclude_limited=exclude_limited,
+ exclude_limited_upgradable=exclude_limited_upgradable,
+ exclude_limited_non_upgradable=exclude_limited_non_upgradable,
exclude_unique=exclude_unique,
+ exclude_from_blockchain=exclude_from_blockchain,
sort_by_price=sort_by_price,
offset=offset,
limit=limit,
+ exclude_limited=exclude_limited,
**__pydantic_kwargs,
)
diff --git a/aiogram/methods/get_chat_gifts.py b/aiogram/methods/get_chat_gifts.py
new file mode 100644
index 00000000..4b7d3c7c
--- /dev/null
+++ b/aiogram/methods/get_chat_gifts.py
@@ -0,0 +1,79 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any
+
+from ..types import ChatIdUnion, OwnedGifts
+from .base import TelegramMethod
+
+
+class GetChatGifts(TelegramMethod[OwnedGifts]):
+ """
+ Returns the gifts owned by a chat. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
+
+ Source: https://core.telegram.org/bots/api#getchatgifts
+ """
+
+ __returning__ = OwnedGifts
+ __api_method__ = "getChatGifts"
+
+ chat_id: ChatIdUnion
+ """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
+ exclude_unsaved: bool | None = None
+ """Pass :code:`True` to exclude gifts that aren't saved to the chat's profile page. Always :code:`True`, unless the bot has the *can_post_messages* administrator right in the channel."""
+ exclude_saved: bool | None = None
+ """Pass :code:`True` to exclude gifts that are saved to the chat's profile page. Always :code:`False`, unless the bot has the *can_post_messages* administrator right in the channel."""
+ exclude_unlimited: bool | None = None
+ """Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times"""
+ exclude_limited_upgradable: bool | None = None
+ """Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique"""
+ exclude_limited_non_upgradable: bool | None = None
+ """Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique"""
+ exclude_from_blockchain: bool | None = None
+ """Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram"""
+ exclude_unique: bool | None = None
+ """Pass :code:`True` to exclude unique gifts"""
+ sort_by_price: bool | None = None
+ """Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination."""
+ offset: str | None = None
+ """Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results"""
+ limit: int | None = None
+ """The maximum number of gifts to be returned; 1-100. Defaults to 100"""
+
+ if TYPE_CHECKING:
+ # DO NOT EDIT MANUALLY!!!
+ # This section was auto-generated via `butcher`
+
+ def __init__(
+ __pydantic__self__,
+ *,
+ chat_id: ChatIdUnion,
+ exclude_unsaved: bool | None = None,
+ exclude_saved: bool | None = None,
+ exclude_unlimited: bool | None = None,
+ exclude_limited_upgradable: bool | None = None,
+ exclude_limited_non_upgradable: bool | None = None,
+ exclude_from_blockchain: bool | None = None,
+ exclude_unique: bool | None = None,
+ sort_by_price: bool | None = None,
+ offset: str | None = None,
+ limit: int | None = 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__(
+ chat_id=chat_id,
+ exclude_unsaved=exclude_unsaved,
+ exclude_saved=exclude_saved,
+ exclude_unlimited=exclude_unlimited,
+ exclude_limited_upgradable=exclude_limited_upgradable,
+ exclude_limited_non_upgradable=exclude_limited_non_upgradable,
+ exclude_from_blockchain=exclude_from_blockchain,
+ exclude_unique=exclude_unique,
+ sort_by_price=sort_by_price,
+ offset=offset,
+ limit=limit,
+ **__pydantic_kwargs,
+ )
diff --git a/aiogram/methods/get_chat_menu_button.py b/aiogram/methods/get_chat_menu_button.py
index 5c7e06c8..dbb84124 100644
--- a/aiogram/methods/get_chat_menu_button.py
+++ b/aiogram/methods/get_chat_menu_button.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ResultMenuButtonUnion
from .base import TelegramMethod
@@ -16,7 +16,7 @@ class GetChatMenuButton(TelegramMethod[ResultMenuButtonUnion]):
__returning__ = ResultMenuButtonUnion
__api_method__ = "getChatMenuButton"
- chat_id: Optional[int] = None
+ chat_id: int | None = None
"""Unique identifier for the target private chat. If not specified, default bot's menu button will be returned"""
if TYPE_CHECKING:
@@ -24,7 +24,7 @@ class GetChatMenuButton(TelegramMethod[ResultMenuButtonUnion]):
# This section was auto-generated via `butcher`
def __init__(
- __pydantic__self__, *, chat_id: Optional[int] = None, **__pydantic_kwargs: Any
+ __pydantic__self__, *, chat_id: int | None = None, **__pydantic_kwargs: Any
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
diff --git a/aiogram/methods/get_game_high_scores.py b/aiogram/methods/get_game_high_scores.py
index fc0d443a..de2a26e9 100644
--- a/aiogram/methods/get_game_high_scores.py
+++ b/aiogram/methods/get_game_high_scores.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import GameHighScore
from .base import TelegramMethod
@@ -20,11 +20,11 @@ class GetGameHighScores(TelegramMethod[list[GameHighScore]]):
user_id: int
"""Target user id"""
- chat_id: Optional[int] = None
+ chat_id: int | None = None
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat"""
- message_id: Optional[int] = None
+ message_id: int | None = None
"""Required if *inline_message_id* is not specified. Identifier of the sent message"""
- inline_message_id: Optional[str] = None
+ inline_message_id: str | None = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
if TYPE_CHECKING:
@@ -35,9 +35,9 @@ class GetGameHighScores(TelegramMethod[list[GameHighScore]]):
__pydantic__self__,
*,
user_id: int,
- chat_id: Optional[int] = None,
- message_id: Optional[int] = None,
- inline_message_id: Optional[str] = None,
+ chat_id: int | None = None,
+ message_id: int | None = None,
+ inline_message_id: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/get_my_commands.py b/aiogram/methods/get_my_commands.py
index c155f18f..dc519186 100644
--- a/aiogram/methods/get_my_commands.py
+++ b/aiogram/methods/get_my_commands.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import BotCommand, BotCommandScopeUnion
from .base import TelegramMethod
@@ -16,9 +16,9 @@ class GetMyCommands(TelegramMethod[list[BotCommand]]):
__returning__ = list[BotCommand]
__api_method__ = "getMyCommands"
- scope: Optional[BotCommandScopeUnion] = None
+ scope: BotCommandScopeUnion | None = None
"""A JSON-serialized object, describing scope of users. Defaults to :class:`aiogram.types.bot_command_scope_default.BotCommandScopeDefault`."""
- language_code: Optional[str] = None
+ language_code: str | None = None
"""A two-letter ISO 639-1 language code or an empty string"""
if TYPE_CHECKING:
@@ -28,8 +28,8 @@ class GetMyCommands(TelegramMethod[list[BotCommand]]):
def __init__(
__pydantic__self__,
*,
- scope: Optional[BotCommandScopeUnion] = None,
- language_code: Optional[str] = None,
+ scope: BotCommandScopeUnion | None = None,
+ language_code: str | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/get_my_default_administrator_rights.py b/aiogram/methods/get_my_default_administrator_rights.py
index 4f9ad9a6..c439f0ca 100644
--- a/aiogram/methods/get_my_default_administrator_rights.py
+++ b/aiogram/methods/get_my_default_administrator_rights.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatAdministratorRights
from .base import TelegramMethod
@@ -16,7 +16,7 @@ class GetMyDefaultAdministratorRights(TelegramMethod[ChatAdministratorRights]):
__returning__ = ChatAdministratorRights
__api_method__ = "getMyDefaultAdministratorRights"
- for_channels: Optional[bool] = None
+ for_channels: bool | None = None
"""Pass :code:`True` to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned."""
if TYPE_CHECKING:
@@ -24,7 +24,7 @@ class GetMyDefaultAdministratorRights(TelegramMethod[ChatAdministratorRights]):
# This section was auto-generated via `butcher`
def __init__(
- __pydantic__self__, *, for_channels: Optional[bool] = None, **__pydantic_kwargs: Any
+ __pydantic__self__, *, for_channels: bool | None = None, **__pydantic_kwargs: Any
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
diff --git a/aiogram/methods/get_my_description.py b/aiogram/methods/get_my_description.py
index f967faf6..773241e2 100644
--- a/aiogram/methods/get_my_description.py
+++ b/aiogram/methods/get_my_description.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import BotDescription
from .base import TelegramMethod
@@ -16,7 +16,7 @@ class GetMyDescription(TelegramMethod[BotDescription]):
__returning__ = BotDescription
__api_method__ = "getMyDescription"
- language_code: Optional[str] = None
+ language_code: str | None = None
"""A two-letter ISO 639-1 language code or an empty string"""
if TYPE_CHECKING:
@@ -24,7 +24,7 @@ class GetMyDescription(TelegramMethod[BotDescription]):
# This section was auto-generated via `butcher`
def __init__(
- __pydantic__self__, *, language_code: Optional[str] = None, **__pydantic_kwargs: Any
+ __pydantic__self__, *, language_code: str | None = None, **__pydantic_kwargs: Any
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
diff --git a/aiogram/methods/get_my_name.py b/aiogram/methods/get_my_name.py
index 909ac3f6..68f0d8e8 100644
--- a/aiogram/methods/get_my_name.py
+++ b/aiogram/methods/get_my_name.py
@@ -1,4 +1,4 @@
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import BotName
from .base import TelegramMethod
@@ -14,7 +14,7 @@ class GetMyName(TelegramMethod[BotName]):
__returning__ = BotName
__api_method__ = "getMyName"
- language_code: Optional[str] = None
+ language_code: str | None = None
"""A two-letter ISO 639-1 language code or an empty string"""
if TYPE_CHECKING:
@@ -22,7 +22,7 @@ class GetMyName(TelegramMethod[BotName]):
# This section was auto-generated via `butcher`
def __init__(
- __pydantic__self__, *, language_code: Optional[str] = None, **__pydantic_kwargs: Any
+ __pydantic__self__, *, language_code: str | None = None, **__pydantic_kwargs: Any
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
diff --git a/aiogram/methods/get_my_short_description.py b/aiogram/methods/get_my_short_description.py
index a9a56669..f94c2bb7 100644
--- a/aiogram/methods/get_my_short_description.py
+++ b/aiogram/methods/get_my_short_description.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import BotShortDescription
from .base import TelegramMethod
@@ -16,7 +16,7 @@ class GetMyShortDescription(TelegramMethod[BotShortDescription]):
__returning__ = BotShortDescription
__api_method__ = "getMyShortDescription"
- language_code: Optional[str] = None
+ language_code: str | None = None
"""A two-letter ISO 639-1 language code or an empty string"""
if TYPE_CHECKING:
@@ -24,7 +24,7 @@ class GetMyShortDescription(TelegramMethod[BotShortDescription]):
# This section was auto-generated via `butcher`
def __init__(
- __pydantic__self__, *, language_code: Optional[str] = None, **__pydantic_kwargs: Any
+ __pydantic__self__, *, language_code: str | None = None, **__pydantic_kwargs: Any
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
diff --git a/aiogram/methods/get_star_transactions.py b/aiogram/methods/get_star_transactions.py
index ee0ea2e1..ac8dfdeb 100644
--- a/aiogram/methods/get_star_transactions.py
+++ b/aiogram/methods/get_star_transactions.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import StarTransactions
from .base import TelegramMethod
@@ -16,9 +16,9 @@ class GetStarTransactions(TelegramMethod[StarTransactions]):
__returning__ = StarTransactions
__api_method__ = "getStarTransactions"
- offset: Optional[int] = None
+ offset: int | None = None
"""Number of transactions to skip in the response"""
- limit: Optional[int] = None
+ limit: int | None = None
"""The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100."""
if TYPE_CHECKING:
@@ -28,8 +28,8 @@ class GetStarTransactions(TelegramMethod[StarTransactions]):
def __init__(
__pydantic__self__,
*,
- offset: Optional[int] = None,
- limit: Optional[int] = None,
+ offset: int | None = None,
+ limit: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/get_updates.py b/aiogram/methods/get_updates.py
index 5a3fc054..30cab2af 100644
--- a/aiogram/methods/get_updates.py
+++ b/aiogram/methods/get_updates.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import Update
from .base import TelegramMethod
@@ -22,13 +22,13 @@ class GetUpdates(TelegramMethod[list[Update]]):
__returning__ = list[Update]
__api_method__ = "getUpdates"
- offset: Optional[int] = None
+ offset: int | None = None
"""Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as :class:`aiogram.methods.get_updates.GetUpdates` is called with an *offset* higher than its *update_id*. The negative offset can be specified to retrieve updates starting from *-offset* update from the end of the updates queue. All previous updates will be forgotten."""
- limit: Optional[int] = None
+ limit: int | None = None
"""Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100."""
- timeout: Optional[int] = None
+ timeout: int | None = None
"""Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only."""
- allowed_updates: Optional[list[str]] = None
+ allowed_updates: list[str] | None = None
"""A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used."""
if TYPE_CHECKING:
@@ -38,10 +38,10 @@ class GetUpdates(TelegramMethod[list[Update]]):
def __init__(
__pydantic__self__,
*,
- offset: Optional[int] = None,
- limit: Optional[int] = None,
- timeout: Optional[int] = None,
- allowed_updates: Optional[list[str]] = None,
+ offset: int | None = None,
+ limit: int | None = None,
+ timeout: int | None = None,
+ allowed_updates: list[str] | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/get_user_gifts.py b/aiogram/methods/get_user_gifts.py
new file mode 100644
index 00000000..69982166
--- /dev/null
+++ b/aiogram/methods/get_user_gifts.py
@@ -0,0 +1,71 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any
+
+from ..types import OwnedGifts
+from .base import TelegramMethod
+
+
+class GetUserGifts(TelegramMethod[OwnedGifts]):
+ """
+ Returns the gifts owned and hosted by a user. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.
+
+ Source: https://core.telegram.org/bots/api#getusergifts
+ """
+
+ __returning__ = OwnedGifts
+ __api_method__ = "getUserGifts"
+
+ user_id: int
+ """Unique identifier of the user"""
+ exclude_unlimited: bool | None = None
+ """Pass :code:`True` to exclude gifts that can be purchased an unlimited number of times"""
+ exclude_limited_upgradable: bool | None = None
+ """Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can be upgraded to unique"""
+ exclude_limited_non_upgradable: bool | None = None
+ """Pass :code:`True` to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique"""
+ exclude_from_blockchain: bool | None = None
+ """Pass :code:`True` to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram"""
+ exclude_unique: bool | None = None
+ """Pass :code:`True` to exclude unique gifts"""
+ sort_by_price: bool | None = None
+ """Pass :code:`True` to sort results by gift price instead of send date. Sorting is applied before pagination."""
+ offset: str | None = None
+ """Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results"""
+ limit: int | None = None
+ """The maximum number of gifts to be returned; 1-100. Defaults to 100"""
+
+ if TYPE_CHECKING:
+ # DO NOT EDIT MANUALLY!!!
+ # This section was auto-generated via `butcher`
+
+ def __init__(
+ __pydantic__self__,
+ *,
+ user_id: int,
+ exclude_unlimited: bool | None = None,
+ exclude_limited_upgradable: bool | None = None,
+ exclude_limited_non_upgradable: bool | None = None,
+ exclude_from_blockchain: bool | None = None,
+ exclude_unique: bool | None = None,
+ sort_by_price: bool | None = None,
+ offset: str | None = None,
+ limit: int | None = 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__(
+ user_id=user_id,
+ exclude_unlimited=exclude_unlimited,
+ exclude_limited_upgradable=exclude_limited_upgradable,
+ exclude_limited_non_upgradable=exclude_limited_non_upgradable,
+ exclude_from_blockchain=exclude_from_blockchain,
+ exclude_unique=exclude_unique,
+ sort_by_price=sort_by_price,
+ offset=offset,
+ limit=limit,
+ **__pydantic_kwargs,
+ )
diff --git a/aiogram/methods/get_user_profile_photos.py b/aiogram/methods/get_user_profile_photos.py
index 488885e1..0b314366 100644
--- a/aiogram/methods/get_user_profile_photos.py
+++ b/aiogram/methods/get_user_profile_photos.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import UserProfilePhotos
from .base import TelegramMethod
@@ -18,9 +18,9 @@ class GetUserProfilePhotos(TelegramMethod[UserProfilePhotos]):
user_id: int
"""Unique identifier of the target user"""
- offset: Optional[int] = None
+ offset: int | None = None
"""Sequential number of the first photo to be returned. By default, all photos are returned."""
- limit: Optional[int] = None
+ limit: int | None = None
"""Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100."""
if TYPE_CHECKING:
@@ -31,8 +31,8 @@ class GetUserProfilePhotos(TelegramMethod[UserProfilePhotos]):
__pydantic__self__,
*,
user_id: int,
- offset: Optional[int] = None,
- limit: Optional[int] = None,
+ offset: int | None = None,
+ limit: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/gift_premium_subscription.py b/aiogram/methods/gift_premium_subscription.py
index 54316db9..2feaa5f5 100644
--- a/aiogram/methods/gift_premium_subscription.py
+++ b/aiogram/methods/gift_premium_subscription.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import MessageEntity
from .base import TelegramMethod
@@ -22,11 +22,11 @@ class GiftPremiumSubscription(TelegramMethod[bool]):
"""Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12"""
star_count: int
"""Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months"""
- text: Optional[str] = None
+ text: str | None = None
"""Text that will be shown along with the service message about the subscription; 0-128 characters"""
- text_parse_mode: Optional[str] = None
+ text_parse_mode: str | None = None
"""Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
- text_entities: Optional[list[MessageEntity]] = None
+ text_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
if TYPE_CHECKING:
@@ -39,9 +39,9 @@ class GiftPremiumSubscription(TelegramMethod[bool]):
user_id: int,
month_count: int,
star_count: int,
- text: Optional[str] = None,
- text_parse_mode: Optional[str] = None,
- text_entities: Optional[list[MessageEntity]] = None,
+ text: str | None = None,
+ text_parse_mode: str | None = None,
+ text_entities: list[MessageEntity] | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/pin_chat_message.py b/aiogram/methods/pin_chat_message.py
index cc68ebc9..ad113322 100644
--- a/aiogram/methods/pin_chat_message.py
+++ b/aiogram/methods/pin_chat_message.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion
from .base import TelegramMethod
@@ -20,9 +20,9 @@ class PinChatMessage(TelegramMethod[bool]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
message_id: int
"""Identifier of a message to pin"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be pinned"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Pass :code:`True` if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats."""
if TYPE_CHECKING:
@@ -34,8 +34,8 @@ class PinChatMessage(TelegramMethod[bool]):
*,
chat_id: ChatIdUnion,
message_id: int,
- business_connection_id: Optional[str] = None,
- disable_notification: Optional[bool] = None,
+ business_connection_id: str | None = None,
+ disable_notification: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/post_story.py b/aiogram/methods/post_story.py
index 60402225..b768eacc 100644
--- a/aiogram/methods/post_story.py
+++ b/aiogram/methods/post_story.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import InputStoryContentUnion, MessageEntity, Story, StoryArea
from .base import TelegramMethod
@@ -22,17 +22,17 @@ class PostStory(TelegramMethod[Story]):
"""Content of the story"""
active_period: int
"""Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`"""
- caption: Optional[str] = None
+ caption: str | None = None
"""Caption of the story, 0-2048 characters after entities parsing"""
- parse_mode: Optional[str] = None
+ parse_mode: str | None = None
"""Mode for parsing entities in the story caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
- areas: Optional[list[StoryArea]] = None
+ areas: list[StoryArea] | None = None
"""A JSON-serialized list of clickable areas to be shown on the story"""
- post_to_chat_page: Optional[bool] = None
+ post_to_chat_page: bool | None = None
"""Pass :code:`True` to keep the story accessible after it expires"""
- protect_content: Optional[bool] = None
+ protect_content: bool | None = None
"""Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting"""
if TYPE_CHECKING:
@@ -45,12 +45,12 @@ class PostStory(TelegramMethod[Story]):
business_connection_id: str,
content: InputStoryContentUnion,
active_period: int,
- caption: Optional[str] = None,
- parse_mode: Optional[str] = None,
- caption_entities: Optional[list[MessageEntity]] = None,
- areas: Optional[list[StoryArea]] = None,
- post_to_chat_page: Optional[bool] = None,
- protect_content: Optional[bool] = None,
+ caption: str | None = None,
+ parse_mode: str | None = None,
+ caption_entities: list[MessageEntity] | None = None,
+ areas: list[StoryArea] | None = None,
+ post_to_chat_page: bool | None = None,
+ protect_content: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/promote_chat_member.py b/aiogram/methods/promote_chat_member.py
index dc3fbbd8..e26f821e 100644
--- a/aiogram/methods/promote_chat_member.py
+++ b/aiogram/methods/promote_chat_member.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion
from .base import TelegramMethod
@@ -20,37 +20,37 @@ class PromoteChatMember(TelegramMethod[bool]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
user_id: int
"""Unique identifier of the target user"""
- is_anonymous: Optional[bool] = None
+ is_anonymous: bool | None = None
"""Pass :code:`True` if the administrator's presence in the chat is hidden"""
- can_manage_chat: Optional[bool] = None
+ can_manage_chat: bool | None = None
"""Pass :code:`True` if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege."""
- can_delete_messages: Optional[bool] = None
+ can_delete_messages: bool | None = None
"""Pass :code:`True` if the administrator can delete messages of other users"""
- can_manage_video_chats: Optional[bool] = None
+ can_manage_video_chats: bool | None = None
"""Pass :code:`True` if the administrator can manage video chats"""
- can_restrict_members: Optional[bool] = None
- """Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics"""
- can_promote_members: Optional[bool] = None
+ can_restrict_members: bool | None = None
+ """Pass :code:`True` if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to :code:`True` for promotions of channel administrators"""
+ can_promote_members: bool | None = None
"""Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)"""
- can_change_info: Optional[bool] = None
+ can_change_info: bool | None = None
"""Pass :code:`True` if the administrator can change chat title, photo and other settings"""
- can_invite_users: Optional[bool] = None
+ can_invite_users: bool | None = None
"""Pass :code:`True` if the administrator can invite new users to the chat"""
- can_post_stories: Optional[bool] = None
+ can_post_stories: bool | None = None
"""Pass :code:`True` if the administrator can post stories to the chat"""
- can_edit_stories: Optional[bool] = None
+ can_edit_stories: bool | None = None
"""Pass :code:`True` if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive"""
- can_delete_stories: Optional[bool] = None
+ can_delete_stories: bool | None = None
"""Pass :code:`True` if the administrator can delete stories posted by other users"""
- can_post_messages: Optional[bool] = None
+ can_post_messages: bool | None = None
"""Pass :code:`True` if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only"""
- can_edit_messages: Optional[bool] = None
+ can_edit_messages: bool | None = None
"""Pass :code:`True` if the administrator can edit messages of other users and can pin messages; for channels only"""
- can_pin_messages: Optional[bool] = None
+ can_pin_messages: bool | None = None
"""Pass :code:`True` if the administrator can pin messages; for supergroups only"""
- can_manage_topics: Optional[bool] = None
+ can_manage_topics: bool | None = None
"""Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only"""
- can_manage_direct_messages: Optional[bool] = None
+ can_manage_direct_messages: bool | None = None
"""Pass :code:`True` if the administrator can manage direct messages within the channel and decline suggested posts; for channels only"""
if TYPE_CHECKING:
@@ -62,22 +62,22 @@ class PromoteChatMember(TelegramMethod[bool]):
*,
chat_id: ChatIdUnion,
user_id: int,
- is_anonymous: Optional[bool] = None,
- can_manage_chat: Optional[bool] = None,
- can_delete_messages: Optional[bool] = None,
- can_manage_video_chats: Optional[bool] = None,
- can_restrict_members: Optional[bool] = None,
- can_promote_members: Optional[bool] = None,
- can_change_info: Optional[bool] = None,
- can_invite_users: Optional[bool] = None,
- can_post_stories: Optional[bool] = None,
- can_edit_stories: Optional[bool] = None,
- can_delete_stories: Optional[bool] = None,
- can_post_messages: Optional[bool] = None,
- can_edit_messages: Optional[bool] = None,
- can_pin_messages: Optional[bool] = None,
- can_manage_topics: Optional[bool] = None,
- can_manage_direct_messages: Optional[bool] = None,
+ is_anonymous: bool | None = None,
+ can_manage_chat: bool | None = None,
+ can_delete_messages: bool | None = None,
+ can_manage_video_chats: bool | None = None,
+ can_restrict_members: bool | None = None,
+ can_promote_members: bool | None = None,
+ can_change_info: bool | None = None,
+ can_invite_users: bool | None = None,
+ can_post_stories: bool | None = None,
+ can_edit_stories: bool | None = None,
+ can_delete_stories: bool | None = None,
+ can_post_messages: bool | None = None,
+ can_edit_messages: bool | None = None,
+ can_pin_messages: bool | None = None,
+ can_manage_topics: bool | None = None,
+ can_manage_direct_messages: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/remove_business_account_profile_photo.py b/aiogram/methods/remove_business_account_profile_photo.py
index 47af0f24..e0648c2a 100644
--- a/aiogram/methods/remove_business_account_profile_photo.py
+++ b/aiogram/methods/remove_business_account_profile_photo.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@@ -17,7 +17,7 @@ class RemoveBusinessAccountProfilePhoto(TelegramMethod[bool]):
business_connection_id: str
"""Unique identifier of the business connection"""
- is_public: Optional[bool] = None
+ is_public: bool | None = None
"""Pass :code:`True` to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo."""
if TYPE_CHECKING:
@@ -28,7 +28,7 @@ class RemoveBusinessAccountProfilePhoto(TelegramMethod[bool]):
__pydantic__self__,
*,
business_connection_id: str,
- is_public: Optional[bool] = None,
+ is_public: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/repost_story.py b/aiogram/methods/repost_story.py
new file mode 100644
index 00000000..4aef335b
--- /dev/null
+++ b/aiogram/methods/repost_story.py
@@ -0,0 +1,59 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any
+
+from ..types import Story
+from .base import TelegramMethod
+
+
+class RepostStory(TelegramMethod[Story]):
+ """
+ Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the *can_manage_stories* business bot right for both business accounts. Returns :class:`aiogram.types.story.Story` on success.
+
+ Source: https://core.telegram.org/bots/api#repoststory
+ """
+
+ __returning__ = Story
+ __api_method__ = "repostStory"
+
+ business_connection_id: str
+ """Unique identifier of the business connection"""
+ from_chat_id: int
+ """Unique identifier of the chat which posted the story that should be reposted"""
+ from_story_id: int
+ """Unique identifier of the story that should be reposted"""
+ active_period: int
+ """Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`"""
+ post_to_chat_page: bool | None = None
+ """Pass :code:`True` to keep the story accessible after it expires"""
+ protect_content: bool | None = None
+ """Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting"""
+
+ if TYPE_CHECKING:
+ # DO NOT EDIT MANUALLY!!!
+ # This section was auto-generated via `butcher`
+
+ def __init__(
+ __pydantic__self__,
+ *,
+ business_connection_id: str,
+ from_chat_id: int,
+ from_story_id: int,
+ active_period: int,
+ post_to_chat_page: bool | None = None,
+ protect_content: bool | None = 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__(
+ business_connection_id=business_connection_id,
+ from_chat_id=from_chat_id,
+ from_story_id=from_story_id,
+ active_period=active_period,
+ post_to_chat_page=post_to_chat_page,
+ protect_content=protect_content,
+ **__pydantic_kwargs,
+ )
diff --git a/aiogram/methods/restrict_chat_member.py b/aiogram/methods/restrict_chat_member.py
index 83e87364..88e9b957 100644
--- a/aiogram/methods/restrict_chat_member.py
+++ b/aiogram/methods/restrict_chat_member.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion, ChatPermissions, DateTimeUnion
from .base import TelegramMethod
@@ -22,9 +22,9 @@ class RestrictChatMember(TelegramMethod[bool]):
"""Unique identifier of the target user"""
permissions: ChatPermissions
"""A JSON-serialized object for new user permissions"""
- use_independent_chat_permissions: Optional[bool] = None
+ use_independent_chat_permissions: bool | None = 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[DateTimeUnion] = None
+ until_date: DateTimeUnion | None = 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"""
if TYPE_CHECKING:
@@ -37,8 +37,8 @@ class RestrictChatMember(TelegramMethod[bool]):
chat_id: ChatIdUnion,
user_id: int,
permissions: ChatPermissions,
- use_independent_chat_permissions: Optional[bool] = None,
- until_date: Optional[DateTimeUnion] = None,
+ use_independent_chat_permissions: bool | None = None,
+ until_date: DateTimeUnion | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/save_prepared_inline_message.py b/aiogram/methods/save_prepared_inline_message.py
index aff799bc..30198249 100644
--- a/aiogram/methods/save_prepared_inline_message.py
+++ b/aiogram/methods/save_prepared_inline_message.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import InlineQueryResultUnion, PreparedInlineMessage
from .base import TelegramMethod
@@ -20,13 +20,13 @@ class SavePreparedInlineMessage(TelegramMethod[PreparedInlineMessage]):
"""Unique identifier of the target user that can use the prepared message"""
result: InlineQueryResultUnion
"""A JSON-serialized object describing the message to be sent"""
- allow_user_chats: Optional[bool] = None
+ allow_user_chats: bool | None = None
"""Pass :code:`True` if the message can be sent to private chats with users"""
- allow_bot_chats: Optional[bool] = None
+ allow_bot_chats: bool | None = None
"""Pass :code:`True` if the message can be sent to private chats with bots"""
- allow_group_chats: Optional[bool] = None
+ allow_group_chats: bool | None = None
"""Pass :code:`True` if the message can be sent to group and supergroup chats"""
- allow_channel_chats: Optional[bool] = None
+ allow_channel_chats: bool | None = None
"""Pass :code:`True` if the message can be sent to channel chats"""
if TYPE_CHECKING:
@@ -38,10 +38,10 @@ class SavePreparedInlineMessage(TelegramMethod[PreparedInlineMessage]):
*,
user_id: int,
result: InlineQueryResultUnion,
- allow_user_chats: Optional[bool] = None,
- allow_bot_chats: Optional[bool] = None,
- allow_group_chats: Optional[bool] = None,
- allow_channel_chats: Optional[bool] = None,
+ allow_user_chats: bool | None = None,
+ allow_bot_chats: bool | None = None,
+ allow_group_chats: bool | None = None,
+ allow_channel_chats: bool | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_animation.py b/aiogram/methods/send_animation.py
index 62997db1..931e88c7 100644
--- a/aiogram/methods/send_animation.py
+++ b/aiogram/methods/send_animation.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -32,52 +32,50 @@ class SendAnimation(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
animation: InputFileUnion
"""Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » `"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- duration: Optional[int] = None
+ duration: int | None = None
"""Duration of sent animation in seconds"""
- width: Optional[int] = None
+ width: int | None = None
"""Animation width"""
- height: Optional[int] = None
+ height: int | None = None
"""Animation height"""
- thumbnail: Optional[InputFile] = None
+ thumbnail: InputFile | None = None
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `"""
- caption: Optional[str] = None
+ caption: str | None = None
"""Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing"""
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the animation caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
- show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media")
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media")
"""Pass :code:`True`, if the caption must be shown above the message media"""
- has_spoiler: Optional[bool] = None
+ has_spoiler: bool | None = None
"""Pass :code:`True` if the animation needs to be covered with a spoiler animation"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -92,29 +90,27 @@ class SendAnimation(TelegramMethod[Message]):
*,
chat_id: ChatIdUnion,
animation: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- duration: Optional[int] = None,
- width: Optional[int] = None,
- height: Optional[int] = None,
- thumbnail: Optional[InputFile] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- has_spoiler: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ duration: int | None = None,
+ width: int | None = None,
+ height: int | None = None,
+ thumbnail: InputFile | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ has_spoiler: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_audio.py b/aiogram/methods/send_audio.py
index 2e88ea6f..687d8389 100644
--- a/aiogram/methods/send_audio.py
+++ b/aiogram/methods/send_audio.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -33,48 +33,46 @@ class SendAudio(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
audio: InputFileUnion
"""Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- caption: Optional[str] = None
+ caption: str | None = None
"""Audio caption, 0-1024 characters after entities parsing"""
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the audio caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
- duration: Optional[int] = None
+ duration: int | None = None
"""Duration of the audio in seconds"""
- performer: Optional[str] = None
+ performer: str | None = None
"""Performer"""
- title: Optional[str] = None
+ title: str | None = None
"""Track name"""
- thumbnail: Optional[InputFile] = None
+ thumbnail: InputFile | None = None
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -89,25 +87,25 @@ class SendAudio(TelegramMethod[Message]):
*,
chat_id: ChatIdUnion,
audio: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- duration: Optional[int] = None,
- performer: Optional[str] = None,
- title: Optional[str] = None,
- thumbnail: Optional[InputFile] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ duration: int | None = None,
+ performer: str | None = None,
+ title: str | None = None,
+ thumbnail: InputFile | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_chat_action.py b/aiogram/methods/send_chat_action.py
index 6e5ed5ab..4cc22ad3 100644
--- a/aiogram/methods/send_chat_action.py
+++ b/aiogram/methods/send_chat_action.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion
from .base import TelegramMethod
@@ -24,10 +24,10 @@ class SendChatAction(TelegramMethod[bool]):
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`). Channel chats and channel direct messages chats aren't supported."""
action: str
"""Type of action to broadcast. Choose one, depending on what the user is about to receive: *typing* for `text messages `_, *upload_photo* for `photos `_, *record_video* or *upload_video* for `videos `_, *record_voice* or *upload_voice* for `voice notes `_, *upload_document* for `general files `_, *choose_sticker* for `stickers `_, *find_location* for `location data `_, *record_video_note* or *upload_video_note* for `video notes `_."""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the action will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread; for supergroups only"""
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
@@ -38,8 +38,8 @@ class SendChatAction(TelegramMethod[bool]):
*,
chat_id: ChatIdUnion,
action: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_checklist.py b/aiogram/methods/send_checklist.py
index 1c5c685e..852c8110 100644
--- a/aiogram/methods/send_checklist.py
+++ b/aiogram/methods/send_checklist.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import InlineKeyboardMarkup, InputChecklist, Message, ReplyParameters
from .base import TelegramMethod
@@ -22,15 +22,15 @@ class SendChecklist(TelegramMethod[Message]):
"""Unique identifier for the target chat"""
checklist: InputChecklist
"""A JSON-serialized object for the checklist to send"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message silently. Users will receive a notification with no sound."""
- protect_content: Optional[bool] = None
+ protect_content: bool | None = None
"""Protects the contents of the sent message from forwarding and saving"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message"""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""A JSON-serialized object for description of the message to reply to"""
- reply_markup: Optional[InlineKeyboardMarkup] = None
+ reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for an inline keyboard"""
if TYPE_CHECKING:
@@ -43,11 +43,11 @@ class SendChecklist(TelegramMethod[Message]):
business_connection_id: str,
chat_id: int,
checklist: InputChecklist,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | None = None,
+ message_effect_id: str | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_contact.py b/aiogram/methods/send_contact.py
index 73a81698..1d61b52e 100644
--- a/aiogram/methods/send_contact.py
+++ b/aiogram/methods/send_contact.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -31,38 +31,36 @@ class SendContact(TelegramMethod[Message]):
"""Contact's phone number"""
first_name: str
"""Contact's first name"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- last_name: Optional[str] = None
+ last_name: str | None = None
"""Contact's last name"""
- vcard: Optional[str] = None
+ vcard: str | None = None
"""Additional data about the contact in the form of a `vCard `_, 0-2048 bytes"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -78,20 +76,20 @@ class SendContact(TelegramMethod[Message]):
chat_id: ChatIdUnion,
phone_number: str,
first_name: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- last_name: Optional[str] = None,
- vcard: Optional[str] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ last_name: str | None = None,
+ vcard: str | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_dice.py b/aiogram/methods/send_dice.py
index 356822d2..7abecceb 100644
--- a/aiogram/methods/send_dice.py
+++ b/aiogram/methods/send_dice.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -27,36 +27,34 @@ class SendDice(TelegramMethod[Message]):
chat_id: ChatIdUnion
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- emoji: Optional[str] = None
+ emoji: str | None = None
"""Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲'"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -70,19 +68,19 @@ class SendDice(TelegramMethod[Message]):
__pydantic__self__,
*,
chat_id: ChatIdUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- emoji: Optional[str] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ emoji: str | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_document.py b/aiogram/methods/send_document.py
index fdb58431..bd03df8b 100644
--- a/aiogram/methods/send_document.py
+++ b/aiogram/methods/send_document.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -32,44 +32,42 @@ class SendDocument(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
document: InputFileUnion
"""File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- thumbnail: Optional[InputFile] = None
+ thumbnail: InputFile | None = None
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `"""
- caption: Optional[str] = None
+ caption: str | None = None
"""Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing"""
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the document caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
- disable_content_type_detection: Optional[bool] = None
+ disable_content_type_detection: bool | None = None
"""Disables automatic server-side content type detection for files uploaded using multipart/form-data"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -84,23 +82,23 @@ class SendDocument(TelegramMethod[Message]):
*,
chat_id: ChatIdUnion,
document: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- thumbnail: Optional[InputFile] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- disable_content_type_detection: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ thumbnail: InputFile | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ disable_content_type_detection: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_game.py b/aiogram/methods/send_game.py
index 2d69e8a9..dfea029c 100644
--- a/aiogram/methods/send_game.py
+++ b/aiogram/methods/send_game.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -23,30 +23,28 @@ class SendGame(TelegramMethod[Message]):
"""Unique identifier for the target chat. Games can't be sent to channel direct messages chats and channel chats."""
game_short_name: str
"""Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_."""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- disable_notification: Optional[bool] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[InlineKeyboardMarkup] = None
+ reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game."""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -61,16 +59,16 @@ class SendGame(TelegramMethod[Message]):
*,
chat_id: int,
game_short_name: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_gift.py b/aiogram/methods/send_gift.py
index 4f8b444a..17107a3d 100644
--- a/aiogram/methods/send_gift.py
+++ b/aiogram/methods/send_gift.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import ChatIdUnion
from ..types.message_entity import MessageEntity
@@ -18,18 +18,18 @@ class SendGift(TelegramMethod[bool]):
__api_method__ = "sendGift"
gift_id: str
- """Identifier of the gift"""
- user_id: Optional[int] = None
+ """Identifier of the gift; limited gifts can't be sent to channel chats"""
+ user_id: int | None = None
"""Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift."""
- chat_id: Optional[ChatIdUnion] = None
+ chat_id: ChatIdUnion | None = None
"""Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift."""
- pay_for_upgrade: Optional[bool] = None
+ pay_for_upgrade: bool | None = None
"""Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver"""
- text: Optional[str] = None
+ text: str | None = None
"""Text that will be shown along with the gift; 0-128 characters"""
- text_parse_mode: Optional[str] = None
+ text_parse_mode: str | None = None
"""Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
- text_entities: Optional[list[MessageEntity]] = None
+ text_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
if TYPE_CHECKING:
@@ -40,12 +40,12 @@ class SendGift(TelegramMethod[bool]):
__pydantic__self__,
*,
gift_id: str,
- user_id: Optional[int] = None,
- chat_id: Optional[ChatIdUnion] = None,
- pay_for_upgrade: Optional[bool] = None,
- text: Optional[str] = None,
- text_parse_mode: Optional[str] = None,
- text_entities: Optional[list[MessageEntity]] = None,
+ user_id: int | None = None,
+ chat_id: ChatIdUnion | None = None,
+ pay_for_upgrade: bool | None = None,
+ text: str | None = None,
+ text_parse_mode: str | None = None,
+ text_entities: list[MessageEntity] | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_invoice.py b/aiogram/methods/send_invoice.py
index f1e83926..0c1d6bea 100644
--- a/aiogram/methods/send_invoice.py
+++ b/aiogram/methods/send_invoice.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -38,64 +38,62 @@ class SendInvoice(TelegramMethod[Message]):
"""Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_."""
prices: list[LabeledPrice]
"""Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_."""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- provider_token: Optional[str] = None
+ provider_token: str | None = None
"""Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_."""
- max_tip_amount: Optional[int] = None
+ max_tip_amount: int | None = None
"""The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_."""
- suggested_tip_amounts: Optional[list[int]] = None
+ suggested_tip_amounts: list[int] | None = None
"""A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*."""
- start_parameter: Optional[str] = None
+ start_parameter: str | None = None
"""Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter"""
- provider_data: Optional[str] = None
+ provider_data: str | None = None
"""JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider."""
- photo_url: Optional[str] = None
+ photo_url: str | None = None
"""URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for."""
- photo_size: Optional[int] = None
+ photo_size: int | None = None
"""Photo size in bytes"""
- photo_width: Optional[int] = None
+ photo_width: int | None = None
"""Photo width"""
- photo_height: Optional[int] = None
+ photo_height: int | None = None
"""Photo height"""
- need_name: Optional[bool] = None
+ need_name: bool | None = None
"""Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_."""
- need_phone_number: Optional[bool] = None
+ need_phone_number: bool | None = None
"""Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_."""
- need_email: Optional[bool] = None
+ need_email: bool | None = None
"""Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_."""
- need_shipping_address: Optional[bool] = None
+ need_shipping_address: bool | None = None
"""Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_."""
- send_phone_number_to_provider: Optional[bool] = None
+ send_phone_number_to_provider: bool | None = None
"""Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_."""
- send_email_to_provider: Optional[bool] = None
+ send_email_to_provider: bool | None = None
"""Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_."""
- is_flexible: Optional[bool] = None
+ is_flexible: bool | None = None
"""Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_."""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[InlineKeyboardMarkup] = None
+ reply_markup: InlineKeyboardMarkup | None = None
"""A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button."""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -114,33 +112,33 @@ class SendInvoice(TelegramMethod[Message]):
payload: str,
currency: str,
prices: list[LabeledPrice],
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- provider_token: Optional[str] = None,
- max_tip_amount: Optional[int] = None,
- suggested_tip_amounts: Optional[list[int]] = None,
- start_parameter: Optional[str] = None,
- provider_data: Optional[str] = None,
- photo_url: Optional[str] = None,
- photo_size: Optional[int] = None,
- photo_width: Optional[int] = None,
- photo_height: Optional[int] = None,
- need_name: Optional[bool] = None,
- need_phone_number: Optional[bool] = None,
- need_email: Optional[bool] = None,
- need_shipping_address: Optional[bool] = None,
- send_phone_number_to_provider: Optional[bool] = None,
- send_email_to_provider: Optional[bool] = None,
- is_flexible: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[InlineKeyboardMarkup] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ provider_token: str | None = None,
+ max_tip_amount: int | None = None,
+ suggested_tip_amounts: list[int] | None = None,
+ start_parameter: str | None = None,
+ provider_data: str | None = None,
+ photo_url: str | None = None,
+ photo_size: int | None = None,
+ photo_width: int | None = None,
+ photo_height: int | None = None,
+ need_name: bool | None = None,
+ need_phone_number: bool | None = None,
+ need_email: bool | None = None,
+ need_shipping_address: bool | None = None,
+ send_phone_number_to_provider: bool | None = None,
+ send_email_to_provider: bool | None = None,
+ is_flexible: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: InlineKeyboardMarkup | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_location.py b/aiogram/methods/send_location.py
index f058b49e..4a8ee223 100644
--- a/aiogram/methods/send_location.py
+++ b/aiogram/methods/send_location.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -31,42 +31,40 @@ class SendLocation(TelegramMethod[Message]):
"""Latitude of the location"""
longitude: float
"""Longitude of the location"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- horizontal_accuracy: Optional[float] = None
+ horizontal_accuracy: float | None = None
"""The radius of uncertainty for the location, measured in meters; 0-1500"""
- live_period: Optional[int] = None
+ live_period: int | None = None
"""Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely."""
- heading: Optional[int] = None
+ heading: int | None = None
"""For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."""
- proximity_alert_radius: Optional[int] = None
+ proximity_alert_radius: int | None = None
"""For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -82,22 +80,22 @@ class SendLocation(TelegramMethod[Message]):
chat_id: ChatIdUnion,
latitude: float,
longitude: float,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- horizontal_accuracy: Optional[float] = None,
- live_period: Optional[int] = None,
- heading: Optional[int] = None,
- proximity_alert_radius: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ horizontal_accuracy: float | None = None,
+ live_period: int | None = None,
+ heading: int | None = None,
+ proximity_alert_radius: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_media_group.py b/aiogram/methods/send_media_group.py
index 5b7bff0d..d5d57749 100644
--- a/aiogram/methods/send_media_group.py
+++ b/aiogram/methods/send_media_group.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -23,30 +23,28 @@ class SendMediaGroup(TelegramMethod[list[Message]]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
media: list[MediaUnion]
"""A JSON-serialized array describing messages to be sent, must include 2-10 items"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends messages `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent messages from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the messages are a reply, ID of the original message
.. deprecated:: API:7.0
@@ -61,16 +59,16 @@ class SendMediaGroup(TelegramMethod[list[Message]]):
*,
chat_id: ChatIdUnion,
media: list[MediaUnion],
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_message.py b/aiogram/methods/send_message.py
index 223da039..0997803e 100644
--- a/aiogram/methods/send_message.py
+++ b/aiogram/methods/send_message.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -31,47 +31,45 @@ class SendMessage(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
text: str
"""Text of the message to be sent, 1-4096 characters after entities parsing"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the message text. See `formatting options `_ for more details."""
- entities: Optional[list[MessageEntity]] = None
+ entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*"""
- link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default("link_preview")
+ link_preview_options: LinkPreviewOptions | Default | None = Default("link_preview")
"""Link preview generation options for the message"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- disable_web_page_preview: Optional[Union[bool, Default]] = Field(
+ disable_web_page_preview: bool | Default | None = Field(
Default("link_preview_is_disabled"), json_schema_extra={"deprecated": True}
)
"""Disables link previews for links in this message
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -86,26 +84,22 @@ class SendMessage(TelegramMethod[Message]):
*,
chat_id: ChatIdUnion,
text: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- entities: Optional[list[MessageEntity]] = None,
- link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
- "link_preview"
- ),
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- disable_web_page_preview: Optional[Union[bool, Default]] = Default(
- "link_preview_is_disabled"
- ),
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ entities: list[MessageEntity] | None = None,
+ link_preview_options: LinkPreviewOptions | Default | None = Default("link_preview"),
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ disable_web_page_preview: bool | Default | None = Default("link_preview_is_disabled"),
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_message_draft.py b/aiogram/methods/send_message_draft.py
new file mode 100644
index 00000000..6124f73e
--- /dev/null
+++ b/aiogram/methods/send_message_draft.py
@@ -0,0 +1,59 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any
+
+from ..types import MessageEntity
+from .base import TelegramMethod
+
+
+class SendMessageDraft(TelegramMethod[bool]):
+ """
+ Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns :code:`True` on success.
+
+ Source: https://core.telegram.org/bots/api#sendmessagedraft
+ """
+
+ __returning__ = bool
+ __api_method__ = "sendMessageDraft"
+
+ chat_id: int
+ """Unique identifier for the target private chat"""
+ draft_id: int
+ """Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated"""
+ text: str
+ """Text of the message to be sent, 1-4096 characters after entities parsing"""
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread"""
+ parse_mode: str | None = None
+ """Mode for parsing entities in the message text. See `formatting options `_ for more details."""
+ entities: list[MessageEntity] | None = None
+ """A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*"""
+
+ if TYPE_CHECKING:
+ # DO NOT EDIT MANUALLY!!!
+ # This section was auto-generated via `butcher`
+
+ def __init__(
+ __pydantic__self__,
+ *,
+ chat_id: int,
+ draft_id: int,
+ text: str,
+ message_thread_id: int | None = None,
+ parse_mode: str | None = None,
+ entities: list[MessageEntity] | None = 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__(
+ chat_id=chat_id,
+ draft_id=draft_id,
+ text=text,
+ message_thread_id=message_thread_id,
+ parse_mode=parse_mode,
+ entities=entities,
+ **__pydantic_kwargs,
+ )
diff --git a/aiogram/methods/send_paid_media.py b/aiogram/methods/send_paid_media.py
index ef89d2c0..3d9cfec6 100644
--- a/aiogram/methods/send_paid_media.py
+++ b/aiogram/methods/send_paid_media.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional
+from typing import TYPE_CHECKING, Any
from ..types import (
ChatIdUnion,
@@ -27,36 +27,36 @@ class SendPaidMedia(TelegramMethod[Message]):
chat_id: ChatIdUnion
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance."""
star_count: int
- """The number of Telegram Stars that must be paid to buy access to the media; 1-10000"""
+ """The number of Telegram Stars that must be paid to buy access to the media; 1-25000"""
media: list[InputPaidMediaUnion]
"""A JSON-serialized array describing the media to be sent; up to 10 items"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- payload: Optional[str] = None
+ payload: str | None = None
"""Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes."""
- caption: Optional[str] = None
+ caption: str | None = None
"""Media caption, 0-1024 characters after entities parsing"""
- parse_mode: Optional[str] = None
+ parse_mode: str | None = None
"""Mode for parsing entities in the media caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
- show_caption_above_media: Optional[bool] = None
+ show_caption_above_media: bool | None = None
"""Pass :code:`True`, if the caption must be shown above the message media"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[bool] = None
+ protect_content: bool | None = None
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
if TYPE_CHECKING:
@@ -69,20 +69,20 @@ class SendPaidMedia(TelegramMethod[Message]):
chat_id: ChatIdUnion,
star_count: int,
media: list[InputPaidMediaUnion],
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- payload: Optional[str] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[str] = None,
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[bool] = None,
- allow_paid_broadcast: Optional[bool] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ payload: str | None = None,
+ caption: str | None = None,
+ parse_mode: str | None = None,
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | None = None,
+ allow_paid_broadcast: bool | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_photo.py b/aiogram/methods/send_photo.py
index e7028462..83480f6a 100644
--- a/aiogram/methods/send_photo.py
+++ b/aiogram/methods/send_photo.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -31,44 +31,42 @@ class SendPhoto(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
photo: InputFileUnion
"""Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » `"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- caption: Optional[str] = None
+ caption: str | None = None
"""Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing"""
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the photo caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
- show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media")
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media")
"""Pass :code:`True`, if the caption must be shown above the message media"""
- has_spoiler: Optional[bool] = None
+ has_spoiler: bool | None = None
"""Pass :code:`True` if the photo needs to be covered with a spoiler animation"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -83,25 +81,23 @@ class SendPhoto(TelegramMethod[Message]):
*,
chat_id: ChatIdUnion,
photo: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- has_spoiler: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ has_spoiler: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_poll.py b/aiogram/methods/send_poll.py
index 56c48acb..01979ff1 100644
--- a/aiogram/methods/send_poll.py
+++ b/aiogram/methods/send_poll.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -33,54 +33,52 @@ class SendPoll(TelegramMethod[Message]):
"""Poll question, 1-300 characters"""
options: list[InputPollOptionUnion]
"""A JSON-serialized list of 2-12 answer options"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ question_parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed"""
- question_entities: Optional[list[MessageEntity]] = None
+ question_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode*"""
- is_anonymous: Optional[bool] = None
+ is_anonymous: bool | None = None
""":code:`True`, if the poll needs to be anonymous, defaults to :code:`True`"""
- type: Optional[str] = None
+ type: str | None = None
"""Poll type, 'quiz' or 'regular', defaults to 'regular'"""
- allows_multiple_answers: Optional[bool] = None
+ allows_multiple_answers: bool | None = None
""":code:`True`, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False`"""
- correct_option_id: Optional[int] = None
+ correct_option_id: int | None = None
"""0-based identifier of the correct answer option, required for polls in quiz mode"""
- explanation: Optional[str] = None
+ explanation: str | None = None
"""Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing"""
- explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ explanation_parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the explanation. See `formatting options `_ for more details."""
- explanation_entities: Optional[list[MessageEntity]] = None
+ explanation_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode*"""
- open_period: Optional[int] = None
+ open_period: int | None = None
"""Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*."""
- close_date: Optional[DateTimeUnion] = None
+ close_date: DateTimeUnion | None = None
"""Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*."""
- is_closed: Optional[bool] = None
+ is_closed: bool | None = None
"""Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview."""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -96,28 +94,28 @@ class SendPoll(TelegramMethod[Message]):
chat_id: ChatIdUnion,
question: str,
options: list[InputPollOptionUnion],
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- question_entities: Optional[list[MessageEntity]] = None,
- is_anonymous: Optional[bool] = None,
- type: Optional[str] = None,
- allows_multiple_answers: Optional[bool] = None,
- correct_option_id: Optional[int] = None,
- explanation: Optional[str] = None,
- explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- explanation_entities: Optional[list[MessageEntity]] = None,
- open_period: Optional[int] = None,
- close_date: Optional[DateTimeUnion] = None,
- is_closed: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ question_parse_mode: str | Default | None = Default("parse_mode"),
+ question_entities: list[MessageEntity] | None = None,
+ is_anonymous: bool | None = None,
+ type: str | None = None,
+ allows_multiple_answers: bool | None = None,
+ correct_option_id: int | None = None,
+ explanation: str | None = None,
+ explanation_parse_mode: str | Default | None = Default("parse_mode"),
+ explanation_entities: list[MessageEntity] | None = None,
+ open_period: int | None = None,
+ close_date: DateTimeUnion | None = None,
+ is_closed: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_sticker.py b/aiogram/methods/send_sticker.py
index 6f44f990..683b3970 100644
--- a/aiogram/methods/send_sticker.py
+++ b/aiogram/methods/send_sticker.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -30,36 +30,34 @@ class SendSticker(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
sticker: InputFileUnion
"""Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL."""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- emoji: Optional[str] = None
+ emoji: str | None = None
"""Emoji associated with the sticker; only for just uploaded stickers"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -74,19 +72,19 @@ class SendSticker(TelegramMethod[Message]):
*,
chat_id: ChatIdUnion,
sticker: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- emoji: Optional[str] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ emoji: str | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_venue.py b/aiogram/methods/send_venue.py
index dd2b92ed..677516f9 100644
--- a/aiogram/methods/send_venue.py
+++ b/aiogram/methods/send_venue.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -35,42 +35,40 @@ class SendVenue(TelegramMethod[Message]):
"""Name of the venue"""
address: str
"""Address of the venue"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- foursquare_id: Optional[str] = None
+ foursquare_id: str | None = None
"""Foursquare identifier of the venue"""
- foursquare_type: Optional[str] = None
+ foursquare_type: str | None = None
"""Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.)"""
- google_place_id: Optional[str] = None
+ google_place_id: str | None = None
"""Google Places identifier of the venue"""
- google_place_type: Optional[str] = None
+ google_place_type: str | None = None
"""Google Places type of the venue. (See `supported types `_.)"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -88,22 +86,22 @@ class SendVenue(TelegramMethod[Message]):
longitude: float,
title: str,
address: str,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- foursquare_id: Optional[str] = None,
- foursquare_type: Optional[str] = None,
- google_place_id: Optional[str] = None,
- google_place_type: Optional[str] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ foursquare_id: str | None = None,
+ foursquare_type: str | None = None,
+ google_place_id: str | None = None,
+ google_place_type: str | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_video.py b/aiogram/methods/send_video.py
index a09d17e7..c8112e21 100644
--- a/aiogram/methods/send_video.py
+++ b/aiogram/methods/send_video.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -33,58 +33,56 @@ class SendVideo(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
video: InputFileUnion
"""Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- duration: Optional[int] = None
+ duration: int | None = None
"""Duration of sent video in seconds"""
- width: Optional[int] = None
+ width: int | None = None
"""Video width"""
- height: Optional[int] = None
+ height: int | None = None
"""Video height"""
- thumbnail: Optional[InputFile] = None
+ thumbnail: InputFile | None = None
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `"""
- cover: Optional[InputFileUnion] = None
+ cover: InputFileUnion | None = None
"""Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `"""
- start_timestamp: Optional[DateTimeUnion] = None
+ start_timestamp: DateTimeUnion | None = None
"""Start timestamp for the video in the message"""
- caption: Optional[str] = None
+ caption: str | None = None
"""Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing"""
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
+ parse_mode: str | Default | None = Default("parse_mode")
"""Mode for parsing entities in the video caption. See `formatting options `_ for more details."""
- caption_entities: Optional[list[MessageEntity]] = None
+ caption_entities: list[MessageEntity] | None = None
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
- show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media")
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media")
"""Pass :code:`True`, if the caption must be shown above the message media"""
- has_spoiler: Optional[bool] = None
+ has_spoiler: bool | None = None
"""Pass :code:`True` if the video needs to be covered with a spoiler animation"""
- supports_streaming: Optional[bool] = None
+ supports_streaming: bool | None = None
"""Pass :code:`True` if the uploaded video is suitable for streaming"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -99,32 +97,30 @@ class SendVideo(TelegramMethod[Message]):
*,
chat_id: ChatIdUnion,
video: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- duration: Optional[int] = None,
- width: Optional[int] = None,
- height: Optional[int] = None,
- thumbnail: Optional[InputFile] = None,
- cover: Optional[InputFileUnion] = None,
- start_timestamp: Optional[DateTimeUnion] = None,
- caption: Optional[str] = None,
- parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[list[MessageEntity]] = None,
- show_caption_above_media: Optional[Union[bool, Default]] = Default(
- "show_caption_above_media"
- ),
- has_spoiler: Optional[bool] = None,
- supports_streaming: Optional[bool] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ duration: int | None = None,
+ width: int | None = None,
+ height: int | None = None,
+ thumbnail: InputFile | None = None,
+ cover: InputFileUnion | None = None,
+ start_timestamp: DateTimeUnion | None = None,
+ caption: str | None = None,
+ parse_mode: str | Default | None = Default("parse_mode"),
+ caption_entities: list[MessageEntity] | None = None,
+ show_caption_above_media: bool | Default | None = Default("show_caption_above_media"),
+ has_spoiler: bool | None = None,
+ supports_streaming: bool | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_video_note.py b/aiogram/methods/send_video_note.py
index ec036ca6..2f5195e7 100644
--- a/aiogram/methods/send_video_note.py
+++ b/aiogram/methods/send_video_note.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -31,40 +31,38 @@ class SendVideoNote(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
video_note: InputFileUnion
"""Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `. Sending video notes by a URL is currently unsupported"""
- business_connection_id: Optional[str] = None
+ business_connection_id: str | None = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
- message_thread_id: Optional[int] = None
- """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
- direct_messages_topic_id: Optional[int] = None
+ message_thread_id: int | None = None
+ """Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only"""
+ direct_messages_topic_id: int | None = None
"""Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat"""
- duration: Optional[int] = None
+ duration: int | None = None
"""Duration of sent video in seconds"""
- length: Optional[int] = None
+ length: int | None = None
"""Video width and height, i.e. diameter of the video message"""
- thumbnail: Optional[InputFile] = None
+ thumbnail: InputFile | None = None
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `"""
- disable_notification: Optional[bool] = None
+ disable_notification: bool | None = None
"""Sends the message `silently `_. Users will receive a notification with no sound."""
- protect_content: Optional[Union[bool, Default]] = Default("protect_content")
+ protect_content: bool | Default | None = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
- allow_paid_broadcast: Optional[bool] = None
+ allow_paid_broadcast: bool | None = None
"""Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits `_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance"""
- message_effect_id: Optional[str] = None
+ message_effect_id: str | None = None
"""Unique identifier of the message effect to be added to the message; for private chats only"""
- suggested_post_parameters: Optional[SuggestedPostParameters] = None
+ suggested_post_parameters: SuggestedPostParameters | None = None
"""A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined."""
- reply_parameters: Optional[ReplyParameters] = None
+ reply_parameters: ReplyParameters | None = None
"""Description of the message to reply to"""
- reply_markup: Optional[ReplyMarkupUnion] = None
+ reply_markup: ReplyMarkupUnion | None = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user"""
- allow_sending_without_reply: Optional[bool] = Field(
- None, json_schema_extra={"deprecated": True}
- )
+ allow_sending_without_reply: bool | None = Field(None, json_schema_extra={"deprecated": True})
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
.. deprecated:: API:7.0
https://core.telegram.org/bots/api-changelog#december-29-2023"""
- reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
+ reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
"""If the message is a reply, ID of the original message
.. deprecated:: API:7.0
@@ -79,21 +77,21 @@ class SendVideoNote(TelegramMethod[Message]):
*,
chat_id: ChatIdUnion,
video_note: InputFileUnion,
- business_connection_id: Optional[str] = None,
- message_thread_id: Optional[int] = None,
- direct_messages_topic_id: Optional[int] = None,
- duration: Optional[int] = None,
- length: Optional[int] = None,
- thumbnail: Optional[InputFile] = None,
- disable_notification: Optional[bool] = None,
- protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
- allow_paid_broadcast: Optional[bool] = None,
- message_effect_id: Optional[str] = None,
- suggested_post_parameters: Optional[SuggestedPostParameters] = None,
- reply_parameters: Optional[ReplyParameters] = None,
- reply_markup: Optional[ReplyMarkupUnion] = None,
- allow_sending_without_reply: Optional[bool] = None,
- reply_to_message_id: Optional[int] = None,
+ business_connection_id: str | None = None,
+ message_thread_id: int | None = None,
+ direct_messages_topic_id: int | None = None,
+ duration: int | None = None,
+ length: int | None = None,
+ thumbnail: InputFile | None = None,
+ disable_notification: bool | None = None,
+ protect_content: bool | Default | None = Default("protect_content"),
+ allow_paid_broadcast: bool | None = None,
+ message_effect_id: str | None = None,
+ suggested_post_parameters: SuggestedPostParameters | None = None,
+ reply_parameters: ReplyParameters | None = None,
+ reply_markup: ReplyMarkupUnion | None = None,
+ allow_sending_without_reply: bool | None = None,
+ reply_to_message_id: int | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_voice.py b/aiogram/methods/send_voice.py
index d47f208a..c1ddd298 100644
--- a/aiogram/methods/send_voice.py
+++ b/aiogram/methods/send_voice.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, Optional, Union
+from typing import TYPE_CHECKING, Any
from pydantic import Field
@@ -31,42 +31,40 @@ class SendVoice(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
voice: InputFileUnion
"""Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files »