`_ 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,
diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json
index c4882dd0..e336e035 100644
--- a/.butcher/schema/schema.json
+++ b/.butcher/schema/schema.json
@@ -1,7 +1,7 @@
{
"api": {
- "version": "7.10",
- "release_date": "2024-09-06"
+ "version": "7.11",
+ "release_date": "2024-10-31"
},
"items": [
{
@@ -985,9 +985,9 @@
"annotations": [
{
"type": "Integer",
- "description": "Unique message identifier inside this chat",
- "html_description": "| Unique message identifier inside this chat | ",
- "rst_description": "Unique message identifier inside this chat\n",
+ "description": "Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent",
+ "html_description": "Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent | ",
+ "rst_description": "Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent\n",
"name": "message_id",
"required": true
},
@@ -1675,9 +1675,9 @@
"annotations": [
{
"type": "Integer",
- "description": "Unique message identifier",
- "html_description": "Unique message identifier | ",
- "rst_description": "Unique message identifier\n",
+ "description": "Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent",
+ "html_description": "Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent | ",
+ "rst_description": "Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent\n",
"name": "message_id",
"required": true
}
@@ -1736,9 +1736,9 @@
"annotations": [
{
"type": "String",
- "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)",
- "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) | ",
- "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n",
+ "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag or #hashtag@chatusername), 'cashtag' ($USD or $USD@chatusername), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)",
+ "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) | ",
+ "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag` or :code:`#hashtag@chatusername`), 'cashtag' (:code:`$USD` or :code:`$USD@chatusername`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n",
"name": "type",
"required": true
},
@@ -4839,6 +4839,14 @@
"name": "switch_inline_query_chosen_chat",
"required": false
},
+ {
+ "type": "CopyTextButton",
+ "description": "Description of the button that copies the specified text to the clipboard.",
+ "html_description": "Optional. Description of the button that copies the specified text to the clipboard. | ",
+ "rst_description": "*Optional*. Description of the button that copies the specified text to the clipboard.\n",
+ "name": "copy_text",
+ "required": false
+ },
{
"type": "CallbackGame",
"description": "Description of the game that will be launched when the user presses the button.\n\nNOTE: This type of button must always be the first button in the first row.",
@@ -4950,6 +4958,24 @@
],
"category": "types"
},
+ {
+ "anchor": "copytextbutton",
+ "name": "CopyTextButton",
+ "description": "This object represents an inline keyboard button that copies specified text to the clipboard.",
+ "html_description": "This object represents an inline keyboard button that copies specified text to the clipboard.
",
+ "rst_description": "This object represents an inline keyboard button that copies specified text to the clipboard.",
+ "annotations": [
+ {
+ "type": "String",
+ "description": "The text to be copied to the clipboard; 1-256 characters",
+ "html_description": "The text to be copied to the clipboard; 1-256 characters | ",
+ "rst_description": "The text to be copied to the clipboard; 1-256 characters\n",
+ "name": "text",
+ "required": true
+ }
+ ],
+ "category": "types"
+ },
{
"anchor": "callbackquery",
"name": "CallbackQuery",
@@ -7795,6 +7821,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -8025,6 +8059,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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": "ReplyParameters",
"required": false,
@@ -8205,6 +8247,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -8343,6 +8393,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -8465,6 +8523,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -8627,6 +8693,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -8781,6 +8855,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -8895,6 +8977,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -9001,6 +9091,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -9123,6 +9221,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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": "ReplyParameters",
"required": false,
@@ -9197,6 +9303,14 @@
"rst_description": "Protects the contents of the sent messages from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -9311,6 +9425,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -9449,6 +9571,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -9555,6 +9685,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -9741,6 +9879,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -9823,6 +9969,14 @@
"rst_description": "Protects the contents of the sent message from forwarding\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -11877,9 +12031,9 @@
{
"anchor": "editmessagemedia",
"name": "editMessageMedia",
- "description": "Use this method to edit animation, audio, document, photo, or video 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 Message is returned, otherwise 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.",
- "html_description": "Use this method to edit animation, audio, document, photo, or video 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 Message is returned, otherwise 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.
",
- "rst_description": "Use this method to edit animation, audio, document, photo, or video 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.",
+ "description": "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 Message is returned, otherwise 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.",
+ "html_description": "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 Message is returned, otherwise 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.
",
+ "rst_description": "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.",
"annotations": [
{
"type": "String",
@@ -12566,6 +12720,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -15892,6 +16054,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
@@ -16759,9 +16929,9 @@
{
"anchor": "transactionpartner",
"name": "TransactionPartner",
- "description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n - TransactionPartnerUser\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerOther",
- "html_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
",
- "rst_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n\n - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`\n - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment`\n - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds`\n - :class:`aiogram.types.transaction_partner_other.TransactionPartnerOther`",
+ "description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n - TransactionPartnerUser\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - TransactionPartnerOther",
+ "html_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
",
+ "rst_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n\n - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`\n - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment`\n - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds`\n - :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi`\n - :class:`aiogram.types.transaction_partner_other.TransactionPartnerOther`",
"annotations": [],
"category": "types"
},
@@ -16859,6 +17029,32 @@
],
"category": "types"
},
+ {
+ "anchor": "transactionpartnertelegramapi",
+ "name": "TransactionPartnerTelegramApi",
+ "description": "Describes a transaction with payment for paid broadcasting.",
+ "html_description": "Describes a transaction with payment for paid broadcasting.
",
+ "rst_description": "Describes a transaction with payment for `paid broadcasting `_.",
+ "annotations": [
+ {
+ "type": "String",
+ "description": "Type of the transaction partner, always 'telegram_api'",
+ "html_description": "Type of the transaction partner, always “telegram_api” | ",
+ "rst_description": "Type of the transaction partner, always 'telegram_api'\n",
+ "name": "type",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "The number of successful requests that exceeded regular limits and were therefore billed",
+ "html_description": "The number of successful requests that exceeded regular limits and were therefore billed | ",
+ "rst_description": "The number of successful requests that exceeded regular limits and were therefore billed\n",
+ "name": "request_count",
+ "required": true
+ }
+ ],
+ "category": "types"
+ },
{
"anchor": "transactionpartnerother",
"name": "TransactionPartnerOther",
@@ -16886,9 +17082,9 @@
"annotations": [
{
"type": "String",
- "description": "Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.",
- "html_description": "Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. | ",
- "rst_description": "Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with *SuccessfulPayment.telegram_payment_charge_id* for successful incoming payments from users.\n",
+ "description": "Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.",
+ "html_description": "Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. | ",
+ "rst_description": "Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with *SuccessfulPayment.telegram_payment_charge_id* for successful incoming payments from users.\n",
"name": "id",
"required": true
},
@@ -17627,6 +17823,14 @@
"rst_description": "Protects the contents of the sent message from forwarding and saving\n",
"name": "protect_content"
},
+ {
+ "type": "Boolean",
+ "required": false,
+ "description": "Pass 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",
+ "html_description": "Pass 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 | ",
+ "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,
diff --git a/.butcher/types/CopyTextButton/entity.json b/.butcher/types/CopyTextButton/entity.json
new file mode 100644
index 00000000..cafe2a36
--- /dev/null
+++ b/.butcher/types/CopyTextButton/entity.json
@@ -0,0 +1,25 @@
+{
+ "meta": {},
+ "group": {
+ "title": "Available types",
+ "anchor": "available-types"
+ },
+ "object": {
+ "anchor": "copytextbutton",
+ "name": "CopyTextButton",
+ "description": "This object represents an inline keyboard button that copies specified text to the clipboard.",
+ "html_description": "This object represents an inline keyboard button that copies specified text to the clipboard.
",
+ "rst_description": "This object represents an inline keyboard button that copies specified text to the clipboard.",
+ "annotations": [
+ {
+ "type": "String",
+ "description": "The text to be copied to the clipboard; 1-256 characters",
+ "html_description": "The text to be copied to the clipboard; 1-256 characters | ",
+ "rst_description": "The text to be copied to the clipboard; 1-256 characters\n",
+ "name": "text",
+ "required": true
+ }
+ ],
+ "category": "types"
+ }
+}
diff --git a/.butcher/types/InlineKeyboardButton/entity.json b/.butcher/types/InlineKeyboardButton/entity.json
index 7476ee56..036fc7de 100644
--- a/.butcher/types/InlineKeyboardButton/entity.json
+++ b/.butcher/types/InlineKeyboardButton/entity.json
@@ -75,6 +75,14 @@
"name": "switch_inline_query_chosen_chat",
"required": false
},
+ {
+ "type": "CopyTextButton",
+ "description": "Description of the button that copies the specified text to the clipboard.",
+ "html_description": "Optional. Description of the button that copies the specified text to the clipboard. | ",
+ "rst_description": "*Optional*. Description of the button that copies the specified text to the clipboard.\n",
+ "name": "copy_text",
+ "required": false
+ },
{
"type": "CallbackGame",
"description": "Description of the game that will be launched when the user presses the button.\n\nNOTE: This type of button must always be the first button in the first row.",
diff --git a/.butcher/types/Message/entity.json b/.butcher/types/Message/entity.json
index 7e31e2af..86667ca8 100644
--- a/.butcher/types/Message/entity.json
+++ b/.butcher/types/Message/entity.json
@@ -13,9 +13,9 @@
"annotations": [
{
"type": "Integer",
- "description": "Unique message identifier inside this chat",
- "html_description": "Unique message identifier inside this chat | ",
- "rst_description": "Unique message identifier inside this chat\n",
+ "description": "Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent",
+ "html_description": "Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent | ",
+ "rst_description": "Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent\n",
"name": "message_id",
"required": true
},
diff --git a/.butcher/types/MessageEntity/entity.json b/.butcher/types/MessageEntity/entity.json
index 1ffb569b..8d5a1d13 100644
--- a/.butcher/types/MessageEntity/entity.json
+++ b/.butcher/types/MessageEntity/entity.json
@@ -13,9 +13,9 @@
"annotations": [
{
"type": "String",
- "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)",
- "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) | ",
- "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n",
+ "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag or #hashtag@chatusername), 'cashtag' ($USD or $USD@chatusername), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)",
+ "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) | ",
+ "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag` or :code:`#hashtag@chatusername`), 'cashtag' (:code:`$USD` or :code:`$USD@chatusername`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n",
"name": "type",
"required": true
},
diff --git a/.butcher/types/MessageId/entity.json b/.butcher/types/MessageId/entity.json
index 69fce170..a886bf17 100644
--- a/.butcher/types/MessageId/entity.json
+++ b/.butcher/types/MessageId/entity.json
@@ -13,9 +13,9 @@
"annotations": [
{
"type": "Integer",
- "description": "Unique message identifier",
- "html_description": "Unique message identifier | ",
- "rst_description": "Unique message identifier\n",
+ "description": "Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent",
+ "html_description": "Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent | ",
+ "rst_description": "Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent\n",
"name": "message_id",
"required": true
}
diff --git a/.butcher/types/StarTransaction/entity.json b/.butcher/types/StarTransaction/entity.json
index 41879b25..775b96ca 100644
--- a/.butcher/types/StarTransaction/entity.json
+++ b/.butcher/types/StarTransaction/entity.json
@@ -13,9 +13,9 @@
"annotations": [
{
"type": "String",
- "description": "Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.",
- "html_description": "Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. | ",
- "rst_description": "Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with *SuccessfulPayment.telegram_payment_charge_id* for successful incoming payments from users.\n",
+ "description": "Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.",
+ "html_description": "Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. | ",
+ "rst_description": "Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with *SuccessfulPayment.telegram_payment_charge_id* for successful incoming payments from users.\n",
"name": "id",
"required": true
},
diff --git a/.butcher/types/TransactionPartner/entity.json b/.butcher/types/TransactionPartner/entity.json
index ae4ca0e6..d8e38c67 100644
--- a/.butcher/types/TransactionPartner/entity.json
+++ b/.butcher/types/TransactionPartner/entity.json
@@ -7,9 +7,9 @@
"object": {
"anchor": "transactionpartner",
"name": "TransactionPartner",
- "description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n - TransactionPartnerUser\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerOther",
- "html_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
",
- "rst_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n\n - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`\n - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment`\n - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds`\n - :class:`aiogram.types.transaction_partner_other.TransactionPartnerOther`",
+ "description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n - TransactionPartnerUser\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - TransactionPartnerOther",
+ "html_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
",
+ "rst_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n\n - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`\n - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment`\n - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds`\n - :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi`\n - :class:`aiogram.types.transaction_partner_other.TransactionPartnerOther`",
"annotations": [],
"category": "types"
}
diff --git a/.butcher/types/TransactionPartnerTelegramApi/entity.json b/.butcher/types/TransactionPartnerTelegramApi/entity.json
new file mode 100644
index 00000000..ab951c14
--- /dev/null
+++ b/.butcher/types/TransactionPartnerTelegramApi/entity.json
@@ -0,0 +1,33 @@
+{
+ "meta": {},
+ "group": {
+ "title": "Payments",
+ "anchor": "payments"
+ },
+ "object": {
+ "anchor": "transactionpartnertelegramapi",
+ "name": "TransactionPartnerTelegramApi",
+ "description": "Describes a transaction with payment for paid broadcasting.",
+ "html_description": "Describes a transaction with payment for paid broadcasting.
",
+ "rst_description": "Describes a transaction with payment for `paid broadcasting `_.",
+ "annotations": [
+ {
+ "type": "String",
+ "description": "Type of the transaction partner, always 'telegram_api'",
+ "html_description": "Type of the transaction partner, always “telegram_api” | ",
+ "rst_description": "Type of the transaction partner, always 'telegram_api'\n",
+ "name": "type",
+ "required": true
+ },
+ {
+ "type": "Integer",
+ "description": "The number of successful requests that exceeded regular limits and were therefore billed",
+ "html_description": "The number of successful requests that exceeded regular limits and were therefore billed | ",
+ "rst_description": "The number of successful requests that exceeded regular limits and were therefore billed\n",
+ "name": "request_count",
+ "required": true
+ }
+ ],
+ "category": "types"
+ }
+}
diff --git a/CHANGES/1601.feature.rst b/CHANGES/1601.feature.rst
new file mode 100644
index 00000000..3880ba5c
--- /dev/null
+++ b/CHANGES/1601.feature.rst
@@ -0,0 +1,33 @@
+Added full support of `Bot API 7.11 `_
+
+- Added the class :class:`aiogram.types.copy_text_button.CopyTextButton`
+ and the field :code:`copy_text` in the class
+ :class:`aiogram.types.inline_keyboard_button.InlineKeyboardButton`,
+ allowing bots to send and receive inline buttons that copy arbitrary text.
+- Added the parameter :code:`allow_paid_broadcast` to the methods
+ :class:`aiogram.methods.send_message.SendMessage`,
+ :class:`aiogram.methods.send_photo.SendPhoto`,
+ :class:`aiogram.methods.send_video.SendVideo`,
+ :class:`aiogram.methods.send_animation.SendAnimation`,
+ :class:`aiogram.methods.send_audio.SendAudio`,
+ :class:`aiogram.methods.send_document.SendDocument`,
+ :class:`aiogram.methods.send_paid_media.SendPaidMedia`,
+ :class:`aiogram.methods.send_sticker.SendSticker`,
+ :class:`aiogram.methods.send_video_note.SendVideoNote`,
+ :class:`aiogram.methods.send_voice.SendVoice`,
+ :class:`aiogram.methods.send_location.SendLocation`,
+ :class:`aiogram.methods.send_venue.SendVenue`,
+ :class:`aiogram.methods.send_contact.SendContact`,
+ :class:`aiogram.methods.send_poll.SendPoll`,
+ :class:`aiogram.methods.send_dice.SendDice`,
+ :class:`aiogram.methods.send_invoice.SendInvoice`,
+ :class:`aiogram.methods.send_game.SendGame`,
+ :class:`aiogram.methods.send_media_group.SendMediaGroup`
+ and :class:`aiogram.methods.copy_message.CopyMessage`.
+- Added the class
+ :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi`
+ for transactions related to paid broadcasted messages.
+- Introduced the ability to add media to existing text messages using the method
+ :class:`aiogram.methods.edit_message_media.EditMessageMedia`.
+- Added support for hashtag and cashtag entities with a specified chat username
+ that opens a search for the relevant tag within the specified chat.
diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py
index ef885788..fb4b348c 100644
--- a/aiogram/client/bot.py
+++ b/aiogram/client/bot.py
@@ -10,7 +10,6 @@ from typing import (
AsyncGenerator,
AsyncIterator,
BinaryIO,
- List,
Optional,
Type,
TypeVar,
@@ -569,7 +568,7 @@ class Bot:
async def answer_inline_query(
self,
inline_query_id: str,
- results: List[
+ results: list[
Union[
InlineQueryResultCachedAudio,
InlineQueryResultCachedDocument,
@@ -662,7 +661,7 @@ class Bot:
self,
shipping_query_id: str,
ok: bool,
- shipping_options: Optional[List[ShippingOption]] = None,
+ shipping_options: Optional[list[ShippingOption]] = None,
error_message: Optional[str] = None,
request_timeout: Optional[int] = None,
) -> bool:
@@ -853,12 +852,13 @@ class Bot:
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@@ -882,6 +882,7 @@ class Bot:
:param 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.
: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 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
:param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
@@ -901,6 +902,7 @@ class Bot:
show_caption_above_media=show_caption_above_media,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
@@ -975,10 +977,10 @@ class Bot:
description: str,
payload: str,
currency: str,
- prices: List[LabeledPrice],
+ prices: list[LabeledPrice],
provider_token: Optional[str] = None,
max_tip_amount: Optional[int] = None,
- suggested_tip_amounts: Optional[List[int]] = None,
+ suggested_tip_amounts: Optional[list[int]] = None,
provider_data: Optional[str] = None,
photo_url: Optional[str] = None,
photo_size: Optional[int] = None,
@@ -1051,7 +1053,7 @@ class Bot:
user_id: int,
name: str,
title: str,
- stickers: List[InputSticker],
+ stickers: list[InputSticker],
sticker_type: Optional[str] = None,
needs_repainting: Optional[bool] = None,
sticker_format: Optional[str] = None,
@@ -1356,7 +1358,7 @@ class Bot:
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,
+ caption_entities: Optional[list[MessageEntity]] = None,
show_caption_above_media: Optional[Union[bool, Default]] = Default(
"show_caption_above_media"
),
@@ -1461,7 +1463,7 @@ class Bot:
request_timeout: Optional[int] = None,
) -> Union[Message, bool]:
"""
- Use this method to edit animation, audio, document, photo, or video 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.
+ 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
@@ -1525,7 +1527,7 @@ class Bot:
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,
+ entities: Optional[list[MessageEntity]] = None,
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
"link_preview"
),
@@ -1649,7 +1651,7 @@ class Bot:
self,
chat_id: Union[int, str],
request_timeout: Optional[int] = None,
- ) -> List[
+ ) -> list[
Union[
ChatMemberOwner,
ChatMemberAdministrator,
@@ -1746,9 +1748,9 @@ class Bot:
async def get_custom_emoji_stickers(
self,
- custom_emoji_ids: List[str],
+ custom_emoji_ids: list[str],
request_timeout: Optional[int] = None,
- ) -> List[Sticker]:
+ ) -> 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.
@@ -1788,7 +1790,7 @@ class Bot:
async def get_forum_topic_icon_stickers(
self,
request_timeout: Optional[int] = None,
- ) -> List[Sticker]:
+ ) -> 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.
@@ -1808,7 +1810,7 @@ class Bot:
message_id: Optional[int] = None,
inline_message_id: Optional[str] = None,
request_timeout: Optional[int] = None,
- ) -> List[GameHighScore]:
+ ) -> 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.
@@ -1863,7 +1865,7 @@ class Bot:
] = None,
language_code: Optional[str] = None,
request_timeout: Optional[int] = None,
- ) -> List[BotCommand]:
+ ) -> 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.
@@ -1926,9 +1928,9 @@ class Bot:
offset: Optional[int] = None,
limit: Optional[int] = None,
timeout: Optional[int] = None,
- allowed_updates: Optional[List[str]] = None,
+ allowed_updates: Optional[list[str]] = None,
request_timeout: Optional[int] = None,
- ) -> List[Update]:
+ ) -> list[Update]:
"""
Use this method to receive incoming updates using long polling (`wiki `_). Returns an Array of :class:`aiogram.types.update.Update` objects.
@@ -2221,13 +2223,14 @@ class Bot:
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -2257,6 +2260,7 @@ class Bot:
:param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation
: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; for private chats only
: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
@@ -2282,6 +2286,7 @@ class Bot:
has_spoiler=has_spoiler,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2298,13 +2303,14 @@ class Bot:
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -2333,6 +2339,7 @@ class Bot:
: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 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; for private chats only
: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
@@ -2356,6 +2363,7 @@ class Bot:
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2408,6 +2416,7 @@ class Bot:
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -2431,6 +2440,7 @@ class Bot:
:param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes
: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; for private chats only
: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
@@ -2450,6 +2460,7 @@ class Bot:
vcard=vcard,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2466,6 +2477,7 @@ class Bot:
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -2486,6 +2498,7 @@ class Bot:
: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.
:param protect_content: Protects the contents of the sent message from forwarding
+ :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; for private chats only
: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
@@ -2502,6 +2515,7 @@ class Bot:
emoji=emoji,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2519,10 +2533,11 @@ class Bot:
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -2548,6 +2563,7 @@ class Bot:
:param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data
: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; for private chats only
: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
@@ -2569,6 +2585,7 @@ class Bot:
disable_content_type_detection=disable_content_type_detection,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2585,6 +2602,7 @@ class Bot:
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,
@@ -2603,6 +2621,7 @@ class Bot:
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups 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
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
:param reply_parameters: Description of the message to reply to
:param reply_markup: 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.
@@ -2619,6 +2638,7 @@ class Bot:
message_thread_id=message_thread_id,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2634,11 +2654,11 @@ class Bot:
description: str,
payload: str,
currency: str,
- prices: List[LabeledPrice],
+ prices: list[LabeledPrice],
message_thread_id: Optional[int] = None,
provider_token: Optional[str] = None,
max_tip_amount: Optional[int] = None,
- suggested_tip_amounts: Optional[List[int]] = None,
+ suggested_tip_amounts: Optional[list[int]] = None,
start_parameter: Optional[str] = None,
provider_data: Optional[str] = None,
photo_url: Optional[str] = None,
@@ -2654,6 +2674,7 @@ class Bot:
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None,
@@ -2691,6 +2712,7 @@ class Bot:
:param is_flexible: Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.
: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; for private chats only
:param reply_parameters: Description of the message to reply to
:param reply_markup: 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.
@@ -2726,6 +2748,7 @@ class Bot:
is_flexible=is_flexible,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2747,6 +2770,7 @@ class Bot:
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -2772,6 +2796,7 @@ class Bot:
:param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
: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; for private chats only
: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
@@ -2793,6 +2818,7 @@ class Bot:
proximity_alert_radius=proximity_alert_radius,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2804,17 +2830,18 @@ class Bot:
async def send_media_group(
self,
chat_id: Union[int, str],
- media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
+ media: list[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
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,
allow_sending_without_reply: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
request_timeout: Optional[int] = None,
- ) -> List[Message]:
+ ) -> 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 `Messages `_ that were sent is returned.
@@ -2826,6 +2853,7 @@ class Bot:
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
: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
+ :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; for private chats only
:param reply_parameters: Description of the message to reply to
:param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
@@ -2841,6 +2869,7 @@ class Bot:
message_thread_id=message_thread_id,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
allow_sending_without_reply=allow_sending_without_reply,
@@ -2855,12 +2884,13 @@ class Bot:
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -2887,6 +2917,7 @@ class Bot:
:param link_preview_options: Link preview generation options for 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 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; for private chats only
: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
@@ -2907,6 +2938,7 @@ class Bot:
link_preview_options=link_preview_options,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2924,13 +2956,14 @@ class Bot:
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -2956,6 +2989,7 @@ class Bot:
:param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation
: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; for private chats only
: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
@@ -2977,6 +3011,7 @@ class Bot:
has_spoiler=has_spoiler,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -2989,23 +3024,24 @@ class Bot:
self,
chat_id: Union[int, str],
question: str,
- options: List[Union[InputPollOption, str]],
+ options: list[Union[InputPollOption, str]],
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,
+ 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,
+ explanation_entities: Optional[list[MessageEntity]] = None,
open_period: Optional[int] = None,
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = 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[
@@ -3039,6 +3075,7 @@ class Bot:
:param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview.
: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; for private chats only
: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
@@ -3068,6 +3105,7 @@ class Bot:
is_closed=is_closed,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -3085,6 +3123,7 @@ class Bot:
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -3106,6 +3145,7 @@ class Bot:
: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.
: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; for private chats only
: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
@@ -3123,6 +3163,7 @@ class Bot:
emoji=emoji,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -3146,6 +3187,7 @@ class Bot:
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -3173,6 +3215,7 @@ class Bot:
:param google_place_type: Google Places type of the venue. (See `supported types `_.)
: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; for private chats only
: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
@@ -3196,6 +3239,7 @@ class Bot:
google_place_type=google_place_type,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -3216,7 +3260,7 @@ class Bot:
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ caption_entities: Optional[list[MessageEntity]] = None,
show_caption_above_media: Optional[Union[bool, Default]] = Default(
"show_caption_above_media"
),
@@ -3224,6 +3268,7 @@ class Bot:
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -3254,6 +3299,7 @@ class Bot:
:param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming
: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; for private chats only
: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
@@ -3280,6 +3326,7 @@ class Bot:
supports_streaming=supports_streaming,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -3299,6 +3346,7 @@ class Bot:
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -3322,6 +3370,7 @@ class Bot:
: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 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; for private chats only
: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
@@ -3341,6 +3390,7 @@ class Bot:
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -3357,10 +3407,11 @@ class Bot:
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -3385,6 +3436,7 @@ class Bot:
:param duration: Duration of the voice message in seconds
: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; for private chats only
: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
@@ -3405,6 +3457,7 @@ class Bot:
duration=duration,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -3622,7 +3675,7 @@ class Bot:
async def set_my_commands(
self,
- commands: List[BotCommand],
+ commands: list[BotCommand],
scope: Optional[
Union[
BotCommandScopeDefault,
@@ -3682,7 +3735,7 @@ class Bot:
async def set_passport_data_errors(
self,
user_id: int,
- errors: List[
+ errors: list[
Union[
PassportElementErrorDataField,
PassportElementErrorFrontSide,
@@ -3744,7 +3797,7 @@ class Bot:
certificate: Optional[InputFile] = None,
ip_address: Optional[str] = None,
max_connections: Optional[int] = None,
- allowed_updates: Optional[List[str]] = None,
+ allowed_updates: Optional[list[str]] = None,
drop_pending_updates: Optional[bool] = None,
secret_token: Optional[str] = None,
request_timeout: Optional[int] = None,
@@ -4226,7 +4279,7 @@ class Bot:
async def set_sticker_emoji_list(
self,
sticker: str,
- emoji_list: List[str],
+ emoji_list: list[str],
request_timeout: Optional[int] = None,
) -> bool:
"""
@@ -4249,7 +4302,7 @@ class Bot:
async def set_sticker_keywords(
self,
sticker: str,
- keywords: Optional[List[str]] = None,
+ keywords: Optional[list[str]] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
@@ -4411,13 +4464,13 @@ class Bot:
self,
chat_id: Union[int, str],
from_chat_id: Union[int, str],
- message_ids: List[int],
+ message_ids: list[int],
message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
remove_caption: Optional[bool] = None,
request_timeout: Optional[int] = None,
- ) -> List[MessageId]:
+ ) -> 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.
@@ -4448,7 +4501,7 @@ class Bot:
async def delete_messages(
self,
chat_id: Union[int, str],
- message_ids: List[int],
+ message_ids: list[int],
request_timeout: Optional[int] = None,
) -> bool:
"""
@@ -4472,12 +4525,12 @@ class Bot:
self,
chat_id: Union[int, str],
from_chat_id: Union[int, str],
- message_ids: List[int],
+ message_ids: list[int],
message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
request_timeout: Optional[int] = None,
- ) -> List[MessageId]:
+ ) -> 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.
@@ -4531,7 +4584,7 @@ class Bot:
chat_id: Union[int, str],
message_id: int,
reaction: Optional[
- List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
+ list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
] = None,
is_big: Optional[bool] = None,
request_timeout: Optional[int] = None,
@@ -4656,15 +4709,16 @@ class Bot:
self,
chat_id: Union[int, str],
star_count: int,
- media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]],
+ media: list[Union[InputPaidMediaPhoto, InputPaidMediaVideo]],
business_connection_id: Optional[str] = None,
payload: Optional[str] = None,
caption: Optional[str] = None,
parse_mode: Optional[str] = None,
- caption_entities: Optional[List[MessageEntity]] = 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@@ -4687,6 +4741,7 @@ class Bot:
:param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media
: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 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
:param request_timeout: Request timeout
@@ -4705,6 +4760,7 @@ class Bot:
show_caption_above_media=show_caption_above_media,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
)
diff --git a/aiogram/dispatcher/event/telegram.py b/aiogram/dispatcher/event/telegram.py
index afa8938e..b0ed4070 100644
--- a/aiogram/dispatcher/event/telegram.py
+++ b/aiogram/dispatcher/event/telegram.py
@@ -7,7 +7,7 @@ from aiogram.dispatcher.middlewares.manager import MiddlewareManager
from ...exceptions import UnsupportedKeywordArgument
from ...filters.base import Filter
from ...types import TelegramObject
-from .bases import REJECTED, UNHANDLED, MiddlewareType, SkipHandler
+from .bases import UNHANDLED, MiddlewareType, SkipHandler
from .handler import CallbackType, FilterObject, HandlerObject
if TYPE_CHECKING:
diff --git a/aiogram/enums/reaction_type_type.py b/aiogram/enums/reaction_type_type.py
index 5b0b8804..f4b7c345 100644
--- a/aiogram/enums/reaction_type_type.py
+++ b/aiogram/enums/reaction_type_type.py
@@ -10,3 +10,4 @@ class ReactionTypeType(str, Enum):
EMOJI = "emoji"
CUSTOM_EMOJI = "custom_emoji"
+ PAID = "paid"
diff --git a/aiogram/enums/transaction_partner_type.py b/aiogram/enums/transaction_partner_type.py
index b335ac09..79e7900e 100644
--- a/aiogram/enums/transaction_partner_type.py
+++ b/aiogram/enums/transaction_partner_type.py
@@ -12,3 +12,4 @@ class TransactionPartnerType(str, Enum):
OTHER = "other"
USER = "user"
TELEGRAM_ADS = "telegram_ads"
+ TELEGRAM_API = "telegram_api"
diff --git a/aiogram/handlers/callback_query.py b/aiogram/handlers/callback_query.py
index 342b11b8..e2a3a25e 100644
--- a/aiogram/handlers/callback_query.py
+++ b/aiogram/handlers/callback_query.py
@@ -2,7 +2,7 @@ from abc import ABC
from typing import Optional
from aiogram.handlers import BaseHandler
-from aiogram.types import CallbackQuery, MaybeInaccessibleMessage, Message, User
+from aiogram.types import CallbackQuery, MaybeInaccessibleMessage, User
class CallbackQueryHandler(BaseHandler[CallbackQuery], ABC):
diff --git a/aiogram/methods/answer_inline_query.py b/aiogram/methods/answer_inline_query.py
index acfb80ab..d30134e6 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -44,7 +44,7 @@ class AnswerInlineQuery(TelegramMethod[bool]):
inline_query_id: str
"""Unique identifier for the answered query"""
- results: List[
+ results: list[
Union[
InlineQueryResultCachedAudio,
InlineQueryResultCachedDocument,
@@ -96,7 +96,7 @@ class AnswerInlineQuery(TelegramMethod[bool]):
__pydantic__self__,
*,
inline_query_id: str,
- results: List[
+ results: list[
Union[
InlineQueryResultCachedAudio,
InlineQueryResultCachedDocument,
diff --git a/aiogram/methods/answer_shipping_query.py b/aiogram/methods/answer_shipping_query.py
index ad0e9dc0..48febb01 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, List, Optional
+from typing import TYPE_CHECKING, Any, Optional
from ..types import ShippingOption
from .base import TelegramMethod
@@ -20,7 +20,7 @@ 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: Optional[list[ShippingOption]] = None
"""Required if *ok* is :code:`True`. A JSON-serialized array of available shipping options."""
error_message: Optional[str] = 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."""
@@ -34,7 +34,7 @@ class AnswerShippingQuery(TelegramMethod[bool]):
*,
shipping_query_id: str,
ok: bool,
- shipping_options: Optional[List[ShippingOption]] = None,
+ shipping_options: Optional[list[ShippingOption]] = None,
error_message: Optional[str] = None,
**__pydantic_kwargs: Any,
) -> None:
diff --git a/aiogram/methods/copy_message.py b/aiogram/methods/copy_message.py
index ca44f93e..11b931fa 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -39,7 +39,7 @@ class CopyMessage(TelegramMethod[MessageId]):
"""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")
"""Mode for parsing entities in the new caption. See `formatting options `_ for more details."""
- caption_entities: Optional[List[MessageEntity]] = None
+ caption_entities: Optional[list[MessageEntity]] = 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")
"""Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified."""
@@ -47,6 +47,8 @@ class CopyMessage(TelegramMethod[MessageId]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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"""
reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to"""
reply_markup: Optional[
@@ -79,12 +81,13 @@ class CopyMessage(TelegramMethod[MessageId]):
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@@ -108,6 +111,7 @@ class CopyMessage(TelegramMethod[MessageId]):
show_caption_above_media=show_caption_above_media,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
allow_sending_without_reply=allow_sending_without_reply,
diff --git a/aiogram/methods/copy_messages.py b/aiogram/methods/copy_messages.py
index c734d0a7..67ebfe31 100644
--- a/aiogram/methods/copy_messages.py
+++ b/aiogram/methods/copy_messages.py
@@ -1,24 +1,24 @@
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from ..types import MessageId
from .base import TelegramMethod
-class CopyMessages(TelegramMethod[List[MessageId]]):
+class CopyMessages(TelegramMethod[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.
Source: https://core.telegram.org/bots/api#copymessages
"""
- __returning__ = List[MessageId]
+ __returning__ = list[MessageId]
__api_method__ = "copyMessages"
chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
from_chat_id: Union[int, str]
"""Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)"""
- message_ids: List[int]
+ 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"""
@@ -38,7 +38,7 @@ class CopyMessages(TelegramMethod[List[MessageId]]):
*,
chat_id: Union[int, str],
from_chat_id: Union[int, str],
- message_ids: List[int],
+ message_ids: list[int],
message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
diff --git a/aiogram/methods/create_invoice_link.py b/aiogram/methods/create_invoice_link.py
index a736aed6..4e58df8d 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, List, Optional
+from typing import TYPE_CHECKING, Any, Optional
from ..types import LabeledPrice
from .base import TelegramMethod
@@ -24,13 +24,13 @@ class CreateInvoiceLink(TelegramMethod[str]):
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes."""
currency: str
"""Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_."""
- prices: List[LabeledPrice]
+ 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 `_."""
provider_token: Optional[str] = None
"""Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_."""
max_tip_amount: Optional[int] = 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: Optional[list[int]] = 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
"""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."""
@@ -68,10 +68,10 @@ class CreateInvoiceLink(TelegramMethod[str]):
description: str,
payload: str,
currency: str,
- prices: List[LabeledPrice],
+ prices: list[LabeledPrice],
provider_token: Optional[str] = None,
max_tip_amount: Optional[int] = None,
- suggested_tip_amounts: Optional[List[int]] = None,
+ suggested_tip_amounts: Optional[list[int]] = None,
provider_data: Optional[str] = None,
photo_url: Optional[str] = None,
photo_size: Optional[int] = None,
diff --git a/aiogram/methods/create_new_sticker_set.py b/aiogram/methods/create_new_sticker_set.py
index c304d854..842f9faf 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, List, Optional
+from typing import TYPE_CHECKING, Any, Optional
from pydantic import Field
@@ -24,7 +24,7 @@ class CreateNewStickerSet(TelegramMethod[bool]):
"""Short name of sticker set, to be used in :code:`t.me/addstickers/` URLs (e.g., *animals*). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in :code:`"_by_"`. :code:`` is case insensitive. 1-64 characters."""
title: str
"""Sticker set title, 1-64 characters"""
- stickers: List[InputSticker]
+ stickers: list[InputSticker]
"""A JSON-serialized list of 1-50 initial stickers to be added to the sticker set"""
sticker_type: Optional[str] = None
"""Type of stickers in the set, pass 'regular', 'mask', or 'custom_emoji'. By default, a regular sticker set is created."""
@@ -46,7 +46,7 @@ class CreateNewStickerSet(TelegramMethod[bool]):
user_id: int,
name: str,
title: str,
- stickers: List[InputSticker],
+ stickers: list[InputSticker],
sticker_type: Optional[str] = None,
needs_repainting: Optional[bool] = None,
sticker_format: Optional[str] = None,
diff --git a/aiogram/methods/delete_messages.py b/aiogram/methods/delete_messages.py
index 061d12b9..bb77ddf7 100644
--- a/aiogram/methods/delete_messages.py
+++ b/aiogram/methods/delete_messages.py
@@ -1,4 +1,4 @@
-from typing import TYPE_CHECKING, Any, List, Union
+from typing import TYPE_CHECKING, Any, Union
from .base import TelegramMethod
@@ -15,7 +15,7 @@ class DeleteMessages(TelegramMethod[bool]):
chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
- message_ids: List[int]
+ message_ids: list[int]
"""A JSON-serialized list of 1-100 identifiers of messages to delete. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted"""
if TYPE_CHECKING:
@@ -26,7 +26,7 @@ class DeleteMessages(TelegramMethod[bool]):
__pydantic__self__,
*,
chat_id: Union[int, str],
- message_ids: List[int],
+ message_ids: list[int],
**__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 8a759d40..000c4229 100644
--- a/aiogram/methods/edit_message_caption.py
+++ b/aiogram/methods/edit_message_caption.py
@@ -1,9 +1,9 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from ..client.default import Default
-from ..types import UNSET_PARSE_MODE, InlineKeyboardMarkup, Message, MessageEntity
+from ..types import InlineKeyboardMarkup, Message, MessageEntity
from .base import TelegramMethod
@@ -29,7 +29,7 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
"""New caption of the message, 0-1024 characters after entities parsing"""
parse_mode: Optional[Union[str, Default]] = 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: Optional[list[MessageEntity]] = 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")
"""Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages."""
@@ -49,7 +49,7 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
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,
+ caption_entities: Optional[list[MessageEntity]] = None,
show_caption_above_media: Optional[Union[bool, Default]] = Default(
"show_caption_above_media"
),
diff --git a/aiogram/methods/edit_message_media.py b/aiogram/methods/edit_message_media.py
index b898be79..0e0a049b 100644
--- a/aiogram/methods/edit_message_media.py
+++ b/aiogram/methods/edit_message_media.py
@@ -16,7 +16,7 @@ from .base import TelegramMethod
class EditMessageMedia(TelegramMethod[Union[Message, bool]]):
"""
- Use this method to edit animation, audio, document, photo, or video 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.
+ 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
"""
diff --git a/aiogram/methods/edit_message_text.py b/aiogram/methods/edit_message_text.py
index 93c126d5..6feb9bc5 100644
--- a/aiogram/methods/edit_message_text.py
+++ b/aiogram/methods/edit_message_text.py
@@ -37,7 +37,7 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]):
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
"""Mode for parsing entities in the message text. See `formatting options `_ for more details."""
- entities: Optional[List[MessageEntity]] = None
+ entities: Optional[list[MessageEntity]] = 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 generation options for the message"""
@@ -64,7 +64,7 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]):
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,
+ entities: Optional[list[MessageEntity]] = None,
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
"link_preview"
),
diff --git a/aiogram/methods/forward_message.py b/aiogram/methods/forward_message.py
index 01d764a3..f82ace02 100644
--- a/aiogram/methods/forward_message.py
+++ b/aiogram/methods/forward_message.py
@@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Optional, Union
from ..client.default import Default
from ..types import Message
-from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod
diff --git a/aiogram/methods/forward_messages.py b/aiogram/methods/forward_messages.py
index 829545f2..c627b01c 100644
--- a/aiogram/methods/forward_messages.py
+++ b/aiogram/methods/forward_messages.py
@@ -1,24 +1,24 @@
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from ..types import MessageId
from .base import TelegramMethod
-class ForwardMessages(TelegramMethod[List[MessageId]]):
+class ForwardMessages(TelegramMethod[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.
Source: https://core.telegram.org/bots/api#forwardmessages
"""
- __returning__ = List[MessageId]
+ __returning__ = list[MessageId]
__api_method__ = "forwardMessages"
chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
from_chat_id: Union[int, str]
"""Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)"""
- message_ids: List[int]
+ 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"""
@@ -36,7 +36,7 @@ class ForwardMessages(TelegramMethod[List[MessageId]]):
*,
chat_id: Union[int, str],
from_chat_id: Union[int, str],
- message_ids: List[int],
+ message_ids: list[int],
message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
diff --git a/aiogram/methods/get_chat_administrators.py b/aiogram/methods/get_chat_administrators.py
index 99e403e2..46ff243b 100644
--- a/aiogram/methods/get_chat_administrators.py
+++ b/aiogram/methods/get_chat_administrators.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Union
+from typing import TYPE_CHECKING, Any, Union
from ..types import (
ChatMemberAdministrator,
@@ -15,7 +15,7 @@ from .base import TelegramMethod
class GetChatAdministrators(
TelegramMethod[
- List[
+ list[
Union[
ChatMemberOwner,
ChatMemberAdministrator,
@@ -33,7 +33,7 @@ class GetChatAdministrators(
Source: https://core.telegram.org/bots/api#getchatadministrators
"""
- __returning__ = List[
+ __returning__ = list[
Union[
ChatMemberOwner,
ChatMemberAdministrator,
diff --git a/aiogram/methods/get_custom_emoji_stickers.py b/aiogram/methods/get_custom_emoji_stickers.py
index 3235d97d..06c684eb 100644
--- a/aiogram/methods/get_custom_emoji_stickers.py
+++ b/aiogram/methods/get_custom_emoji_stickers.py
@@ -1,22 +1,22 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List
+from typing import TYPE_CHECKING, Any
from ..types import Sticker
from .base import TelegramMethod
-class GetCustomEmojiStickers(TelegramMethod[List[Sticker]]):
+class GetCustomEmojiStickers(TelegramMethod[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.
Source: https://core.telegram.org/bots/api#getcustomemojistickers
"""
- __returning__ = List[Sticker]
+ __returning__ = list[Sticker]
__api_method__ = "getCustomEmojiStickers"
- custom_emoji_ids: List[str]
+ custom_emoji_ids: list[str]
"""A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified."""
if TYPE_CHECKING:
@@ -24,7 +24,7 @@ class GetCustomEmojiStickers(TelegramMethod[List[Sticker]]):
# This section was auto-generated via `butcher`
def __init__(
- __pydantic__self__, *, custom_emoji_ids: List[str], **__pydantic_kwargs: Any
+ __pydantic__self__, *, custom_emoji_ids: list[str], **__pydantic_kwargs: Any
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
diff --git a/aiogram/methods/get_forum_topic_icon_stickers.py b/aiogram/methods/get_forum_topic_icon_stickers.py
index 5c233215..6b49dd8a 100644
--- a/aiogram/methods/get_forum_topic_icon_stickers.py
+++ b/aiogram/methods/get_forum_topic_icon_stickers.py
@@ -1,17 +1,15 @@
from __future__ import annotations
-from typing import List
-
from ..types import Sticker
from .base import TelegramMethod
-class GetForumTopicIconStickers(TelegramMethod[List[Sticker]]):
+class GetForumTopicIconStickers(TelegramMethod[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.
Source: https://core.telegram.org/bots/api#getforumtopiciconstickers
"""
- __returning__ = List[Sticker]
+ __returning__ = list[Sticker]
__api_method__ = "getForumTopicIconStickers"
diff --git a/aiogram/methods/get_game_high_scores.py b/aiogram/methods/get_game_high_scores.py
index cac9d61a..fc0d443a 100644
--- a/aiogram/methods/get_game_high_scores.py
+++ b/aiogram/methods/get_game_high_scores.py
@@ -1,12 +1,12 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Optional
+from typing import TYPE_CHECKING, Any, Optional
from ..types import GameHighScore
from .base import TelegramMethod
-class GetGameHighScores(TelegramMethod[List[GameHighScore]]):
+class GetGameHighScores(TelegramMethod[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.
@@ -15,7 +15,7 @@ class GetGameHighScores(TelegramMethod[List[GameHighScore]]):
Source: https://core.telegram.org/bots/api#getgamehighscores
"""
- __returning__ = List[GameHighScore]
+ __returning__ = list[GameHighScore]
__api_method__ = "getGameHighScores"
user_id: int
diff --git a/aiogram/methods/get_my_commands.py b/aiogram/methods/get_my_commands.py
index b3386b66..b69d8c6b 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from ..types import (
BotCommand,
@@ -15,14 +15,14 @@ from ..types import (
from .base import TelegramMethod
-class GetMyCommands(TelegramMethod[List[BotCommand]]):
+class GetMyCommands(TelegramMethod[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.
Source: https://core.telegram.org/bots/api#getmycommands
"""
- __returning__ = List[BotCommand]
+ __returning__ = list[BotCommand]
__api_method__ = "getMyCommands"
scope: Optional[
diff --git a/aiogram/methods/get_updates.py b/aiogram/methods/get_updates.py
index d1f6371e..5a3fc054 100644
--- a/aiogram/methods/get_updates.py
+++ b/aiogram/methods/get_updates.py
@@ -1,12 +1,12 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Optional
+from typing import TYPE_CHECKING, Any, Optional
from ..types import Update
from .base import TelegramMethod
-class GetUpdates(TelegramMethod[List[Update]]):
+class GetUpdates(TelegramMethod[list[Update]]):
"""
Use this method to receive incoming updates using long polling (`wiki `_). Returns an Array of :class:`aiogram.types.update.Update` objects.
@@ -19,7 +19,7 @@ class GetUpdates(TelegramMethod[List[Update]]):
Source: https://core.telegram.org/bots/api#getupdates
"""
- __returning__ = List[Update]
+ __returning__ = list[Update]
__api_method__ = "getUpdates"
offset: Optional[int] = None
@@ -28,7 +28,7 @@ class GetUpdates(TelegramMethod[List[Update]]):
"""Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100."""
timeout: Optional[int] = None
"""Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only."""
- allowed_updates: Optional[List[str]] = None
+ allowed_updates: Optional[list[str]] = 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:
@@ -41,7 +41,7 @@ class GetUpdates(TelegramMethod[List[Update]]):
offset: Optional[int] = None,
limit: Optional[int] = None,
timeout: Optional[int] = None,
- allowed_updates: Optional[List[str]] = None,
+ allowed_updates: Optional[list[str]] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/send_animation.py b/aiogram/methods/send_animation.py
index 0baab73a..70d7cbd6 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -48,7 +48,7 @@ class SendAnimation(TelegramMethod[Message]):
"""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")
"""Mode for parsing entities in the animation caption. See `formatting options `_ for more details."""
- caption_entities: Optional[List[MessageEntity]] = None
+ caption_entities: Optional[list[MessageEntity]] = 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")
"""Pass :code:`True`, if the caption must be shown above the message media"""
@@ -58,6 +58,8 @@ class SendAnimation(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -96,13 +98,14 @@ class SendAnimation(TelegramMethod[Message]):
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -132,6 +135,7 @@ class SendAnimation(TelegramMethod[Message]):
has_spoiler=has_spoiler,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_audio.py b/aiogram/methods/send_audio.py
index b15824a1..b76dafe4 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -41,7 +41,7 @@ class SendAudio(TelegramMethod[Message]):
"""Audio caption, 0-1024 characters after entities parsing"""
parse_mode: Optional[Union[str, Default]] = 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: Optional[list[MessageEntity]] = 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 of the audio in seconds"""
@@ -55,6 +55,8 @@ class SendAudio(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -89,13 +91,14 @@ class SendAudio(TelegramMethod[Message]):
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -123,6 +126,7 @@ class SendAudio(TelegramMethod[Message]):
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_contact.py b/aiogram/methods/send_contact.py
index 6c14d56f..353b3151 100644
--- a/aiogram/methods/send_contact.py
+++ b/aiogram/methods/send_contact.py
@@ -44,6 +44,8 @@ class SendContact(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -81,6 +83,7 @@ class SendContact(TelegramMethod[Message]):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -104,6 +107,7 @@ class SendContact(TelegramMethod[Message]):
vcard=vcard,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_dice.py b/aiogram/methods/send_dice.py
index 42d2bf57..f5227772 100644
--- a/aiogram/methods/send_dice.py
+++ b/aiogram/methods/send_dice.py
@@ -38,6 +38,8 @@ class SendDice(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -72,6 +74,7 @@ class SendDice(TelegramMethod[Message]):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -92,6 +95,7 @@ class SendDice(TelegramMethod[Message]):
emoji=emoji,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_document.py b/aiogram/methods/send_document.py
index 411165d3..0108ea3a 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -42,7 +42,7 @@ class SendDocument(TelegramMethod[Message]):
"""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")
"""Mode for parsing entities in the document caption. See `formatting options `_ for more details."""
- caption_entities: Optional[List[MessageEntity]] = None
+ caption_entities: Optional[list[MessageEntity]] = 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
"""Disables automatic server-side content type detection for files uploaded using multipart/form-data"""
@@ -50,6 +50,8 @@ class SendDocument(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -85,10 +87,11 @@ class SendDocument(TelegramMethod[Message]):
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -114,6 +117,7 @@ class SendDocument(TelegramMethod[Message]):
disable_content_type_detection=disable_content_type_detection,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_game.py b/aiogram/methods/send_game.py
index eb963303..02190ca2 100644
--- a/aiogram/methods/send_game.py
+++ b/aiogram/methods/send_game.py
@@ -31,6 +31,8 @@ class SendGame(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -63,6 +65,7 @@ class SendGame(TelegramMethod[Message]):
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,
@@ -81,6 +84,7 @@ class SendGame(TelegramMethod[Message]):
message_thread_id=message_thread_id,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_invoice.py b/aiogram/methods/send_invoice.py
index f5b01d8d..1bcdea89 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -29,7 +29,7 @@ class SendInvoice(TelegramMethod[Message]):
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes."""
currency: str
"""Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_."""
- prices: List[LabeledPrice]
+ 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"""
@@ -37,7 +37,7 @@ class SendInvoice(TelegramMethod[Message]):
"""Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_."""
max_tip_amount: Optional[int] = 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: Optional[list[int]] = 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
"""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"""
@@ -69,6 +69,8 @@ class SendInvoice(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -100,11 +102,11 @@ class SendInvoice(TelegramMethod[Message]):
description: str,
payload: str,
currency: str,
- prices: List[LabeledPrice],
+ prices: list[LabeledPrice],
message_thread_id: Optional[int] = None,
provider_token: Optional[str] = None,
max_tip_amount: Optional[int] = None,
- suggested_tip_amounts: Optional[List[int]] = None,
+ suggested_tip_amounts: Optional[list[int]] = None,
start_parameter: Optional[str] = None,
provider_data: Optional[str] = None,
photo_url: Optional[str] = None,
@@ -120,6 +122,7 @@ class SendInvoice(TelegramMethod[Message]):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None,
@@ -157,6 +160,7 @@ class SendInvoice(TelegramMethod[Message]):
is_flexible=is_flexible,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_location.py b/aiogram/methods/send_location.py
index d33f6769..3f03fd40 100644
--- a/aiogram/methods/send_location.py
+++ b/aiogram/methods/send_location.py
@@ -48,6 +48,8 @@ class SendLocation(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -87,6 +89,7 @@ class SendLocation(TelegramMethod[Message]):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -112,6 +115,7 @@ class SendLocation(TelegramMethod[Message]):
proximity_alert_radius=proximity_alert_radius,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_media_group.py b/aiogram/methods/send_media_group.py
index f8c081a3..045fca09 100644
--- a/aiogram/methods/send_media_group.py
+++ b/aiogram/methods/send_media_group.py
@@ -1,38 +1,34 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
from ..client.default import Default
from ..types import (
- ForceReply,
- InlineKeyboardMarkup,
InputMediaAudio,
InputMediaDocument,
InputMediaPhoto,
InputMediaVideo,
Message,
- ReplyKeyboardMarkup,
- ReplyKeyboardRemove,
ReplyParameters,
)
from .base import TelegramMethod
-class SendMediaGroup(TelegramMethod[List[Message]]):
+class SendMediaGroup(TelegramMethod[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 `Messages `_ that were sent is returned.
Source: https://core.telegram.org/bots/api#sendmediagroup
"""
- __returning__ = List[Message]
+ __returning__ = list[Message]
__api_method__ = "sendMediaGroup"
chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
- media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]]
+ media: list[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]]
"""A JSON-serialized array describing messages to be sent, must include 2-10 items"""
business_connection_id: Optional[str] = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
@@ -42,6 +38,8 @@ class SendMediaGroup(TelegramMethod[List[Message]]):
"""Sends messages `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent messages from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -67,13 +65,14 @@ class SendMediaGroup(TelegramMethod[List[Message]]):
__pydantic__self__,
*,
chat_id: Union[int, str],
- media: List[
+ media: list[
Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]
],
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,
allow_sending_without_reply: Optional[bool] = None,
@@ -91,6 +90,7 @@ class SendMediaGroup(TelegramMethod[List[Message]]):
message_thread_id=message_thread_id,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
allow_sending_without_reply=allow_sending_without_reply,
diff --git a/aiogram/methods/send_message.py b/aiogram/methods/send_message.py
index caf28525..954bb92e 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -38,7 +38,7 @@ class SendMessage(TelegramMethod[Message]):
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
"""Mode for parsing entities in the message text. See `formatting options `_ for more details."""
- entities: Optional[List[MessageEntity]] = None
+ entities: Optional[list[MessageEntity]] = 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 generation options for the message"""
@@ -46,6 +46,8 @@ class SendMessage(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -86,12 +88,13 @@ class SendMessage(TelegramMethod[Message]):
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -118,6 +121,7 @@ class SendMessage(TelegramMethod[Message]):
link_preview_options=link_preview_options,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_paid_media.py b/aiogram/methods/send_paid_media.py
index eba103bb..ba7e1452 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from ..types import (
ForceReply,
@@ -30,7 +30,7 @@ class SendPaidMedia(TelegramMethod[Message]):
"""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-2500"""
- media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]]
+ media: list[Union[InputPaidMediaPhoto, InputPaidMediaVideo]]
"""A JSON-serialized array describing the media to be sent; up to 10 items"""
business_connection_id: Optional[str] = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
@@ -40,7 +40,7 @@ class SendPaidMedia(TelegramMethod[Message]):
"""Media caption, 0-1024 characters after entities parsing"""
parse_mode: Optional[str] = None
"""Mode for parsing entities in the media caption. See `formatting options `_ for more details."""
- caption_entities: Optional[List[MessageEntity]] = None
+ caption_entities: Optional[list[MessageEntity]] = 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
"""Pass :code:`True`, if the caption must be shown above the message media"""
@@ -48,6 +48,8 @@ class SendPaidMedia(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[bool] = None
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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"""
reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to"""
reply_markup: Optional[
@@ -64,15 +66,16 @@ class SendPaidMedia(TelegramMethod[Message]):
*,
chat_id: Union[int, str],
star_count: int,
- media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]],
+ media: list[Union[InputPaidMediaPhoto, InputPaidMediaVideo]],
business_connection_id: Optional[str] = None,
payload: Optional[str] = None,
caption: Optional[str] = None,
parse_mode: Optional[str] = None,
- caption_entities: Optional[List[MessageEntity]] = 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@@ -95,6 +98,7 @@ class SendPaidMedia(TelegramMethod[Message]):
show_caption_above_media=show_caption_above_media,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
**__pydantic_kwargs,
diff --git a/aiogram/methods/send_photo.py b/aiogram/methods/send_photo.py
index 3ba7da12..8f011b62 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -40,7 +40,7 @@ class SendPhoto(TelegramMethod[Message]):
"""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")
"""Mode for parsing entities in the photo caption. See `formatting options `_ for more details."""
- caption_entities: Optional[List[MessageEntity]] = None
+ caption_entities: Optional[list[MessageEntity]] = 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")
"""Pass :code:`True`, if the caption must be shown above the message media"""
@@ -50,6 +50,8 @@ class SendPhoto(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -84,13 +86,14 @@ class SendPhoto(TelegramMethod[Message]):
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -116,6 +119,7 @@ class SendPhoto(TelegramMethod[Message]):
has_spoiler=has_spoiler,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_poll.py b/aiogram/methods/send_poll.py
index e791b70f..dbcfeda6 100644
--- a/aiogram/methods/send_poll.py
+++ b/aiogram/methods/send_poll.py
@@ -1,7 +1,7 @@
from __future__ import annotations
import datetime
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -33,7 +33,7 @@ class SendPoll(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
question: str
"""Poll question, 1-300 characters"""
- options: List[Union[InputPollOption, str]]
+ options: list[Union[InputPollOption, str]]
"""A JSON-serialized list of 2-10 answer options"""
business_connection_id: Optional[str] = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
@@ -41,7 +41,7 @@ class SendPoll(TelegramMethod[Message]):
"""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")
"""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: Optional[list[MessageEntity]] = 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
""":code:`True`, if the poll needs to be anonymous, defaults to :code:`True`"""
@@ -55,7 +55,7 @@ class SendPoll(TelegramMethod[Message]):
"""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")
"""Mode for parsing entities in the explanation. See `formatting options `_ for more details."""
- explanation_entities: Optional[List[MessageEntity]] = None
+ explanation_entities: Optional[list[MessageEntity]] = 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
"""Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*."""
@@ -67,6 +67,8 @@ class SendPoll(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -97,23 +99,24 @@ class SendPoll(TelegramMethod[Message]):
*,
chat_id: Union[int, str],
question: str,
- options: List[Union[InputPollOption, str]],
+ options: list[Union[InputPollOption, str]],
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,
+ 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,
+ explanation_entities: Optional[list[MessageEntity]] = None,
open_period: Optional[int] = None,
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = 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[
@@ -147,6 +150,7 @@ class SendPoll(TelegramMethod[Message]):
is_closed=is_closed,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_sticker.py b/aiogram/methods/send_sticker.py
index 236792bf..b558afa3 100644
--- a/aiogram/methods/send_sticker.py
+++ b/aiogram/methods/send_sticker.py
@@ -41,6 +41,8 @@ class SendSticker(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -76,6 +78,7 @@ class SendSticker(TelegramMethod[Message]):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -97,6 +100,7 @@ class SendSticker(TelegramMethod[Message]):
emoji=emoji,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_venue.py b/aiogram/methods/send_venue.py
index 04ebcee7..6ccd8cb8 100644
--- a/aiogram/methods/send_venue.py
+++ b/aiogram/methods/send_venue.py
@@ -52,6 +52,8 @@ class SendVenue(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -93,6 +95,7 @@ class SendVenue(TelegramMethod[Message]):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -120,6 +123,7 @@ class SendVenue(TelegramMethod[Message]):
google_place_type=google_place_type,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_video.py b/aiogram/methods/send_video.py
index 33fb7aa3..a7486511 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -48,7 +48,7 @@ class SendVideo(TelegramMethod[Message]):
"""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")
"""Mode for parsing entities in the video caption. See `formatting options `_ for more details."""
- caption_entities: Optional[List[MessageEntity]] = None
+ caption_entities: Optional[list[MessageEntity]] = 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")
"""Pass :code:`True`, if the caption must be shown above the message media"""
@@ -60,6 +60,8 @@ class SendVideo(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -98,7 +100,7 @@ class SendVideo(TelegramMethod[Message]):
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ caption_entities: Optional[list[MessageEntity]] = None,
show_caption_above_media: Optional[Union[bool, Default]] = Default(
"show_caption_above_media"
),
@@ -106,6 +108,7 @@ class SendVideo(TelegramMethod[Message]):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -136,6 +139,7 @@ class SendVideo(TelegramMethod[Message]):
supports_streaming=supports_streaming,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_video_note.py b/aiogram/methods/send_video_note.py
index 43d685b4..05ec334b 100644
--- a/aiogram/methods/send_video_note.py
+++ b/aiogram/methods/send_video_note.py
@@ -45,6 +45,8 @@ class SendVideoNote(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -82,6 +84,7 @@ class SendVideoNote(TelegramMethod[Message]):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -105,6 +108,7 @@ class SendVideoNote(TelegramMethod[Message]):
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/send_voice.py b/aiogram/methods/send_voice.py
index ccb27d3b..9d789bd7 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, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -40,7 +40,7 @@ class SendVoice(TelegramMethod[Message]):
"""Voice message caption, 0-1024 characters after entities parsing"""
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
"""Mode for parsing entities in the voice message caption. See `formatting options `_ for more details."""
- caption_entities: Optional[List[MessageEntity]] = None
+ caption_entities: Optional[list[MessageEntity]] = 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 of the voice message in seconds"""
@@ -48,6 +48,8 @@ class SendVoice(TelegramMethod[Message]):
"""Sends the message `silently `_. Users will receive a notification with no sound."""
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding and saving"""
+ allow_paid_broadcast: Optional[bool] = 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
"""Unique identifier of the message effect to be added to the message; for private chats only"""
reply_parameters: Optional[ReplyParameters] = None
@@ -82,10 +84,11 @@ class SendVoice(TelegramMethod[Message]):
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -110,6 +113,7 @@ class SendVoice(TelegramMethod[Message]):
duration=duration,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
diff --git a/aiogram/methods/set_message_reaction.py b/aiogram/methods/set_message_reaction.py
index d1c061c2..90fd71f4 100644
--- a/aiogram/methods/set_message_reaction.py
+++ b/aiogram/methods/set_message_reaction.py
@@ -1,4 +1,4 @@
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from ..types import ReactionTypeCustomEmoji, ReactionTypeEmoji, ReactionTypePaid
from .base import TelegramMethod
@@ -19,7 +19,7 @@ class SetMessageReaction(TelegramMethod[bool]):
message_id: int
"""Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead."""
reaction: Optional[
- List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
+ list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
] = None
"""A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots."""
is_big: Optional[bool] = None
@@ -35,7 +35,7 @@ class SetMessageReaction(TelegramMethod[bool]):
chat_id: Union[int, str],
message_id: int,
reaction: Optional[
- List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
+ list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
] = None,
is_big: Optional[bool] = None,
**__pydantic_kwargs: Any,
diff --git a/aiogram/methods/set_my_commands.py b/aiogram/methods/set_my_commands.py
index 2e52771f..a8186c9b 100644
--- a/aiogram/methods/set_my_commands.py
+++ b/aiogram/methods/set_my_commands.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from ..types import (
BotCommand,
@@ -25,7 +25,7 @@ class SetMyCommands(TelegramMethod[bool]):
__returning__ = bool
__api_method__ = "setMyCommands"
- commands: List[BotCommand]
+ commands: list[BotCommand]
"""A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified."""
scope: Optional[
Union[
@@ -49,7 +49,7 @@ class SetMyCommands(TelegramMethod[bool]):
def __init__(
__pydantic__self__,
*,
- commands: List[BotCommand],
+ commands: list[BotCommand],
scope: Optional[
Union[
BotCommandScopeDefault,
diff --git a/aiogram/methods/set_passport_data_errors.py b/aiogram/methods/set_passport_data_errors.py
index 0ad7e8bb..9d50ffae 100644
--- a/aiogram/methods/set_passport_data_errors.py
+++ b/aiogram/methods/set_passport_data_errors.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Union
+from typing import TYPE_CHECKING, Any, Union
from ..types import (
PassportElementErrorDataField,
@@ -29,7 +29,7 @@ class SetPassportDataErrors(TelegramMethod[bool]):
user_id: int
"""User identifier"""
- errors: List[
+ errors: list[
Union[
PassportElementErrorDataField,
PassportElementErrorFrontSide,
@@ -52,7 +52,7 @@ class SetPassportDataErrors(TelegramMethod[bool]):
__pydantic__self__,
*,
user_id: int,
- errors: List[
+ errors: list[
Union[
PassportElementErrorDataField,
PassportElementErrorFrontSide,
diff --git a/aiogram/methods/set_sticker_emoji_list.py b/aiogram/methods/set_sticker_emoji_list.py
index ac268c1e..64313cd3 100644
--- a/aiogram/methods/set_sticker_emoji_list.py
+++ b/aiogram/methods/set_sticker_emoji_list.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List
+from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
@@ -17,7 +17,7 @@ class SetStickerEmojiList(TelegramMethod[bool]):
sticker: str
"""File identifier of the sticker"""
- emoji_list: List[str]
+ emoji_list: list[str]
"""A JSON-serialized list of 1-20 emoji associated with the sticker"""
if TYPE_CHECKING:
@@ -25,7 +25,7 @@ class SetStickerEmojiList(TelegramMethod[bool]):
# This section was auto-generated via `butcher`
def __init__(
- __pydantic__self__, *, sticker: str, emoji_list: List[str], **__pydantic_kwargs: Any
+ __pydantic__self__, *, sticker: str, emoji_list: list[str], **__pydantic_kwargs: Any
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
diff --git a/aiogram/methods/set_sticker_keywords.py b/aiogram/methods/set_sticker_keywords.py
index 49e68f85..411f7299 100644
--- a/aiogram/methods/set_sticker_keywords.py
+++ b/aiogram/methods/set_sticker_keywords.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Optional
+from typing import TYPE_CHECKING, Any, Optional
from .base import TelegramMethod
@@ -17,7 +17,7 @@ class SetStickerKeywords(TelegramMethod[bool]):
sticker: str
"""File identifier of the sticker"""
- keywords: Optional[List[str]] = None
+ keywords: Optional[list[str]] = None
"""A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters"""
if TYPE_CHECKING:
@@ -28,7 +28,7 @@ class SetStickerKeywords(TelegramMethod[bool]):
__pydantic__self__,
*,
sticker: str,
- keywords: Optional[List[str]] = None,
+ keywords: Optional[list[str]] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/methods/set_webhook.py b/aiogram/methods/set_webhook.py
index 998e51b0..01c74f9c 100644
--- a/aiogram/methods/set_webhook.py
+++ b/aiogram/methods/set_webhook.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Optional
+from typing import TYPE_CHECKING, Any, Optional
from ..types import InputFile
from .base import TelegramMethod
@@ -34,7 +34,7 @@ class SetWebhook(TelegramMethod[bool]):
"""The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS"""
max_connections: Optional[int] = None
"""The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput."""
- allowed_updates: Optional[List[str]] = None
+ allowed_updates: Optional[list[str]] = 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."""
drop_pending_updates: Optional[bool] = None
"""Pass :code:`True` to drop all pending updates"""
@@ -52,7 +52,7 @@ class SetWebhook(TelegramMethod[bool]):
certificate: Optional[InputFile] = None,
ip_address: Optional[str] = None,
max_connections: Optional[int] = None,
- allowed_updates: Optional[List[str]] = None,
+ allowed_updates: Optional[list[str]] = None,
drop_pending_updates: Optional[bool] = None,
secret_token: Optional[str] = None,
**__pydantic_kwargs: Any,
diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py
index a87f9811..414dc2a0 100644
--- a/aiogram/types/__init__.py
+++ b/aiogram/types/__init__.py
@@ -63,6 +63,7 @@ from .chat_photo import ChatPhoto
from .chat_shared import ChatShared
from .chosen_inline_result import ChosenInlineResult
from .contact import Contact
+from .copy_text_button import CopyTextButton
from .custom import DateTime
from .dice import Dice
from .document import Document
@@ -215,6 +216,7 @@ from .transaction_partner import TransactionPartner
from .transaction_partner_fragment import TransactionPartnerFragment
from .transaction_partner_other import TransactionPartnerOther
from .transaction_partner_telegram_ads import TransactionPartnerTelegramAds
+from .transaction_partner_telegram_api import TransactionPartnerTelegramApi
from .transaction_partner_user import TransactionPartnerUser
from .update import Update
from .user import User
@@ -298,6 +300,7 @@ __all__ = (
"ChosenInlineResult",
"Contact",
"ContentType",
+ "CopyTextButton",
"DateTime",
"Dice",
"Document",
@@ -450,6 +453,7 @@ __all__ = (
"TransactionPartnerFragment",
"TransactionPartnerOther",
"TransactionPartnerTelegramAds",
+ "TransactionPartnerTelegramApi",
"TransactionPartnerUser",
"UNSET_PARSE_MODE",
"URLInputFile",
diff --git a/aiogram/types/background_fill_freeform_gradient.py b/aiogram/types/background_fill_freeform_gradient.py
index 916f6a73..5e281a5c 100644
--- a/aiogram/types/background_fill_freeform_gradient.py
+++ b/aiogram/types/background_fill_freeform_gradient.py
@@ -1,4 +1,4 @@
-from typing import TYPE_CHECKING, Any, List, Literal
+from typing import TYPE_CHECKING, Any, Literal
from .background_fill import BackgroundFill
@@ -12,7 +12,7 @@ class BackgroundFillFreeformGradient(BackgroundFill):
type: Literal["freeform_gradient"] = "freeform_gradient"
"""Type of the background fill, always 'freeform_gradient'"""
- colors: List[int]
+ colors: list[int]
"""A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format"""
if TYPE_CHECKING:
@@ -23,7 +23,7 @@ class BackgroundFillFreeformGradient(BackgroundFill):
__pydantic__self__,
*,
type: Literal["freeform_gradient"] = "freeform_gradient",
- colors: List[int],
+ colors: list[int],
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/types/business_messages_deleted.py b/aiogram/types/business_messages_deleted.py
index 44bc45fa..3263f667 100644
--- a/aiogram/types/business_messages_deleted.py
+++ b/aiogram/types/business_messages_deleted.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List
+from typing import TYPE_CHECKING, Any
from .base import TelegramObject
@@ -19,7 +19,7 @@ class BusinessMessagesDeleted(TelegramObject):
"""Unique identifier of the business connection"""
chat: Chat
"""Information about a chat in the business account. The bot may not have access to the chat or the corresponding user."""
- message_ids: List[int]
+ message_ids: list[int]
"""The list of identifiers of deleted messages in the chat of the business account"""
if TYPE_CHECKING:
@@ -31,7 +31,7 @@ class BusinessMessagesDeleted(TelegramObject):
*,
business_connection_id: str,
chat: Chat,
- message_ids: List[int],
+ message_ids: list[int],
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/types/business_opening_hours.py b/aiogram/types/business_opening_hours.py
index 7fd5c754..8c12409d 100644
--- a/aiogram/types/business_opening_hours.py
+++ b/aiogram/types/business_opening_hours.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List
+from typing import TYPE_CHECKING, Any
from .base import TelegramObject
@@ -17,7 +17,7 @@ class BusinessOpeningHours(TelegramObject):
time_zone_name: str
"""Unique name of the time zone for which the opening hours are defined"""
- opening_hours: List[BusinessOpeningHoursInterval]
+ opening_hours: list[BusinessOpeningHoursInterval]
"""List of time intervals describing business opening hours"""
if TYPE_CHECKING:
@@ -28,7 +28,7 @@ class BusinessOpeningHours(TelegramObject):
__pydantic__self__,
*,
time_zone_name: str,
- opening_hours: List[BusinessOpeningHoursInterval],
+ opening_hours: list[BusinessOpeningHoursInterval],
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py
index c4feba4b..ddb0f983 100644
--- a/aiogram/types/chat.py
+++ b/aiogram/types/chat.py
@@ -1,7 +1,7 @@
from __future__ import annotations
import datetime
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -79,13 +79,13 @@ class Chat(TelegramObject):
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
- active_usernames: Optional[List[str]] = Field(None, json_schema_extra={"deprecated": True})
+ active_usernames: Optional[list[str]] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. If non-empty, the list of all `active chat usernames `_; for private chats, supergroups and channels. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
available_reactions: Optional[
- List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
+ list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions `_ are allowed. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
@@ -283,9 +283,9 @@ class Chat(TelegramObject):
last_name: Optional[str] = None,
is_forum: Optional[bool] = None,
accent_color_id: Optional[int] = None,
- active_usernames: Optional[List[str]] = None,
+ active_usernames: Optional[list[str]] = None,
available_reactions: Optional[
- List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
+ list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
] = None,
background_custom_emoji_id: Optional[str] = None,
bio: Optional[str] = None,
diff --git a/aiogram/types/chat_full_info.py b/aiogram/types/chat_full_info.py
index c6399391..c73e4506 100644
--- a/aiogram/types/chat_full_info.py
+++ b/aiogram/types/chat_full_info.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from .chat import Chat
from .custom import DateTime
@@ -46,7 +46,7 @@ class ChatFullInfo(Chat):
"""*Optional*. :code:`True`, if the supergroup chat is a forum (has `topics `_ enabled)"""
photo: Optional[ChatPhoto] = None
"""*Optional*. Chat photo"""
- active_usernames: Optional[List[str]] = None
+ active_usernames: Optional[list[str]] = None
"""*Optional*. If non-empty, the list of all `active chat usernames `_; for private chats, supergroups and channels"""
birthdate: Optional[Birthdate] = None
"""*Optional*. For private chats, the date of birth of the user"""
@@ -59,7 +59,7 @@ class ChatFullInfo(Chat):
personal_chat: Optional[Chat] = None
"""*Optional*. For private chats, the personal channel of the user"""
available_reactions: Optional[
- List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
+ list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
] = None
"""*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions `_ are allowed."""
background_custom_emoji_id: Optional[str] = None
@@ -134,14 +134,14 @@ class ChatFullInfo(Chat):
last_name: Optional[str] = None,
is_forum: Optional[bool] = None,
photo: Optional[ChatPhoto] = None,
- active_usernames: Optional[List[str]] = None,
+ active_usernames: Optional[list[str]] = None,
birthdate: Optional[Birthdate] = None,
business_intro: Optional[BusinessIntro] = None,
business_location: Optional[BusinessLocation] = None,
business_opening_hours: Optional[BusinessOpeningHours] = None,
personal_chat: Optional[Chat] = None,
available_reactions: Optional[
- List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
+ list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
] = None,
background_custom_emoji_id: Optional[str] = None,
profile_accent_color_id: Optional[int] = None,
diff --git a/aiogram/types/chat_join_request.py b/aiogram/types/chat_join_request.py
index 6b900611..36bc67fc 100644
--- a/aiogram/types/chat_join_request.py
+++ b/aiogram/types/chat_join_request.py
@@ -1,7 +1,7 @@
from __future__ import annotations
import datetime
-from typing import TYPE_CHECKING, Any, List, Optional, Union
+from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
@@ -161,12 +161,13 @@ class ChatJoinRequest(TelegramObject):
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -197,6 +198,7 @@ class ChatJoinRequest(TelegramObject):
:param link_preview_options: Link preview generation options for 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 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; for private chats only
: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
@@ -220,6 +222,7 @@ class ChatJoinRequest(TelegramObject):
link_preview_options=link_preview_options,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -235,12 +238,13 @@ class ChatJoinRequest(TelegramObject):
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -271,6 +275,7 @@ class ChatJoinRequest(TelegramObject):
:param link_preview_options: Link preview generation options for 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 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; for private chats only
: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
@@ -294,6 +299,7 @@ class ChatJoinRequest(TelegramObject):
link_preview_options=link_preview_options,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -314,13 +320,14 @@ class ChatJoinRequest(TelegramObject):
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -354,6 +361,7 @@ class ChatJoinRequest(TelegramObject):
:param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation
: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; for private chats only
: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
@@ -382,6 +390,7 @@ class ChatJoinRequest(TelegramObject):
has_spoiler=has_spoiler,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -401,13 +410,14 @@ class ChatJoinRequest(TelegramObject):
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -441,6 +451,7 @@ class ChatJoinRequest(TelegramObject):
:param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation
: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; for private chats only
: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
@@ -469,6 +480,7 @@ class ChatJoinRequest(TelegramObject):
has_spoiler=has_spoiler,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -484,13 +496,14 @@ class ChatJoinRequest(TelegramObject):
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -523,6 +536,7 @@ class ChatJoinRequest(TelegramObject):
: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 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; for private chats only
: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
@@ -549,6 +563,7 @@ class ChatJoinRequest(TelegramObject):
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -564,13 +579,14 @@ class ChatJoinRequest(TelegramObject):
message_thread_id: Optional[int] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -603,6 +619,7 @@ class ChatJoinRequest(TelegramObject):
: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 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; for private chats only
: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
@@ -629,6 +646,7 @@ class ChatJoinRequest(TelegramObject):
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -647,6 +665,7 @@ class ChatJoinRequest(TelegramObject):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -674,6 +693,7 @@ class ChatJoinRequest(TelegramObject):
:param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes
: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; for private chats only
: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
@@ -696,6 +716,7 @@ class ChatJoinRequest(TelegramObject):
vcard=vcard,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -714,6 +735,7 @@ class ChatJoinRequest(TelegramObject):
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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -741,6 +763,7 @@ class ChatJoinRequest(TelegramObject):
:param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes
: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; for private chats only
: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
@@ -763,6 +786,7 @@ class ChatJoinRequest(TelegramObject):
vcard=vcard,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -779,10 +803,11 @@ class ChatJoinRequest(TelegramObject):
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -812,6 +837,7 @@ class ChatJoinRequest(TelegramObject):
:param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data
: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; for private chats only
: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
@@ -836,6 +862,7 @@ class ChatJoinRequest(TelegramObject):
disable_content_type_detection=disable_content_type_detection,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -852,10 +879,11 @@ class ChatJoinRequest(TelegramObject):
thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
- caption_entities: Optional[List[MessageEntity]] = None,
+ 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,
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
@@ -885,6 +913,7 @@ class ChatJoinRequest(TelegramObject):
:param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data
: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; for private chats only
: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
@@ -909,6 +938,7 @@ class ChatJoinRequest(TelegramObject):
disable_content_type_detection=disable_content_type_detection,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -924,6 +954,7 @@ class ChatJoinRequest(TelegramObject):
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,
@@ -946,6 +977,7 @@ class ChatJoinRequest(TelegramObject):
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups 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
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
:param reply_parameters: Description of the message to reply to
:param reply_markup: 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.
@@ -965,6 +997,7 @@ class ChatJoinRequest(TelegramObject):
message_thread_id=message_thread_id,
disable_notification=disable_notification,
protect_content=protect_content,
+ allow_paid_broadcast=allow_paid_broadcast,
message_effect_id=message_effect_id,
reply_parameters=reply_parameters,
reply_markup=reply_markup,
@@ -980,6 +1013,7 @@ class ChatJoinRequest(TelegramObject):
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,
@@ -1002,6 +1036,7 @@ class ChatJoinRequest(TelegramObject):
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups 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
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
:param reply_parameters: Description of the message to reply to
:param reply_markup: A JSON-serialized object for an `inline keyboard