diff --git a/.butcher/enums/ReactionTypeType.yml b/.butcher/enums/ReactionTypeType.yml index 10e97c8d..d1c46cc1 100644 --- a/.butcher/enums/ReactionTypeType.yml +++ b/.butcher/enums/ReactionTypeType.yml @@ -9,3 +9,4 @@ multi_parse: entities: - ReactionTypeEmoji - ReactionTypeCustomEmoji + - ReactionTypePaid diff --git a/.butcher/enums/TransactionPartnerType.yml b/.butcher/enums/TransactionPartnerType.yml index 5e52ef79..bb4445f9 100644 --- a/.butcher/enums/TransactionPartnerType.yml +++ b/.butcher/enums/TransactionPartnerType.yml @@ -11,3 +11,4 @@ multi_parse: - TransactionPartnerOther - TransactionPartnerUser - TransactionPartnerTelegramAds + - TransactionPartnerTelegramApi diff --git a/.butcher/methods/copyMessage/entity.json b/.butcher/methods/copyMessage/entity.json index 72ddbc3c..2558062e 100644 --- a/.butcher/methods/copyMessage/entity.json +++ b/.butcher/methods/copyMessage/entity.json @@ -91,6 +91,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, diff --git a/.butcher/methods/editMessageMedia/entity.json b/.butcher/methods/editMessageMedia/entity.json index 95d72dfb..6910b3c7 100644 --- a/.butcher/methods/editMessageMedia/entity.json +++ b/.butcher/methods/editMessageMedia/entity.json @@ -7,9 +7,9 @@ "object": { "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", diff --git a/.butcher/methods/sendAnimation/entity.json b/.butcher/methods/sendAnimation/entity.json index 987e6fec..28b9b828 100644 --- a/.butcher/methods/sendAnimation/entity.json +++ b/.butcher/methods/sendAnimation/entity.json @@ -131,6 +131,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/methods/sendAudio/entity.json b/.butcher/methods/sendAudio/entity.json index bc81c541..fd4b4b99 100644 --- a/.butcher/methods/sendAudio/entity.json +++ b/.butcher/methods/sendAudio/entity.json @@ -115,6 +115,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/methods/sendContact/entity.json b/.butcher/methods/sendContact/entity.json index 315b35b9..fb8e3715 100644 --- a/.butcher/methods/sendContact/entity.json +++ b/.butcher/methods/sendContact/entity.json @@ -83,6 +83,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/methods/sendDice/entity.json b/.butcher/methods/sendDice/entity.json index d2faf000..32d07276 100644 --- a/.butcher/methods/sendDice/entity.json +++ b/.butcher/methods/sendDice/entity.json @@ -59,6 +59,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, diff --git a/.butcher/methods/sendDocument/entity.json b/.butcher/methods/sendDocument/entity.json index ca887f8e..812aeb2e 100644 --- a/.butcher/methods/sendDocument/entity.json +++ b/.butcher/methods/sendDocument/entity.json @@ -99,6 +99,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/methods/sendGame/entity.json b/.butcher/methods/sendGame/entity.json index 0d83c915..4c39988f 100644 --- a/.butcher/methods/sendGame/entity.json +++ b/.butcher/methods/sendGame/entity.json @@ -59,6 +59,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/methods/sendInvoice/entity.json b/.butcher/methods/sendInvoice/entity.json index e44939ff..b28c37b3 100644 --- a/.butcher/methods/sendInvoice/entity.json +++ b/.butcher/methods/sendInvoice/entity.json @@ -211,6 +211,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/methods/sendLocation/entity.json b/.butcher/methods/sendLocation/entity.json index 0685980e..9ecfa2bc 100644 --- a/.butcher/methods/sendLocation/entity.json +++ b/.butcher/methods/sendLocation/entity.json @@ -99,6 +99,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/methods/sendMediaGroup/entity.json b/.butcher/methods/sendMediaGroup/entity.json index 91734565..00e76db1 100644 --- a/.butcher/methods/sendMediaGroup/entity.json +++ b/.butcher/methods/sendMediaGroup/entity.json @@ -59,6 +59,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, diff --git a/.butcher/methods/sendMessage/entity.json b/.butcher/methods/sendMessage/entity.json index 60ec3634..d8a2c5af 100644 --- a/.butcher/methods/sendMessage/entity.json +++ b/.butcher/methods/sendMessage/entity.json @@ -83,6 +83,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/methods/sendPaidMedia/entity.json b/.butcher/methods/sendPaidMedia/entity.json index 9e6621e0..cb6d7412 100644 --- a/.butcher/methods/sendPaidMedia/entity.json +++ b/.butcher/methods/sendPaidMedia/entity.json @@ -99,6 +99,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, diff --git a/.butcher/methods/sendPhoto/entity.json b/.butcher/methods/sendPhoto/entity.json index b7c6cdff..08fd33ec 100644 --- a/.butcher/methods/sendPhoto/entity.json +++ b/.butcher/methods/sendPhoto/entity.json @@ -99,6 +99,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/methods/sendPoll/entity.json b/.butcher/methods/sendPoll/entity.json index 106a6eac..10a9b6ae 100644 --- a/.butcher/methods/sendPoll/entity.json +++ b/.butcher/methods/sendPoll/entity.json @@ -163,6 +163,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/methods/sendSticker/entity.json b/.butcher/methods/sendSticker/entity.json index e14bac32..e882b083 100644 --- a/.butcher/methods/sendSticker/entity.json +++ b/.butcher/methods/sendSticker/entity.json @@ -67,6 +67,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/methods/sendVenue/entity.json b/.butcher/methods/sendVenue/entity.json index 18b869d1..fc488a6d 100644 --- a/.butcher/methods/sendVenue/entity.json +++ b/.butcher/methods/sendVenue/entity.json @@ -115,6 +115,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/methods/sendVideo/entity.json b/.butcher/methods/sendVideo/entity.json index b6f21f09..5d1e021a 100644 --- a/.butcher/methods/sendVideo/entity.json +++ b/.butcher/methods/sendVideo/entity.json @@ -139,6 +139,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/methods/sendVideoNote/entity.json b/.butcher/methods/sendVideoNote/entity.json index a9529783..323e0905 100644 --- a/.butcher/methods/sendVideoNote/entity.json +++ b/.butcher/methods/sendVideoNote/entity.json @@ -83,6 +83,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/methods/sendVoice/entity.json b/.butcher/methods/sendVoice/entity.json index e3464acd..ea16856a 100644 --- a/.butcher/methods/sendVoice/entity.json +++ b/.butcher/methods/sendVoice/entity.json @@ -91,6 +91,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/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 `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. @@ -1021,6 +1056,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, @@ -1035,11 +1071,11 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1055,6 +1091,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1096,6 +1133,7 @@ class ChatJoinRequest(TelegramObject): :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. @@ -1134,6 +1172,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1148,11 +1187,11 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1168,6 +1207,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1209,6 +1249,7 @@ class ChatJoinRequest(TelegramObject): :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. @@ -1247,6 +1288,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1267,6 +1309,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -1296,6 +1339,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -1320,6 +1364,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1340,6 +1385,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -1369,6 +1415,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -1393,6 +1440,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1403,11 +1451,12 @@ class ChatJoinRequest(TelegramObject): def answer_media_group( self, - 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, @@ -1429,6 +1478,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 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 @@ -1447,6 +1497,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, allow_sending_without_reply=allow_sending_without_reply, @@ -1456,11 +1507,12 @@ class ChatJoinRequest(TelegramObject): def answer_media_group_pm( self, - 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, @@ -1482,6 +1534,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 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 @@ -1500,6 +1553,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, allow_sending_without_reply=allow_sending_without_reply, @@ -1514,13 +1568,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, 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[ @@ -1550,6 +1605,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -1574,6 +1630,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, @@ -1589,13 +1646,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, 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[ @@ -1625,6 +1683,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -1649,6 +1708,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, @@ -1660,23 +1720,24 @@ class ChatJoinRequest(TelegramObject): def answer_poll( self, 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[ @@ -1714,6 +1775,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -1746,6 +1808,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1757,23 +1820,24 @@ class ChatJoinRequest(TelegramObject): def answer_poll_pm( self, 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[ @@ -1811,6 +1875,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -1843,6 +1908,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1858,6 +1924,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -1882,6 +1949,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -1901,6 +1969,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1916,6 +1985,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -1940,6 +2010,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -1959,6 +2030,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -1975,6 +2047,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -2000,6 +2073,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -2020,6 +2094,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -2036,6 +2111,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -2061,6 +2137,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -2081,6 +2158,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -2103,6 +2181,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -2134,6 +2213,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -2160,6 +2240,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -2182,6 +2263,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -2213,6 +2295,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -2239,6 +2322,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -2258,7 +2342,7 @@ 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" ), @@ -2266,6 +2350,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -2300,6 +2385,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -2329,6 +2415,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -2348,7 +2435,7 @@ 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" ), @@ -2356,6 +2443,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -2390,6 +2478,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -2419,6 +2508,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -2437,6 +2527,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -2464,6 +2555,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 @@ -2486,6 +2578,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, @@ -2504,6 +2597,7 @@ class ChatJoinRequest(TelegramObject): 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[ @@ -2531,6 +2625,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 @@ -2553,6 +2648,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, @@ -2568,10 +2664,11 @@ 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, 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[ @@ -2600,6 +2697,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -2623,6 +2721,7 @@ class ChatJoinRequest(TelegramObject): 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, @@ -2638,10 +2737,11 @@ 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, 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[ @@ -2670,6 +2770,7 @@ class ChatJoinRequest(TelegramObject): :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 @@ -2693,6 +2794,7 @@ class ChatJoinRequest(TelegramObject): 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/types/chat_member_updated.py b/aiogram/types/chat_member_updated.py index 233e1e6b..a418fdd6 100644 --- a/aiogram/types/chat_member_updated.py +++ b/aiogram/types/chat_member_updated.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 @@ -145,12 +145,13 @@ class ChatMemberUpdated(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[ @@ -181,6 +182,7 @@ class ChatMemberUpdated(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 @@ -204,6 +206,7 @@ class ChatMemberUpdated(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, @@ -224,13 +227,14 @@ class ChatMemberUpdated(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[ @@ -264,6 +268,7 @@ class ChatMemberUpdated(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 @@ -292,6 +297,7 @@ class ChatMemberUpdated(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, @@ -307,13 +313,14 @@ class ChatMemberUpdated(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[ @@ -346,6 +353,7 @@ class ChatMemberUpdated(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 @@ -372,6 +380,7 @@ class ChatMemberUpdated(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, @@ -390,6 +399,7 @@ class ChatMemberUpdated(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[ @@ -417,6 +427,7 @@ class ChatMemberUpdated(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 @@ -439,6 +450,7 @@ class ChatMemberUpdated(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, @@ -455,10 +467,11 @@ class ChatMemberUpdated(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[ @@ -488,6 +501,7 @@ class ChatMemberUpdated(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 @@ -512,6 +526,7 @@ class ChatMemberUpdated(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, @@ -527,6 +542,7 @@ class ChatMemberUpdated(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, @@ -549,6 +565,7 @@ class ChatMemberUpdated(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. @@ -568,6 +585,7 @@ class ChatMemberUpdated(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, @@ -582,11 +600,11 @@ class ChatMemberUpdated(TelegramObject): 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, @@ -602,6 +620,7 @@ class ChatMemberUpdated(TelegramObject): 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, @@ -643,6 +662,7 @@ class ChatMemberUpdated(TelegramObject): :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. @@ -681,6 +701,7 @@ class ChatMemberUpdated(TelegramObject): 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, @@ -701,6 +722,7 @@ class ChatMemberUpdated(TelegramObject): 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[ @@ -730,6 +752,7 @@ class ChatMemberUpdated(TelegramObject): :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 @@ -754,6 +777,7 @@ class ChatMemberUpdated(TelegramObject): 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, @@ -764,11 +788,12 @@ class ChatMemberUpdated(TelegramObject): def answer_media_group( self, - 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, @@ -790,6 +815,7 @@ class ChatMemberUpdated(TelegramObject): :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 @@ -808,6 +834,7 @@ class ChatMemberUpdated(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, allow_sending_without_reply=allow_sending_without_reply, @@ -822,13 +849,14 @@ class ChatMemberUpdated(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, 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[ @@ -858,6 +886,7 @@ class ChatMemberUpdated(TelegramObject): :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 @@ -882,6 +911,7 @@ class ChatMemberUpdated(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, @@ -893,23 +923,24 @@ class ChatMemberUpdated(TelegramObject): def answer_poll( self, 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[ @@ -947,6 +978,7 @@ class ChatMemberUpdated(TelegramObject): :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 @@ -979,6 +1011,7 @@ class ChatMemberUpdated(TelegramObject): 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, @@ -994,6 +1027,7 @@ class ChatMemberUpdated(TelegramObject): 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[ @@ -1018,6 +1052,7 @@ class ChatMemberUpdated(TelegramObject): :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 @@ -1037,6 +1072,7 @@ class ChatMemberUpdated(TelegramObject): 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, @@ -1053,6 +1089,7 @@ class ChatMemberUpdated(TelegramObject): 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[ @@ -1078,6 +1115,7 @@ class ChatMemberUpdated(TelegramObject): :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 @@ -1098,6 +1136,7 @@ class ChatMemberUpdated(TelegramObject): 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, @@ -1120,6 +1159,7 @@ class ChatMemberUpdated(TelegramObject): 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[ @@ -1151,6 +1191,7 @@ class ChatMemberUpdated(TelegramObject): :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 @@ -1177,6 +1218,7 @@ class ChatMemberUpdated(TelegramObject): 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, @@ -1196,7 +1238,7 @@ class ChatMemberUpdated(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" ), @@ -1204,6 +1246,7 @@ class ChatMemberUpdated(TelegramObject): 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[ @@ -1238,6 +1281,7 @@ class ChatMemberUpdated(TelegramObject): :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 @@ -1267,6 +1311,7 @@ class ChatMemberUpdated(TelegramObject): 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, @@ -1285,6 +1330,7 @@ class ChatMemberUpdated(TelegramObject): 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[ @@ -1312,6 +1358,7 @@ class ChatMemberUpdated(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 @@ -1334,6 +1381,7 @@ class ChatMemberUpdated(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, @@ -1349,10 +1397,11 @@ class ChatMemberUpdated(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, 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[ @@ -1381,6 +1430,7 @@ class ChatMemberUpdated(TelegramObject): :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 @@ -1404,6 +1454,7 @@ class ChatMemberUpdated(TelegramObject): 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/types/chat_shared.py b/aiogram/types/chat_shared.py index 92d62316..73be7b1f 100644 --- a/aiogram/types/chat_shared.py +++ b/aiogram/types/chat_shared.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 aiogram.types import TelegramObject @@ -23,7 +23,7 @@ class ChatShared(TelegramObject): """*Optional*. Title of the chat, if the title was requested by the bot.""" username: Optional[str] = None """*Optional*. Username of the chat, if the username was requested by the bot and available.""" - photo: Optional[List[PhotoSize]] = None + photo: Optional[list[PhotoSize]] = None """*Optional*. Available sizes of the chat photo, if the photo was requested by the bot""" if TYPE_CHECKING: @@ -37,7 +37,7 @@ class ChatShared(TelegramObject): chat_id: int, title: Optional[str] = None, username: Optional[str] = None, - photo: Optional[List[PhotoSize]] = None, + photo: Optional[list[PhotoSize]] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/copy_text_button.py b/aiogram/types/copy_text_button.py new file mode 100644 index 00000000..98790b55 --- /dev/null +++ b/aiogram/types/copy_text_button.py @@ -0,0 +1,27 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + + +class CopyTextButton(TelegramObject): + """ + This object represents an inline keyboard button that copies specified text to the clipboard. + + Source: https://core.telegram.org/bots/api#copytextbutton + """ + + text: str + """The text to be copied to the clipboard; 1-256 characters""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__(__pydantic__self__, *, text: str, **__pydantic_kwargs: Any) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(text=text, **__pydantic_kwargs) diff --git a/aiogram/types/encrypted_passport_element.py b/aiogram/types/encrypted_passport_element.py index c1e8be11..efc779b3 100644 --- a/aiogram/types/encrypted_passport_element.py +++ b/aiogram/types/encrypted_passport_element.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 TelegramObject @@ -25,7 +25,7 @@ class EncryptedPassportElement(TelegramObject): """*Optional*. User's verified phone number; available only for 'phone_number' type""" email: Optional[str] = None """*Optional*. User's verified email address; available only for 'email' type""" - files: Optional[List[PassportFile]] = None + files: Optional[list[PassportFile]] = None """*Optional*. Array of encrypted files with documents provided by the user; available only for 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' types. Files can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" front_side: Optional[PassportFile] = None """*Optional*. Encrypted file with the front side of the document, provided by the user; available only for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" @@ -33,7 +33,7 @@ class EncryptedPassportElement(TelegramObject): """*Optional*. Encrypted file with the reverse side of the document, provided by the user; available only for 'driver_license' and 'identity_card'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" selfie: Optional[PassportFile] = None """*Optional*. Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" - translation: Optional[List[PassportFile]] = None + translation: Optional[list[PassportFile]] = None """*Optional*. Array of encrypted files with translated versions of documents provided by the user; available if requested for 'passport', 'driver_license', 'identity_card', 'internal_passport', 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' types. Files can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" if TYPE_CHECKING: @@ -48,11 +48,11 @@ class EncryptedPassportElement(TelegramObject): data: Optional[str] = None, phone_number: Optional[str] = None, email: Optional[str] = None, - files: Optional[List[PassportFile]] = None, + files: Optional[list[PassportFile]] = None, front_side: Optional[PassportFile] = None, reverse_side: Optional[PassportFile] = None, selfie: Optional[PassportFile] = None, - translation: Optional[List[PassportFile]] = None, + translation: Optional[list[PassportFile]] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/external_reply_info.py b/aiogram/types/external_reply_info.py index 0f13a850..260fa6ff 100644 --- a/aiogram/types/external_reply_info.py +++ b/aiogram/types/external_reply_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 .base import TelegramObject @@ -57,7 +57,7 @@ class ExternalReplyInfo(TelegramObject): """*Optional*. Message is a general file, information about the file""" paid_media: Optional[PaidMediaInfo] = None """*Optional*. Message contains paid media; information about the paid media""" - photo: Optional[List[PhotoSize]] = None + photo: Optional[list[PhotoSize]] = None """*Optional*. Message is a photo, available sizes of the photo""" sticker: Optional[Sticker] = None """*Optional*. Message is a sticker, information about the sticker""" @@ -107,7 +107,7 @@ class ExternalReplyInfo(TelegramObject): audio: Optional[Audio] = None, document: Optional[Document] = None, paid_media: Optional[PaidMediaInfo] = None, - photo: Optional[List[PhotoSize]] = None, + photo: Optional[list[PhotoSize]] = None, sticker: Optional[Sticker] = None, story: Optional[Story] = None, video: Optional[Video] = None, diff --git a/aiogram/types/game.py b/aiogram/types/game.py index 294f26b9..e3388fe4 100644 --- a/aiogram/types/game.py +++ b/aiogram/types/game.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 TelegramObject @@ -21,11 +21,11 @@ class Game(TelegramObject): """Title of the game""" description: str """Description of the game""" - photo: List[PhotoSize] + photo: list[PhotoSize] """Photo that will be displayed in the game message in chats.""" text: Optional[str] = None """*Optional*. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls :class:`aiogram.methods.set_game_score.SetGameScore`, or manually edited using :class:`aiogram.methods.edit_message_text.EditMessageText`. 0-4096 characters.""" - text_entities: Optional[List[MessageEntity]] = None + text_entities: Optional[list[MessageEntity]] = None """*Optional*. Special entities that appear in *text*, such as usernames, URLs, bot commands, etc.""" animation: Optional[Animation] = None """*Optional*. Animation that will be displayed in the game message in chats. Upload via `BotFather `_""" @@ -39,9 +39,9 @@ class Game(TelegramObject): *, title: str, description: str, - photo: List[PhotoSize], + photo: list[PhotoSize], text: Optional[str] = None, - text_entities: Optional[List[MessageEntity]] = None, + text_entities: Optional[list[MessageEntity]] = None, animation: Optional[Animation] = None, **__pydantic_kwargs: Any, ) -> None: diff --git a/aiogram/types/giveaway.py b/aiogram/types/giveaway.py index e80513e7..f18e3e30 100644 --- a/aiogram/types/giveaway.py +++ b/aiogram/types/giveaway.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 TelegramObject @@ -16,7 +16,7 @@ class Giveaway(TelegramObject): Source: https://core.telegram.org/bots/api#giveaway """ - chats: List[Chat] + chats: list[Chat] """The list of chats which the user must join to participate in the giveaway""" winners_selection_date: DateTime """Point in time (Unix timestamp) when winners of the giveaway will be selected""" @@ -28,7 +28,7 @@ class Giveaway(TelegramObject): """*Optional*. :code:`True`, if the list of giveaway winners will be visible to everyone""" prize_description: Optional[str] = None """*Optional*. Description of additional giveaway prize""" - country_codes: Optional[List[str]] = None + country_codes: Optional[list[str]] = None """*Optional*. A list of two-letter `ISO 3166-1 alpha-2 `_ country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.""" prize_star_count: Optional[int] = None """*Optional*. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only""" @@ -42,13 +42,13 @@ class Giveaway(TelegramObject): def __init__( __pydantic__self__, *, - chats: List[Chat], + chats: list[Chat], winners_selection_date: DateTime, winner_count: int, only_new_members: Optional[bool] = None, has_public_winners: Optional[bool] = None, prize_description: Optional[str] = None, - country_codes: Optional[List[str]] = None, + country_codes: Optional[list[str]] = None, prize_star_count: Optional[int] = None, premium_subscription_month_count: Optional[int] = None, **__pydantic_kwargs: Any, diff --git a/aiogram/types/giveaway_winners.py b/aiogram/types/giveaway_winners.py index 5abcec8d..b364c65b 100644 --- a/aiogram/types/giveaway_winners.py +++ b/aiogram/types/giveaway_winners.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 TelegramObject @@ -25,7 +25,7 @@ class GiveawayWinners(TelegramObject): """Point in time (Unix timestamp) when winners of the giveaway were selected""" winner_count: int """Total number of winners in the giveaway""" - winners: List[User] + winners: list[User] """List of up to 100 winners of the giveaway""" additional_chat_count: Optional[int] = None """*Optional*. The number of other chats the user had to join in order to be eligible for the giveaway""" @@ -53,7 +53,7 @@ class GiveawayWinners(TelegramObject): giveaway_message_id: int, winners_selection_date: DateTime, winner_count: int, - winners: List[User], + winners: list[User], additional_chat_count: Optional[int] = None, prize_star_count: Optional[int] = None, premium_subscription_month_count: Optional[int] = None, diff --git a/aiogram/types/inaccessible_message.py b/aiogram/types/inaccessible_message.py index b1e92818..c4d48265 100644 --- a/aiogram/types/inaccessible_message.py +++ b/aiogram/types/inaccessible_message.py @@ -11,15 +11,6 @@ from .reply_parameters import ReplyParameters if TYPE_CHECKING: from ..methods import ( - CopyMessage, - DeleteMessage, - EditMessageCaption, - EditMessageLiveLocation, - EditMessageMedia, - EditMessageReplyMarkup, - EditMessageText, - ForwardMessage, - PinChatMessage, SendAnimation, SendAudio, SendContact, @@ -38,14 +29,10 @@ if TYPE_CHECKING: SendVideo, SendVideoNote, SendVoice, - SetMessageReaction, - StopMessageLiveLocation, - UnpinChatMessage, ) from .force_reply import ForceReply from .inline_keyboard_markup import InlineKeyboardMarkup from .input_file import InputFile - from .input_media_animation import InputMediaAnimation from .input_media_audio import InputMediaAudio from .input_media_document import InputMediaDocument from .input_media_photo import InputMediaPhoto @@ -53,13 +40,9 @@ if TYPE_CHECKING: from .input_paid_media_photo import InputPaidMediaPhoto from .input_paid_media_video import InputPaidMediaVideo from .input_poll_option import InputPollOption - from .invoice import Invoice from .labeled_price import LabeledPrice from .link_preview_options import LinkPreviewOptions from .message_entity import MessageEntity - from .reaction_type_custom_emoji import ReactionTypeCustomEmoji - from .reaction_type_emoji import ReactionTypeEmoji - from .reaction_type_paid import ReactionTypePaid from .reply_keyboard_markup import ReplyKeyboardMarkup from .reply_keyboard_remove import ReplyKeyboardRemove @@ -102,12 +85,13 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -138,6 +122,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -165,6 +150,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -180,12 +166,13 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -215,6 +202,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -241,6 +229,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -259,13 +248,14 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -299,6 +289,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -331,6 +322,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -350,13 +342,14 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -389,6 +382,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -420,6 +414,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -433,13 +428,14 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -472,6 +468,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -502,6 +499,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -517,13 +515,14 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -555,6 +554,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -584,6 +584,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -600,6 +601,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -627,6 +629,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -653,6 +656,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -671,6 +675,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -697,6 +702,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -722,6 +728,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -736,10 +743,11 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -769,6 +777,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -797,6 +806,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -813,10 +823,11 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -845,6 +856,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -872,6 +884,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -885,6 +898,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -907,6 +921,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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. @@ -930,6 +945,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -945,6 +961,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -966,6 +983,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -988,6 +1006,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1000,11 +1019,11 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -1020,6 +1039,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -1061,6 +1081,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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. @@ -1103,6 +1124,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -1117,11 +1139,11 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -1137,6 +1159,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1177,6 +1200,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1218,6 +1242,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1236,6 +1261,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -1265,6 +1291,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -1293,6 +1320,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -1313,6 +1341,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1341,6 +1370,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -1368,6 +1398,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1376,11 +1407,12 @@ class InaccessibleMessage(MaybeInaccessibleMessage): def answer_media_group( self, - 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, @@ -1402,6 +1434,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -1424,6 +1457,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -1433,11 +1467,12 @@ class InaccessibleMessage(MaybeInaccessibleMessage): def reply_media_group( self, - 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, allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, @@ -1458,6 +1493,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_media_group.SendMediaGroup` @@ -1479,6 +1515,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, allow_sending_without_reply=allow_sending_without_reply, **kwargs, @@ -1491,13 +1528,14 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -1527,6 +1565,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -1555,6 +1594,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -1570,13 +1610,14 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1605,6 +1646,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -1632,6 +1674,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1641,23 +1684,24 @@ class InaccessibleMessage(MaybeInaccessibleMessage): def answer_poll( self, 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[ @@ -1695,6 +1739,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -1731,6 +1776,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -1742,23 +1788,24 @@ class InaccessibleMessage(MaybeInaccessibleMessage): def reply_poll( self, 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1795,6 +1842,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -1830,6 +1878,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1843,6 +1892,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -1867,6 +1917,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -1890,6 +1941,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -1905,6 +1957,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1928,6 +1981,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -1950,6 +2004,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1964,6 +2019,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -1989,6 +2045,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -2013,6 +2070,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -2029,6 +2087,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2053,6 +2112,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -2076,6 +2136,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2096,6 +2157,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -2127,6 +2189,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -2157,6 +2220,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -2179,6 +2243,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2209,6 +2274,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -2238,6 +2304,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2255,7 +2322,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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" ), @@ -2263,6 +2330,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -2297,6 +2365,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -2330,6 +2399,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -2349,7 +2419,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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" ), @@ -2357,6 +2427,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2390,6 +2461,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -2422,6 +2494,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2438,6 +2511,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -2465,6 +2539,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -2491,6 +2566,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -2509,6 +2585,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2535,6 +2612,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -2560,6 +2638,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2573,10 +2652,11 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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[ @@ -2605,6 +2685,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 @@ -2632,6 +2713,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, @@ -2647,10 +2729,11 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2678,6 +2761,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 @@ -2704,6 +2788,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2713,15 +2798,16 @@ class InaccessibleMessage(MaybeInaccessibleMessage): def answer_paid_media( self, 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] @@ -2748,6 +2834,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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 :return: instance of method :class:`aiogram.methods.send_paid_media.SendPaidMedia` @@ -2773,6 +2860,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): 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, **kwargs, @@ -2781,15 +2869,16 @@ class InaccessibleMessage(MaybeInaccessibleMessage): def reply_paid_media( self, 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, @@ -2816,6 +2905,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :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_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 :return: instance of method :class:`aiogram.methods.send_paid_media.SendPaidMedia` """ @@ -2841,6 +2931,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_markup=reply_markup, **kwargs, ).as_(self._bot) diff --git a/aiogram/types/inline_keyboard_button.py b/aiogram/types/inline_keyboard_button.py index fa801f2c..21d72de5 100644 --- a/aiogram/types/inline_keyboard_button.py +++ b/aiogram/types/inline_keyboard_button.py @@ -6,6 +6,7 @@ from .base import MutableTelegramObject if TYPE_CHECKING: from .callback_game import CallbackGame + from .copy_text_button import CopyTextButton from .login_url import LoginUrl from .switch_inline_query_chosen_chat import SwitchInlineQueryChosenChat from .web_app_info import WebAppInfo @@ -34,6 +35,8 @@ class InlineKeyboardButton(MutableTelegramObject): """*Optional*. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.""" switch_inline_query_chosen_chat: Optional[SwitchInlineQueryChosenChat] = None """*Optional*. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account.""" + copy_text: Optional[CopyTextButton] = None + """*Optional*. Description of the button that copies the specified text to the clipboard.""" callback_game: Optional[CallbackGame] = None """*Optional*. Description of the game that will be launched when the user presses the button.""" pay: Optional[bool] = None @@ -54,6 +57,7 @@ class InlineKeyboardButton(MutableTelegramObject): switch_inline_query: Optional[str] = None, switch_inline_query_current_chat: Optional[str] = None, switch_inline_query_chosen_chat: Optional[SwitchInlineQueryChosenChat] = None, + copy_text: Optional[CopyTextButton] = None, callback_game: Optional[CallbackGame] = None, pay: Optional[bool] = None, **__pydantic_kwargs: Any, @@ -71,6 +75,7 @@ class InlineKeyboardButton(MutableTelegramObject): switch_inline_query=switch_inline_query, switch_inline_query_current_chat=switch_inline_query_current_chat, switch_inline_query_chosen_chat=switch_inline_query_chosen_chat, + copy_text=copy_text, callback_game=callback_game, pay=pay, **__pydantic_kwargs, diff --git a/aiogram/types/inline_keyboard_markup.py b/aiogram/types/inline_keyboard_markup.py index e5b89671..ef1f0945 100644 --- a/aiogram/types/inline_keyboard_markup.py +++ b/aiogram/types/inline_keyboard_markup.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 MutableTelegramObject @@ -15,7 +15,7 @@ class InlineKeyboardMarkup(MutableTelegramObject): Source: https://core.telegram.org/bots/api#inlinekeyboardmarkup """ - inline_keyboard: List[List[InlineKeyboardButton]] + inline_keyboard: list[list[InlineKeyboardButton]] """Array of button rows, each represented by an Array of :class:`aiogram.types.inline_keyboard_button.InlineKeyboardButton` objects""" if TYPE_CHECKING: @@ -25,7 +25,7 @@ class InlineKeyboardMarkup(MutableTelegramObject): def __init__( __pydantic__self__, *, - inline_keyboard: List[List[InlineKeyboardButton]], + inline_keyboard: list[list[InlineKeyboardButton]], **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/inline_query.py b/aiogram/types/inline_query.py index a0cad317..fefe0dd9 100644 --- a/aiogram/types/inline_query.py +++ b/aiogram/types/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 @@ -84,7 +84,7 @@ class InlineQuery(TelegramObject): def answer( self, - results: List[ + results: list[ Union[ InlineQueryResultCachedAudio, InlineQueryResultCachedDocument, diff --git a/aiogram/types/inline_query_result_audio.py b/aiogram/types/inline_query_result_audio.py index 56ef5f53..461d806e 100644 --- a/aiogram/types/inline_query_result_audio.py +++ b/aiogram/types/inline_query_result_audio.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -35,7 +35,7 @@ class InlineQueryResultAudio(InlineQueryResult): """*Optional*. Caption, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" performer: Optional[str] = None """*Optional*. Performer""" @@ -67,7 +67,7 @@ class InlineQueryResultAudio(InlineQueryResult): title: str, 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, performer: Optional[str] = None, audio_duration: Optional[int] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, diff --git a/aiogram/types/inline_query_result_cached_audio.py b/aiogram/types/inline_query_result_cached_audio.py index 27d923f0..e6137d69 100644 --- a/aiogram/types/inline_query_result_cached_audio.py +++ b/aiogram/types/inline_query_result_cached_audio.py @@ -33,7 +33,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult): """*Optional*. Caption, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" @@ -60,7 +60,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult): audio_file_id: str, 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, reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ diff --git a/aiogram/types/inline_query_result_cached_document.py b/aiogram/types/inline_query_result_cached_document.py index 8e0355e6..d3cf947a 100644 --- a/aiogram/types/inline_query_result_cached_document.py +++ b/aiogram/types/inline_query_result_cached_document.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -37,7 +37,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult): """*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" @@ -66,7 +66,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult): description: 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, reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ diff --git a/aiogram/types/inline_query_result_cached_gif.py b/aiogram/types/inline_query_result_cached_gif.py index 277454c9..d4cb9b68 100644 --- a/aiogram/types/inline_query_result_cached_gif.py +++ b/aiogram/types/inline_query_result_cached_gif.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -35,7 +35,7 @@ class InlineQueryResultCachedGif(InlineQueryResult): """*Optional*. Caption of the GIF file to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" - caption_entities: Optional[List[MessageEntity]] = None + caption_entities: Optional[list[MessageEntity]] = None """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -65,7 +65,7 @@ class InlineQueryResultCachedGif(InlineQueryResult): title: 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/types/inline_query_result_cached_mpeg4_gif.py b/aiogram/types/inline_query_result_cached_mpeg4_gif.py index ec043864..797bfaf3 100644 --- a/aiogram/types/inline_query_result_cached_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_cached_mpeg4_gif.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -35,7 +35,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): """*Optional*. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" - caption_entities: Optional[List[MessageEntity]] = None + caption_entities: Optional[list[MessageEntity]] = None """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -65,7 +65,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): title: 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/types/inline_query_result_cached_photo.py b/aiogram/types/inline_query_result_cached_photo.py index f40b203a..6f40806e 100644 --- a/aiogram/types/inline_query_result_cached_photo.py +++ b/aiogram/types/inline_query_result_cached_photo.py @@ -37,7 +37,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): """*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -68,7 +68,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): description: 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/types/inline_query_result_cached_video.py b/aiogram/types/inline_query_result_cached_video.py index 4095ab99..c961e7c3 100644 --- a/aiogram/types/inline_query_result_cached_video.py +++ b/aiogram/types/inline_query_result_cached_video.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -37,7 +37,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult): """*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -68,7 +68,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult): description: 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/types/inline_query_result_cached_voice.py b/aiogram/types/inline_query_result_cached_voice.py index 4cff896b..eb8a19a8 100644 --- a/aiogram/types/inline_query_result_cached_voice.py +++ b/aiogram/types/inline_query_result_cached_voice.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -35,7 +35,7 @@ class InlineQueryResultCachedVoice(InlineQueryResult): """*Optional*. Caption, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" @@ -63,7 +63,7 @@ class InlineQueryResultCachedVoice(InlineQueryResult): title: str, 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, reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ diff --git a/aiogram/types/inline_query_result_document.py b/aiogram/types/inline_query_result_document.py index 86ae993b..b52bfba5 100644 --- a/aiogram/types/inline_query_result_document.py +++ b/aiogram/types/inline_query_result_document.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -37,7 +37,7 @@ class InlineQueryResultDocument(InlineQueryResult): """*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" description: Optional[str] = None """*Optional*. Short description of the result""" @@ -74,7 +74,7 @@ class InlineQueryResultDocument(InlineQueryResult): mime_type: str, 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, description: Optional[str] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ diff --git a/aiogram/types/inline_query_result_gif.py b/aiogram/types/inline_query_result_gif.py index 3ad0eef8..2f56c652 100644 --- a/aiogram/types/inline_query_result_gif.py +++ b/aiogram/types/inline_query_result_gif.py @@ -1,10 +1,9 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType -from .base import UNSET_PARSE_MODE from .inline_query_result import InlineQueryResult if TYPE_CHECKING: @@ -46,7 +45,7 @@ class InlineQueryResultGif(InlineQueryResult): """*Optional*. Caption of the GIF file to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" - caption_entities: Optional[List[MessageEntity]] = None + caption_entities: Optional[list[MessageEntity]] = None """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -81,7 +80,7 @@ class InlineQueryResultGif(InlineQueryResult): title: 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/types/inline_query_result_mpeg4_gif.py b/aiogram/types/inline_query_result_mpeg4_gif.py index 6ca282e1..e1a39ae8 100644 --- a/aiogram/types/inline_query_result_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_mpeg4_gif.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -45,7 +45,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): """*Optional*. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" - caption_entities: Optional[List[MessageEntity]] = None + caption_entities: Optional[list[MessageEntity]] = None """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -80,7 +80,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): title: 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/types/inline_query_result_photo.py b/aiogram/types/inline_query_result_photo.py index 02f68415..942ad717 100644 --- a/aiogram/types/inline_query_result_photo.py +++ b/aiogram/types/inline_query_result_photo.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -43,7 +43,7 @@ class InlineQueryResultPhoto(InlineQueryResult): """*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -77,7 +77,7 @@ class InlineQueryResultPhoto(InlineQueryResult): description: 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/types/inline_query_result_video.py b/aiogram/types/inline_query_result_video.py index 52332fd7..54c9674c 100644 --- a/aiogram/types/inline_query_result_video.py +++ b/aiogram/types/inline_query_result_video.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -41,7 +41,7 @@ class InlineQueryResultVideo(InlineQueryResult): """*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -81,7 +81,7 @@ class InlineQueryResultVideo(InlineQueryResult): title: str, 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/types/inline_query_result_voice.py b/aiogram/types/inline_query_result_voice.py index a781fc69..0923a0e9 100644 --- a/aiogram/types/inline_query_result_voice.py +++ b/aiogram/types/inline_query_result_voice.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InlineQueryResultType @@ -35,7 +35,7 @@ class InlineQueryResultVoice(InlineQueryResult): """*Optional*. Caption, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" voice_duration: Optional[int] = None """*Optional*. Recording duration in seconds""" @@ -65,7 +65,7 @@ class InlineQueryResultVoice(InlineQueryResult): title: str, 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, voice_duration: Optional[int] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ diff --git a/aiogram/types/input_invoice_message_content.py b/aiogram/types/input_invoice_message_content.py index 10c6a1aa..014e015e 100644 --- a/aiogram/types/input_invoice_message_content.py +++ b/aiogram/types/input_invoice_message_content.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 .input_message_content import InputMessageContent @@ -23,13 +23,13 @@ class InputInvoiceMessageContent(InputMessageContent): """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 """*Optional*. Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.""" max_tip_amount: Optional[int] = None """*Optional*. 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 """*Optional*. A JSON-serialized array of suggested amounts of tip 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 """*Optional*. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.""" @@ -67,10 +67,10 @@ class InputInvoiceMessageContent(InputMessageContent): 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/types/input_media_animation.py b/aiogram/types/input_media_animation.py index a0251f23..89c5790c 100644 --- a/aiogram/types/input_media_animation.py +++ b/aiogram/types/input_media_animation.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InputMediaType @@ -28,7 +28,7 @@ class InputMediaAnimation(InputMedia): """*Optional*. Caption of the animation to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -53,7 +53,7 @@ class InputMediaAnimation(InputMedia): 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" ), diff --git a/aiogram/types/input_media_audio.py b/aiogram/types/input_media_audio.py index c3722011..bc5bb8ca 100644 --- a/aiogram/types/input_media_audio.py +++ b/aiogram/types/input_media_audio.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InputMediaType @@ -28,7 +28,7 @@ class InputMediaAudio(InputMedia): """*Optional*. Caption of the audio to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" duration: Optional[int] = None """*Optional*. Duration of the audio in seconds""" @@ -49,7 +49,7 @@ class InputMediaAudio(InputMedia): 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, duration: Optional[int] = None, performer: Optional[str] = None, title: Optional[str] = None, diff --git a/aiogram/types/input_media_document.py b/aiogram/types/input_media_document.py index 7c24b929..788d7ef1 100644 --- a/aiogram/types/input_media_document.py +++ b/aiogram/types/input_media_document.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InputMediaType @@ -28,7 +28,7 @@ class InputMediaDocument(InputMedia): """*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" disable_content_type_detection: Optional[bool] = None """*Optional*. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always :code:`True`, if the document is sent as part of an album.""" @@ -45,7 +45,7 @@ class InputMediaDocument(InputMedia): 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, **__pydantic_kwargs: Any, ) -> None: diff --git a/aiogram/types/input_media_photo.py b/aiogram/types/input_media_photo.py index 19daa261..91715284 100644 --- a/aiogram/types/input_media_photo.py +++ b/aiogram/types/input_media_photo.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InputMediaType @@ -26,7 +26,7 @@ class InputMediaPhoto(InputMedia): """*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -44,7 +44,7 @@ class InputMediaPhoto(InputMedia): media: Union[str, InputFile], 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/types/input_media_video.py b/aiogram/types/input_media_video.py index 6f1e3263..611556a9 100644 --- a/aiogram/types/input_media_video.py +++ b/aiogram/types/input_media_video.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default from ..enums import InputMediaType @@ -28,7 +28,7 @@ class InputMediaVideo(InputMedia): """*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. 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 """*Optional*. 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") """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" @@ -55,7 +55,7 @@ class InputMediaVideo(InputMedia): 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" ), diff --git a/aiogram/types/input_poll_option.py b/aiogram/types/input_poll_option.py index 7bca9f6f..fc751ae9 100644 --- a/aiogram/types/input_poll_option.py +++ b/aiogram/types/input_poll_option.py @@ -20,7 +20,7 @@ class InputPollOption(TelegramObject): """Option text, 1-100 characters""" text_parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. Mode for parsing entities in the text. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed""" - text_entities: Optional[List[MessageEntity]] = None + text_entities: Optional[list[MessageEntity]] = None """*Optional*. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of *text_parse_mode*""" if TYPE_CHECKING: @@ -32,7 +32,7 @@ class InputPollOption(TelegramObject): *, text: str, text_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), - text_entities: Optional[List[MessageEntity]] = None, + text_entities: Optional[list[MessageEntity]] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/input_sticker.py b/aiogram/types/input_sticker.py index 85f66868..76fcc4b1 100644 --- a/aiogram/types/input_sticker.py +++ b/aiogram/types/input_sticker.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 .base import TelegramObject @@ -20,11 +20,11 @@ class InputSticker(TelegramObject): """The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://' to upload a new one using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » `""" format: str """Format of the added sticker, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, 'video' for a **WEBM** video""" - emoji_list: List[str] + emoji_list: list[str] """List of 1-20 emoji associated with the sticker""" mask_position: Optional[MaskPosition] = None """*Optional*. Position where the mask should be placed on faces. For 'mask' stickers only.""" - keywords: Optional[List[str]] = None + keywords: Optional[list[str]] = None """*Optional*. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For 'regular' and 'custom_emoji' stickers only.""" if TYPE_CHECKING: @@ -36,9 +36,9 @@ class InputSticker(TelegramObject): *, sticker: Union[InputFile, str], format: str, - emoji_list: List[str], + emoji_list: list[str], mask_position: Optional[MaskPosition] = None, - keywords: Optional[List[str]] = None, + keywords: Optional[list[str]] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/input_text_message_content.py b/aiogram/types/input_text_message_content.py index df758cc6..f2eb7a80 100644 --- a/aiogram/types/input_text_message_content.py +++ b/aiogram/types/input_text_message_content.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 @@ -23,7 +23,7 @@ class InputTextMessageContent(InputMessageContent): """Text of the message to be sent, 1-4096 characters""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. Mode for parsing entities in the message text. See `formatting options `_ for more details.""" - entities: Optional[List[MessageEntity]] = None + entities: Optional[list[MessageEntity]] = None """*Optional*. 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") """*Optional*. Link preview generation options for the message""" @@ -42,7 +42,7 @@ class InputTextMessageContent(InputMessageContent): *, message_text: str, 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/types/message.py b/aiogram/types/message.py index 2e6e5efb..d1481d72 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -131,7 +131,7 @@ class Message(MaybeInaccessibleMessage): """ message_id: int - """Unique message identifier inside this chat""" + """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""" date: DateTime """Date the message was sent in Unix time. It is always a positive number, representing a valid date.""" chat: Chat @@ -178,7 +178,7 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator""" text: Optional[str] = None """*Optional*. For text messages, the actual UTF-8 text of the message""" - entities: Optional[List[MessageEntity]] = None + entities: Optional[list[MessageEntity]] = None """*Optional*. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text""" link_preview_options: Optional[LinkPreviewOptions] = None """*Optional*. Options used for link preview generation for the message, if it is a text message and link preview options were changed""" @@ -192,7 +192,7 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Message is a general file, information about the file""" paid_media: Optional[PaidMediaInfo] = None """*Optional*. Message contains paid media; information about the paid media""" - photo: Optional[List[PhotoSize]] = None + photo: Optional[list[PhotoSize]] = None """*Optional*. Message is a photo, available sizes of the photo""" sticker: Optional[Sticker] = None """*Optional*. Message is a sticker, information about the sticker""" @@ -206,7 +206,7 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Message is a voice message, information about the file""" caption: Optional[str] = None """*Optional*. Caption for the animation, audio, document, paid media, photo, video or voice""" - caption_entities: Optional[List[MessageEntity]] = None + caption_entities: Optional[list[MessageEntity]] = None """*Optional*. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption""" show_caption_above_media: Optional[bool] = None """*Optional*. True, if the caption must be shown above the message media""" @@ -224,13 +224,13 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Message is a venue, information about the venue. For backward compatibility, when this field is set, the *location* field will also be set""" location: Optional[Location] = None """*Optional*. Message is a shared location, information about the location""" - new_chat_members: Optional[List[User]] = None + new_chat_members: Optional[list[User]] = None """*Optional*. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)""" left_chat_member: Optional[User] = None """*Optional*. A member was removed from the group, information about them (this member may be the bot itself)""" new_chat_title: Optional[str] = None """*Optional*. A chat title was changed to this value""" - new_chat_photo: Optional[List[PhotoSize]] = None + new_chat_photo: Optional[list[PhotoSize]] = None """*Optional*. A chat photo was change to this value""" delete_chat_photo: Optional[bool] = None """*Optional*. Service message: the chat photo was deleted""" @@ -375,21 +375,21 @@ class Message(MaybeInaccessibleMessage): media_group_id: Optional[str] = None, author_signature: Optional[str] = None, text: Optional[str] = None, - entities: Optional[List[MessageEntity]] = None, + entities: Optional[list[MessageEntity]] = None, link_preview_options: Optional[LinkPreviewOptions] = None, effect_id: Optional[str] = None, animation: Optional[Animation] = None, audio: Optional[Audio] = None, document: Optional[Document] = None, paid_media: Optional[PaidMediaInfo] = None, - photo: Optional[List[PhotoSize]] = None, + photo: Optional[list[PhotoSize]] = None, sticker: Optional[Sticker] = None, story: Optional[Story] = None, video: Optional[Video] = None, video_note: Optional[VideoNote] = None, voice: Optional[Voice] = None, caption: Optional[str] = None, - caption_entities: Optional[List[MessageEntity]] = None, + caption_entities: Optional[list[MessageEntity]] = None, show_caption_above_media: Optional[bool] = None, has_media_spoiler: Optional[bool] = None, contact: Optional[Contact] = None, @@ -398,10 +398,10 @@ class Message(MaybeInaccessibleMessage): poll: Optional[Poll] = None, venue: Optional[Venue] = None, location: Optional[Location] = None, - new_chat_members: Optional[List[User]] = None, + new_chat_members: Optional[list[User]] = None, left_chat_member: Optional[User] = None, new_chat_title: Optional[str] = None, - new_chat_photo: Optional[List[PhotoSize]] = None, + new_chat_photo: Optional[list[PhotoSize]] = None, delete_chat_photo: Optional[bool] = None, group_chat_created: Optional[bool] = None, supergroup_chat_created: Optional[bool] = None, @@ -705,13 +705,14 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -744,6 +745,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -775,6 +777,7 @@ class Message(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -790,13 +793,14 @@ class Message(MaybeInaccessibleMessage): 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[ @@ -830,6 +834,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -862,6 +867,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -875,13 +881,14 @@ class Message(MaybeInaccessibleMessage): audio: Union[InputFile, str], 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -913,6 +920,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -942,6 +950,7 @@ class Message(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -953,13 +962,14 @@ class Message(MaybeInaccessibleMessage): audio: Union[InputFile, str], 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[ @@ -992,6 +1002,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -1022,6 +1033,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -1038,6 +1050,7 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1064,6 +1077,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -1089,6 +1103,7 @@ class Message(MaybeInaccessibleMessage): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1103,6 +1118,7 @@ class Message(MaybeInaccessibleMessage): 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[ @@ -1130,6 +1146,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -1156,6 +1173,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -1170,10 +1188,11 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1202,6 +1221,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -1229,6 +1249,7 @@ class Message(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1241,10 +1262,11 @@ class Message(MaybeInaccessibleMessage): 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[ @@ -1274,6 +1296,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -1302,6 +1325,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -1315,6 +1339,7 @@ class Message(MaybeInaccessibleMessage): game_short_name: str, 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_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1336,6 +1361,7 @@ class Message(MaybeInaccessibleMessage): :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. :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_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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1358,6 +1384,7 @@ class Message(MaybeInaccessibleMessage): game_short_name=game_short_name, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1369,6 +1396,7 @@ class Message(MaybeInaccessibleMessage): game_short_name: str, 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, @@ -1391,6 +1419,7 @@ class Message(MaybeInaccessibleMessage): :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. :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. @@ -1414,6 +1443,7 @@ class Message(MaybeInaccessibleMessage): game_short_name=game_short_name, 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, @@ -1428,10 +1458,10 @@ class Message(MaybeInaccessibleMessage): 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, start_parameter: Optional[str] = None, provider_data: Optional[str] = None, photo_url: Optional[str] = None, @@ -1447,6 +1477,7 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1488,6 +1519,7 @@ class Message(MaybeInaccessibleMessage): :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_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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1530,6 +1562,7 @@ class Message(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1542,10 +1575,10 @@ class Message(MaybeInaccessibleMessage): 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, start_parameter: Optional[str] = None, provider_data: Optional[str] = None, photo_url: Optional[str] = None, @@ -1561,6 +1594,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -1603,6 +1637,7 @@ class Message(MaybeInaccessibleMessage): :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. @@ -1646,6 +1681,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -1664,6 +1700,7 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1692,6 +1729,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -1719,6 +1757,7 @@ class Message(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1735,6 +1774,7 @@ class Message(MaybeInaccessibleMessage): 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[ @@ -1764,6 +1804,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -1792,6 +1833,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -1802,9 +1844,10 @@ class Message(MaybeInaccessibleMessage): def reply_media_group( self, - media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], + media: list[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], 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, allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, @@ -1825,6 +1868,7 @@ class Message(MaybeInaccessibleMessage): :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items :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 allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_media_group.SendMediaGroup` @@ -1846,6 +1890,7 @@ class Message(MaybeInaccessibleMessage): media=media, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, allow_sending_without_reply=allow_sending_without_reply, **kwargs, @@ -1853,9 +1898,10 @@ class Message(MaybeInaccessibleMessage): def answer_media_group( self, - media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], + media: list[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], 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, @@ -1877,6 +1923,7 @@ class Message(MaybeInaccessibleMessage): :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items :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 @@ -1899,6 +1946,7 @@ class Message(MaybeInaccessibleMessage): media=media, 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, @@ -1910,12 +1958,13 @@ class Message(MaybeInaccessibleMessage): self, text: str, 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1945,6 +1994,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -1971,6 +2021,7 @@ class Message(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1982,12 +2033,13 @@ class Message(MaybeInaccessibleMessage): self, text: str, 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[ @@ -2018,6 +2070,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -2045,6 +2098,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -2059,13 +2113,14 @@ class Message(MaybeInaccessibleMessage): photo: Union[InputFile, str], 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2094,6 +2149,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -2121,6 +2177,7 @@ class Message(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2132,13 +2189,14 @@ class Message(MaybeInaccessibleMessage): photo: Union[InputFile, str], 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[ @@ -2168,6 +2226,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -2196,6 +2255,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -2207,21 +2267,22 @@ class Message(MaybeInaccessibleMessage): def reply_poll( self, question: str, - options: List[Union[InputPollOption, str]], + options: list[Union[InputPollOption, str]], 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2258,6 +2319,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -2293,6 +2355,7 @@ class Message(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2302,21 +2365,22 @@ class Message(MaybeInaccessibleMessage): def answer_poll( self, question: str, - options: List[Union[InputPollOption, str]], + options: list[Union[InputPollOption, str]], 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[ @@ -2354,6 +2418,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -2390,6 +2455,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -2403,6 +2469,7 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2426,6 +2493,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -2448,6 +2516,7 @@ class Message(MaybeInaccessibleMessage): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2459,6 +2528,7 @@ class Message(MaybeInaccessibleMessage): 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[ @@ -2483,6 +2553,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -2506,6 +2577,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -2520,6 +2592,7 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2544,6 +2617,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -2567,6 +2641,7 @@ class Message(MaybeInaccessibleMessage): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2579,6 +2654,7 @@ class Message(MaybeInaccessibleMessage): 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[ @@ -2604,6 +2680,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -2628,6 +2705,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -2648,6 +2726,7 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2678,6 +2757,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -2707,6 +2787,7 @@ class Message(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2725,6 +2806,7 @@ class Message(MaybeInaccessibleMessage): 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[ @@ -2756,6 +2838,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -2786,6 +2869,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -2803,7 +2887,7 @@ class Message(MaybeInaccessibleMessage): 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" ), @@ -2811,6 +2895,7 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2844,6 +2929,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -2876,6 +2962,7 @@ class Message(MaybeInaccessibleMessage): 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_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2891,7 +2978,7 @@ class Message(MaybeInaccessibleMessage): 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" ), @@ -2899,6 +2986,7 @@ class Message(MaybeInaccessibleMessage): 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[ @@ -2933,6 +3021,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -2966,6 +3055,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -2982,6 +3072,7 @@ class Message(MaybeInaccessibleMessage): 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3008,6 +3099,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -3033,6 +3125,7 @@ class Message(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3047,6 +3140,7 @@ class Message(MaybeInaccessibleMessage): 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[ @@ -3074,6 +3168,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -3100,6 +3195,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -3113,10 +3209,11 @@ class Message(MaybeInaccessibleMessage): voice: Union[InputFile, str], 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3144,6 +3241,7 @@ class Message(MaybeInaccessibleMessage): :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_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 @@ -3170,6 +3268,7 @@ class Message(MaybeInaccessibleMessage): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3181,10 +3280,11 @@ class Message(MaybeInaccessibleMessage): voice: Union[InputFile, str], 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[ @@ -3213,6 +3313,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -3240,6 +3341,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -3451,12 +3553,13 @@ class Message(MaybeInaccessibleMessage): 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] @@ -3484,6 +3587,7 @@ class Message(MaybeInaccessibleMessage): :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 @@ -3510,6 +3614,7 @@ class Message(MaybeInaccessibleMessage): 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, @@ -3523,7 +3628,7 @@ class Message(MaybeInaccessibleMessage): business_connection_id: Optional[str] = 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" ), @@ -3642,7 +3747,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_id` - 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 @@ -3858,7 +3963,7 @@ class Message(MaybeInaccessibleMessage): 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" ), @@ -4062,7 +4167,7 @@ class Message(MaybeInaccessibleMessage): def react( self, reaction: Optional[ - List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]] + list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]] ] = None, is_big: Optional[bool] = None, **kwargs: Any, @@ -4102,14 +4207,15 @@ class Message(MaybeInaccessibleMessage): def answer_paid_media( self, star_count: int, - media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]], + media: list[Union[InputPaidMediaPhoto, InputPaidMediaVideo]], 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] @@ -4137,6 +4243,7 @@ class Message(MaybeInaccessibleMessage): :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 :return: instance of method :class:`aiogram.methods.send_paid_media.SendPaidMedia` @@ -4163,6 +4270,7 @@ class Message(MaybeInaccessibleMessage): 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, **kwargs, @@ -4171,14 +4279,15 @@ class Message(MaybeInaccessibleMessage): def reply_paid_media( self, star_count: int, - media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]], + media: list[Union[InputPaidMediaPhoto, InputPaidMediaVideo]], 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_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, @@ -4206,6 +4315,7 @@ class Message(MaybeInaccessibleMessage): :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_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 :return: instance of method :class:`aiogram.methods.send_paid_media.SendPaidMedia` """ @@ -4232,6 +4342,7 @@ class Message(MaybeInaccessibleMessage): show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_markup=reply_markup, **kwargs, ).as_(self._bot) diff --git a/aiogram/types/message_entity.py b/aiogram/types/message_entity.py index ee774b09..5019fef3 100644 --- a/aiogram/types/message_entity.py +++ b/aiogram/types/message_entity.py @@ -17,7 +17,7 @@ class MessageEntity(MutableTelegramObject): """ type: str - """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)""" + """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)""" offset: int """Offset in `UTF-16 code units `_ to the start of the entity""" length: int diff --git a/aiogram/types/message_id.py b/aiogram/types/message_id.py index d50888f8..65efaa35 100644 --- a/aiogram/types/message_id.py +++ b/aiogram/types/message_id.py @@ -13,7 +13,7 @@ class MessageId(TelegramObject): """ message_id: int - """Unique message identifier""" + """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""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/message_reaction_count_updated.py b/aiogram/types/message_reaction_count_updated.py index e9d0f8b5..7e9b3bdc 100644 --- a/aiogram/types/message_reaction_count_updated.py +++ b/aiogram/types/message_reaction_count_updated.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 @@ -23,7 +23,7 @@ class MessageReactionCountUpdated(TelegramObject): """Unique message identifier inside the chat""" date: DateTime """Date of the change in Unix time""" - reactions: List[ReactionCount] + reactions: list[ReactionCount] """List of reactions that are present on the message""" if TYPE_CHECKING: @@ -36,7 +36,7 @@ class MessageReactionCountUpdated(TelegramObject): chat: Chat, message_id: int, date: DateTime, - reactions: List[ReactionCount], + reactions: list[ReactionCount], **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/message_reaction_updated.py b/aiogram/types/message_reaction_updated.py index 7831c774..23cf0e1e 100644 --- a/aiogram/types/message_reaction_updated.py +++ b/aiogram/types/message_reaction_updated.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 .base import TelegramObject @@ -26,9 +26,9 @@ class MessageReactionUpdated(TelegramObject): """Unique identifier of the message inside the chat""" date: DateTime """Date of the change in Unix time""" - old_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]] + old_reaction: list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]] """Previous list of reaction types that were set by the user""" - new_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]] + new_reaction: list[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]] """New list of reaction types that have been set by the user""" user: Optional[User] = None """*Optional*. The user that changed the reaction, if the user isn't anonymous""" @@ -45,10 +45,10 @@ class MessageReactionUpdated(TelegramObject): chat: Chat, message_id: int, date: DateTime, - old_reaction: List[ + old_reaction: list[ Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid] ], - new_reaction: List[ + new_reaction: list[ Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid] ], user: Optional[User] = None, diff --git a/aiogram/types/paid_media_info.py b/aiogram/types/paid_media_info.py index db5bbf0a..274f5d51 100644 --- a/aiogram/types/paid_media_info.py +++ b/aiogram/types/paid_media_info.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 .base import TelegramObject @@ -19,7 +19,7 @@ class PaidMediaInfo(TelegramObject): star_count: int """The number of Telegram Stars that must be paid to buy access to the media""" - paid_media: List[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]] + paid_media: list[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]] """Information about the paid media""" if TYPE_CHECKING: @@ -30,7 +30,7 @@ class PaidMediaInfo(TelegramObject): __pydantic__self__, *, star_count: int, - paid_media: List[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]], + paid_media: list[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]], **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/paid_media_photo.py b/aiogram/types/paid_media_photo.py index 71c2e10b..a6ab7b93 100644 --- a/aiogram/types/paid_media_photo.py +++ b/aiogram/types/paid_media_photo.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal +from typing import TYPE_CHECKING, Any, Literal from ..enums import PaidMediaType from .paid_media import PaidMedia @@ -18,7 +18,7 @@ class PaidMediaPhoto(PaidMedia): type: Literal[PaidMediaType.PHOTO] = PaidMediaType.PHOTO """Type of the paid media, always 'photo'""" - photo: List[PhotoSize] + photo: list[PhotoSize] """The photo""" if TYPE_CHECKING: @@ -29,7 +29,7 @@ class PaidMediaPhoto(PaidMedia): __pydantic__self__, *, type: Literal[PaidMediaType.PHOTO] = PaidMediaType.PHOTO, - photo: List[PhotoSize], + photo: list[PhotoSize], **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/passport_data.py b/aiogram/types/passport_data.py index d93af1f0..8a1233c3 100644 --- a/aiogram/types/passport_data.py +++ b/aiogram/types/passport_data.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 @@ -16,7 +16,7 @@ class PassportData(TelegramObject): Source: https://core.telegram.org/bots/api#passportdata """ - data: List[EncryptedPassportElement] + data: list[EncryptedPassportElement] """Array with information about documents and other Telegram Passport elements that was shared with the bot""" credentials: EncryptedCredentials """Encrypted credentials required to decrypt the data""" @@ -28,7 +28,7 @@ class PassportData(TelegramObject): def __init__( __pydantic__self__, *, - data: List[EncryptedPassportElement], + data: list[EncryptedPassportElement], credentials: EncryptedCredentials, **__pydantic_kwargs: Any, ) -> None: diff --git a/aiogram/types/passport_element_error_files.py b/aiogram/types/passport_element_error_files.py index 3639da26..740bfcc2 100644 --- a/aiogram/types/passport_element_error_files.py +++ b/aiogram/types/passport_element_error_files.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal +from typing import TYPE_CHECKING, Any, Literal from ..enums import PassportElementErrorType from .passport_element_error import PassportElementError @@ -17,7 +17,7 @@ class PassportElementErrorFiles(PassportElementError): """Error source, must be *files*""" type: str """The section of the user's Telegram Passport which has the issue, one of 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration'""" - file_hashes: List[str] + file_hashes: list[str] """List of base64-encoded file hashes""" message: str """Error message""" @@ -31,7 +31,7 @@ class PassportElementErrorFiles(PassportElementError): *, source: Literal[PassportElementErrorType.FILES] = PassportElementErrorType.FILES, type: str, - file_hashes: List[str], + file_hashes: list[str], message: str, **__pydantic_kwargs: Any, ) -> None: diff --git a/aiogram/types/passport_element_error_translation_files.py b/aiogram/types/passport_element_error_translation_files.py index 65e9940e..de81b132 100644 --- a/aiogram/types/passport_element_error_translation_files.py +++ b/aiogram/types/passport_element_error_translation_files.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal +from typing import TYPE_CHECKING, Any, Literal from ..enums import PassportElementErrorType from .passport_element_error import PassportElementError @@ -19,7 +19,7 @@ class PassportElementErrorTranslationFiles(PassportElementError): """Error source, must be *translation_files*""" type: str """Type of element of the user's Telegram Passport which has the issue, one of 'passport', 'driver_license', 'identity_card', 'internal_passport', 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration'""" - file_hashes: List[str] + file_hashes: list[str] """List of base64-encoded file hashes""" message: str """Error message""" @@ -35,7 +35,7 @@ class PassportElementErrorTranslationFiles(PassportElementError): PassportElementErrorType.TRANSLATION_FILES ] = PassportElementErrorType.TRANSLATION_FILES, type: str, - file_hashes: List[str], + file_hashes: list[str], message: str, **__pydantic_kwargs: Any, ) -> None: diff --git a/aiogram/types/poll.py b/aiogram/types/poll.py index 58052241..12b245e3 100644 --- a/aiogram/types/poll.py +++ b/aiogram/types/poll.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 TelegramObject from .custom import DateTime @@ -21,7 +21,7 @@ class Poll(TelegramObject): """Unique poll identifier""" question: str """Poll question, 1-300 characters""" - options: List[PollOption] + options: list[PollOption] """List of poll options""" total_voter_count: int """Total number of users that voted in the poll""" @@ -33,13 +33,13 @@ class Poll(TelegramObject): """Poll type, currently can be 'regular' or 'quiz'""" allows_multiple_answers: bool """:code:`True`, if the poll allows multiple answers""" - question_entities: Optional[List[MessageEntity]] = None + question_entities: Optional[list[MessageEntity]] = None """*Optional*. Special entities that appear in the *question*. Currently, only custom emoji entities are allowed in poll questions""" correct_option_id: Optional[int] = None """*Optional*. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.""" explanation: Optional[str] = None """*Optional*. 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""" - explanation_entities: Optional[List[MessageEntity]] = None + explanation_entities: Optional[list[MessageEntity]] = None """*Optional*. Special entities like usernames, URLs, bot commands, etc. that appear in the *explanation*""" open_period: Optional[int] = None """*Optional*. Amount of time in seconds the poll will be active after creation""" @@ -55,16 +55,16 @@ class Poll(TelegramObject): *, id: str, question: str, - options: List[PollOption], + options: list[PollOption], total_voter_count: int, is_closed: bool, is_anonymous: bool, type: str, allows_multiple_answers: bool, - question_entities: Optional[List[MessageEntity]] = None, + question_entities: Optional[list[MessageEntity]] = None, correct_option_id: Optional[int] = None, explanation: Optional[str] = None, - explanation_entities: Optional[List[MessageEntity]] = None, + explanation_entities: Optional[list[MessageEntity]] = None, open_period: Optional[int] = None, close_date: Optional[DateTime] = None, **__pydantic_kwargs: Any, diff --git a/aiogram/types/poll_answer.py b/aiogram/types/poll_answer.py index c12be34f..d855566a 100644 --- a/aiogram/types/poll_answer.py +++ b/aiogram/types/poll_answer.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 TelegramObject @@ -18,7 +18,7 @@ class PollAnswer(TelegramObject): poll_id: str """Unique poll identifier""" - option_ids: List[int] + option_ids: list[int] """0-based identifiers of chosen answer options. May be empty if the vote was retracted.""" voter_chat: Optional[Chat] = None """*Optional*. The chat that changed the answer to the poll, if the voter is anonymous""" @@ -33,7 +33,7 @@ class PollAnswer(TelegramObject): __pydantic__self__, *, poll_id: str, - option_ids: List[int], + option_ids: list[int], voter_chat: Optional[Chat] = None, user: Optional[User] = None, **__pydantic_kwargs: Any, diff --git a/aiogram/types/poll_option.py b/aiogram/types/poll_option.py index f380934c..e76f9f40 100644 --- a/aiogram/types/poll_option.py +++ b/aiogram/types/poll_option.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 TelegramObject @@ -19,7 +19,7 @@ class PollOption(TelegramObject): """Option text, 1-100 characters""" voter_count: int """Number of users that voted for this option""" - text_entities: Optional[List[MessageEntity]] = None + text_entities: Optional[list[MessageEntity]] = None """*Optional*. Special entities that appear in the option *text*. Currently, only custom emoji entities are allowed in poll option texts""" if TYPE_CHECKING: @@ -31,7 +31,7 @@ class PollOption(TelegramObject): *, text: str, voter_count: int, - text_entities: Optional[List[MessageEntity]] = None, + text_entities: Optional[list[MessageEntity]] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/reaction_type_paid.py b/aiogram/types/reaction_type_paid.py index 8e95a830..c5c11c81 100644 --- a/aiogram/types/reaction_type_paid.py +++ b/aiogram/types/reaction_type_paid.py @@ -11,7 +11,7 @@ class ReactionTypePaid(ReactionType): Source: https://core.telegram.org/bots/api#reactiontypepaid """ - type: Literal["paid"] = "paid" + type: Literal[ReactionTypeType.PAID] = ReactionTypeType.PAID """Type of the reaction, always 'paid'""" if TYPE_CHECKING: @@ -19,7 +19,10 @@ class ReactionTypePaid(ReactionType): # This section was auto-generated via `butcher` def __init__( - __pydantic__self__, *, type: Literal["paid"] = "paid", **__pydantic_kwargs: Any + __pydantic__self__, + *, + type: Literal[ReactionTypeType.PAID] = ReactionTypeType.PAID, + **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! # This method was auto-generated via `butcher` diff --git a/aiogram/types/reply_keyboard_markup.py b/aiogram/types/reply_keyboard_markup.py index f3d6dabd..0340823d 100644 --- a/aiogram/types/reply_keyboard_markup.py +++ b/aiogram/types/reply_keyboard_markup.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 MutableTelegramObject @@ -15,7 +15,7 @@ class ReplyKeyboardMarkup(MutableTelegramObject): Source: https://core.telegram.org/bots/api#replykeyboardmarkup """ - keyboard: List[List[KeyboardButton]] + keyboard: list[list[KeyboardButton]] """Array of button rows, each represented by an Array of :class:`aiogram.types.keyboard_button.KeyboardButton` objects""" is_persistent: Optional[bool] = None """*Optional*. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to *false*, in which case the custom keyboard can be hidden and opened with a keyboard icon.""" @@ -35,7 +35,7 @@ class ReplyKeyboardMarkup(MutableTelegramObject): def __init__( __pydantic__self__, *, - keyboard: List[List[KeyboardButton]], + keyboard: list[list[KeyboardButton]], is_persistent: Optional[bool] = None, resize_keyboard: Optional[bool] = None, one_time_keyboard: Optional[bool] = None, diff --git a/aiogram/types/reply_parameters.py b/aiogram/types/reply_parameters.py index 5b03fdab..a299a0af 100644 --- a/aiogram/types/reply_parameters.py +++ b/aiogram/types/reply_parameters.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 ..client.default import Default from .base import TelegramObject @@ -28,7 +28,7 @@ class ReplyParameters(TelegramObject): """*Optional*. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities. The message will fail to send if the quote isn't found in the original message.""" quote_parse_mode: Optional[Union[str, Default]] = Default("parse_mode") """*Optional*. Mode for parsing entities in the quote. See `formatting options `_ for more details.""" - quote_entities: Optional[List[MessageEntity]] = None + quote_entities: Optional[list[MessageEntity]] = None """*Optional*. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of *quote_parse_mode*.""" quote_position: Optional[int] = None """*Optional*. Position of the quote in the original message in UTF-16 code units""" @@ -47,7 +47,7 @@ class ReplyParameters(TelegramObject): ), quote: Optional[str] = None, quote_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), - quote_entities: Optional[List[MessageEntity]] = None, + quote_entities: Optional[list[MessageEntity]] = None, quote_position: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: diff --git a/aiogram/types/shared_user.py b/aiogram/types/shared_user.py index e160b894..d6a54ebb 100644 --- a/aiogram/types/shared_user.py +++ b/aiogram/types/shared_user.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 TelegramObject @@ -23,7 +23,7 @@ class SharedUser(TelegramObject): """*Optional*. Last name of the user, if the name was requested by the bot""" username: Optional[str] = None """*Optional*. Username of the user, if the username was requested by the bot""" - photo: Optional[List[PhotoSize]] = None + photo: Optional[list[PhotoSize]] = None """*Optional*. Available sizes of the chat photo, if the photo was requested by the bot""" if TYPE_CHECKING: @@ -37,7 +37,7 @@ class SharedUser(TelegramObject): first_name: Optional[str] = None, last_name: Optional[str] = None, username: Optional[str] = None, - photo: Optional[List[PhotoSize]] = None, + photo: Optional[list[PhotoSize]] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/shipping_option.py b/aiogram/types/shipping_option.py index b0274518..9c3dadaa 100644 --- a/aiogram/types/shipping_option.py +++ b/aiogram/types/shipping_option.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 ShippingOption(TelegramObject): """Shipping option identifier""" title: str """Option title""" - prices: List[LabeledPrice] + prices: list[LabeledPrice] """List of price portions""" if TYPE_CHECKING: @@ -31,7 +31,7 @@ class ShippingOption(TelegramObject): *, id: str, title: str, - prices: List[LabeledPrice], + prices: list[LabeledPrice], **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/shipping_query.py b/aiogram/types/shipping_query.py index 61b4ae42..4d5af605 100644 --- a/aiogram/types/shipping_query.py +++ b/aiogram/types/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 pydantic import Field @@ -57,7 +57,7 @@ class ShippingQuery(TelegramObject): def answer( self, ok: bool, - shipping_options: Optional[List[ShippingOption]] = None, + shipping_options: Optional[list[ShippingOption]] = None, error_message: Optional[str] = None, **kwargs: Any, ) -> AnswerShippingQuery: diff --git a/aiogram/types/star_transaction.py b/aiogram/types/star_transaction.py index 5d680af7..ab1bf836 100644 --- a/aiogram/types/star_transaction.py +++ b/aiogram/types/star_transaction.py @@ -9,6 +9,7 @@ if TYPE_CHECKING: 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 @@ -20,7 +21,7 @@ class StarTransaction(TelegramObject): """ id: str - """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.""" + """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.""" amount: int """Number of Telegram Stars transferred by the transaction""" date: DateTime @@ -30,6 +31,7 @@ class StarTransaction(TelegramObject): TransactionPartnerUser, TransactionPartnerFragment, TransactionPartnerTelegramAds, + TransactionPartnerTelegramApi, TransactionPartnerOther, ] ] = None @@ -39,6 +41,7 @@ class StarTransaction(TelegramObject): TransactionPartnerUser, TransactionPartnerFragment, TransactionPartnerTelegramAds, + TransactionPartnerTelegramApi, TransactionPartnerOther, ] ] = None @@ -59,6 +62,7 @@ class StarTransaction(TelegramObject): TransactionPartnerUser, TransactionPartnerFragment, TransactionPartnerTelegramAds, + TransactionPartnerTelegramApi, TransactionPartnerOther, ] ] = None, @@ -67,6 +71,7 @@ class StarTransaction(TelegramObject): TransactionPartnerUser, TransactionPartnerFragment, TransactionPartnerTelegramAds, + TransactionPartnerTelegramApi, TransactionPartnerOther, ] ] = None, diff --git a/aiogram/types/star_transactions.py b/aiogram/types/star_transactions.py index d2ee5b0f..372730c7 100644 --- a/aiogram/types/star_transactions.py +++ b/aiogram/types/star_transactions.py @@ -15,7 +15,7 @@ class StarTransactions(TelegramObject): Source: https://core.telegram.org/bots/api#startransactions """ - transactions: List[StarTransaction] + transactions: list[StarTransaction] """The list of transactions""" if TYPE_CHECKING: @@ -23,7 +23,7 @@ class StarTransactions(TelegramObject): # This section was auto-generated via `butcher` def __init__( - __pydantic__self__, *, transactions: List[StarTransaction], **__pydantic_kwargs: Any + __pydantic__self__, *, transactions: list[StarTransaction], **__pydantic_kwargs: Any ) -> None: # DO NOT EDIT MANUALLY!!! # This method was auto-generated via `butcher` diff --git a/aiogram/types/sticker_set.py b/aiogram/types/sticker_set.py index 29f9962f..7da68eaf 100644 --- a/aiogram/types/sticker_set.py +++ b/aiogram/types/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 StickerSet(TelegramObject): """Sticker set title""" sticker_type: str """Type of stickers in the set, currently one of 'regular', 'mask', 'custom_emoji'""" - stickers: List[Sticker] + stickers: list[Sticker] """List of all set stickers""" thumbnail: Optional[PhotoSize] = None """*Optional*. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format""" @@ -49,7 +49,7 @@ class StickerSet(TelegramObject): name: str, title: str, sticker_type: str, - stickers: List[Sticker], + stickers: list[Sticker], thumbnail: Optional[PhotoSize] = None, is_animated: Optional[bool] = None, is_video: Optional[bool] = None, diff --git a/aiogram/types/text_quote.py b/aiogram/types/text_quote.py index a882ccf6..50f688eb 100644 --- a/aiogram/types/text_quote.py +++ b/aiogram/types/text_quote.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 TelegramObject @@ -19,7 +19,7 @@ class TextQuote(TelegramObject): """Text of the quoted part of a message that is replied to by the given message""" position: int """Approximate quote position in the original message in UTF-16 code units as specified by the sender""" - entities: Optional[List[MessageEntity]] = None + entities: Optional[list[MessageEntity]] = None """*Optional*. Special entities that appear in the quote. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities are kept in quotes.""" is_manual: Optional[bool] = None """*Optional*. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.""" @@ -33,7 +33,7 @@ class TextQuote(TelegramObject): *, text: str, position: int, - entities: Optional[List[MessageEntity]] = None, + entities: Optional[list[MessageEntity]] = None, is_manual: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: diff --git a/aiogram/types/transaction_partner.py b/aiogram/types/transaction_partner.py index a26b0fcd..392d1cfe 100644 --- a/aiogram/types/transaction_partner.py +++ b/aiogram/types/transaction_partner.py @@ -8,6 +8,7 @@ class TransactionPartner(TelegramObject): - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser` - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment` - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds` + - :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi` - :class:`aiogram.types.transaction_partner_other.TransactionPartnerOther` Source: https://core.telegram.org/bots/api#transactionpartner diff --git a/aiogram/types/transaction_partner_telegram_api.py b/aiogram/types/transaction_partner_telegram_api.py new file mode 100644 index 00000000..ec815bde --- /dev/null +++ b/aiogram/types/transaction_partner_telegram_api.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from ..enums import TransactionPartnerType +from .transaction_partner import TransactionPartner + + +class TransactionPartnerTelegramApi(TransactionPartner): + """ + Describes a transaction with payment for `paid broadcasting `_. + + Source: https://core.telegram.org/bots/api#transactionpartnertelegramapi + """ + + type: Literal[TransactionPartnerType.TELEGRAM_API] = TransactionPartnerType.TELEGRAM_API + """Type of the transaction partner, always 'telegram_api'""" + request_count: int + """The number of successful requests that exceeded regular limits and were therefore billed""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[ + TransactionPartnerType.TELEGRAM_API + ] = TransactionPartnerType.TELEGRAM_API, + request_count: int, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(type=type, request_count=request_count, **__pydantic_kwargs) diff --git a/aiogram/types/transaction_partner_user.py b/aiogram/types/transaction_partner_user.py index 92eb9cb0..d3ac5dc1 100644 --- a/aiogram/types/transaction_partner_user.py +++ b/aiogram/types/transaction_partner_user.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union +from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..enums import TransactionPartnerType from .transaction_partner import TransactionPartner @@ -25,7 +25,7 @@ class TransactionPartnerUser(TransactionPartner): """Information about the user""" invoice_payload: Optional[str] = None """*Optional*. Bot-specified invoice payload""" - paid_media: Optional[List[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]]] = None + paid_media: Optional[list[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]]] = None """*Optional*. Information about the paid media bought by the user""" paid_media_payload: Optional[str] = None """*Optional*. Bot-specified paid media payload""" @@ -41,7 +41,7 @@ class TransactionPartnerUser(TransactionPartner): user: User, invoice_payload: Optional[str] = None, paid_media: Optional[ - List[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]] + list[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]] ] = None, paid_media_payload: Optional[str] = None, **__pydantic_kwargs: Any, diff --git a/aiogram/types/user_chat_boosts.py b/aiogram/types/user_chat_boosts.py index 3da8d370..5182ba34 100644 --- a/aiogram/types/user_chat_boosts.py +++ b/aiogram/types/user_chat_boosts.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 @@ -15,7 +15,7 @@ class UserChatBoosts(TelegramObject): Source: https://core.telegram.org/bots/api#userchatboosts """ - boosts: List[ChatBoost] + boosts: list[ChatBoost] """The list of boosts added to the chat by the user""" if TYPE_CHECKING: @@ -23,7 +23,7 @@ class UserChatBoosts(TelegramObject): # This section was auto-generated via `butcher` def __init__( - __pydantic__self__, *, boosts: List[ChatBoost], **__pydantic_kwargs: Any + __pydantic__self__, *, boosts: list[ChatBoost], **__pydantic_kwargs: Any ) -> None: # DO NOT EDIT MANUALLY!!! # This method was auto-generated via `butcher` diff --git a/aiogram/types/user_profile_photos.py b/aiogram/types/user_profile_photos.py index c1c5d28d..004bfeb9 100644 --- a/aiogram/types/user_profile_photos.py +++ b/aiogram/types/user_profile_photos.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 UserProfilePhotos(TelegramObject): total_count: int """Total number of profile pictures the target user has""" - photos: List[List[PhotoSize]] + photos: list[list[PhotoSize]] """Requested profile pictures (in up to 4 sizes each)""" if TYPE_CHECKING: @@ -28,7 +28,7 @@ class UserProfilePhotos(TelegramObject): __pydantic__self__, *, total_count: int, - photos: List[List[PhotoSize]], + photos: list[list[PhotoSize]], **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/users_shared.py b/aiogram/types/users_shared.py index 351fc0e2..f2835421 100644 --- a/aiogram/types/users_shared.py +++ b/aiogram/types/users_shared.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 @@ -19,9 +19,9 @@ class UsersShared(TelegramObject): request_id: int """Identifier of the request""" - users: List[SharedUser] + users: list[SharedUser] """Information about users shared with the bot.""" - user_ids: Optional[List[int]] = Field(None, json_schema_extra={"deprecated": True}) + user_ids: Optional[list[int]] = Field(None, json_schema_extra={"deprecated": True}) """Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means. .. deprecated:: API:7.2 @@ -35,8 +35,8 @@ class UsersShared(TelegramObject): __pydantic__self__, *, request_id: int, - users: List[SharedUser], - user_ids: Optional[List[int]] = None, + users: list[SharedUser], + user_ids: Optional[list[int]] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/video_chat_participants_invited.py b/aiogram/types/video_chat_participants_invited.py index 74e1a357..551b7e5b 100644 --- a/aiogram/types/video_chat_participants_invited.py +++ b/aiogram/types/video_chat_participants_invited.py @@ -15,14 +15,14 @@ class VideoChatParticipantsInvited(TelegramObject): Source: https://core.telegram.org/bots/api#videochatparticipantsinvited """ - users: List[User] + users: list[User] """New members that were invited to the video chat""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! # This section was auto-generated via `butcher` - def __init__(__pydantic__self__, *, users: List[User], **__pydantic_kwargs: Any) -> None: + def __init__(__pydantic__self__, *, users: list[User], **__pydantic_kwargs: Any) -> None: # DO NOT EDIT MANUALLY!!! # This method was auto-generated via `butcher` # Is needed only for type checking and IDE support without any additional plugins diff --git a/aiogram/types/webhook_info.py b/aiogram/types/webhook_info.py index 1753df41..47fa0d03 100644 --- a/aiogram/types/webhook_info.py +++ b/aiogram/types/webhook_info.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 TelegramObject from .custom import DateTime @@ -29,7 +29,7 @@ class WebhookInfo(TelegramObject): """*Optional*. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters""" max_connections: Optional[int] = None """*Optional*. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery""" - allowed_updates: Optional[List[str]] = None + allowed_updates: Optional[list[str]] = None """*Optional*. A list of update types the bot is subscribed to. Defaults to all update types except *chat_member*""" if TYPE_CHECKING: @@ -47,7 +47,7 @@ class WebhookInfo(TelegramObject): last_error_message: Optional[str] = None, last_synchronization_error_date: Optional[DateTime] = None, max_connections: 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/utils/keyboard.py b/aiogram/utils/keyboard.py index 921c28c1..23659b8f 100644 --- a/aiogram/utils/keyboard.py +++ b/aiogram/utils/keyboard.py @@ -21,6 +21,7 @@ from typing import ( from aiogram.filters.callback_data import CallbackData from aiogram.types import ( CallbackGame, + CopyTextButton, InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, @@ -309,6 +310,7 @@ class InlineKeyboardBuilder(KeyboardBuilder[InlineKeyboardButton]): switch_inline_query: Optional[str] = None, switch_inline_query_current_chat: Optional[str] = None, switch_inline_query_chosen_chat: Optional[SwitchInlineQueryChosenChat] = None, + copy_text: Optional[CopyTextButton] = None, callback_game: Optional[CallbackGame] = None, pay: Optional[bool] = None, **kwargs: Any, @@ -324,6 +326,7 @@ class InlineKeyboardBuilder(KeyboardBuilder[InlineKeyboardButton]): switch_inline_query=switch_inline_query, switch_inline_query_current_chat=switch_inline_query_current_chat, switch_inline_query_chosen_chat=switch_inline_query_chosen_chat, + copy_text=copy_text, callback_game=callback_game, pay=pay, **kwargs, diff --git a/docs/api/methods/copy_messages.rst b/docs/api/methods/copy_messages.rst index ad4fd527..99bc2b47 100644 --- a/docs/api/methods/copy_messages.rst +++ b/docs/api/methods/copy_messages.rst @@ -2,7 +2,7 @@ copyMessages ############ -Returns: :obj:`List[MessageId]` +Returns: :obj:`list[MessageId]` .. automodule:: aiogram.methods.copy_messages :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: List[MessageId] = await bot.copy_messages(...) + result: list[MessageId] = await bot.copy_messages(...) Method as object @@ -35,7 +35,7 @@ With specific bot .. code-block:: python - result: List[MessageId] = await bot(CopyMessages(...)) + result: list[MessageId] = await bot(CopyMessages(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/api/methods/forward_messages.rst b/docs/api/methods/forward_messages.rst index b1eb4dde..8907e6fa 100644 --- a/docs/api/methods/forward_messages.rst +++ b/docs/api/methods/forward_messages.rst @@ -2,7 +2,7 @@ forwardMessages ############### -Returns: :obj:`List[MessageId]` +Returns: :obj:`list[MessageId]` .. automodule:: aiogram.methods.forward_messages :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: List[MessageId] = await bot.forward_messages(...) + result: list[MessageId] = await bot.forward_messages(...) Method as object @@ -35,7 +35,7 @@ With specific bot .. code-block:: python - result: List[MessageId] = await bot(ForwardMessages(...)) + result: list[MessageId] = await bot(ForwardMessages(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/api/methods/get_chat_administrators.rst b/docs/api/methods/get_chat_administrators.rst index 9a1784b5..6e036436 100644 --- a/docs/api/methods/get_chat_administrators.rst +++ b/docs/api/methods/get_chat_administrators.rst @@ -2,7 +2,7 @@ getChatAdministrators ##################### -Returns: :obj:`List[Union[ChatMemberOwner, ChatMemberAdministrator, ChatMemberMember, ChatMemberRestricted, ChatMemberLeft, ChatMemberBanned]]` +Returns: :obj:`list[Union[ChatMemberOwner, ChatMemberAdministrator, ChatMemberMember, ChatMemberRestricted, ChatMemberLeft, ChatMemberBanned]]` .. automodule:: aiogram.methods.get_chat_administrators :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: List[Union[ChatMemberOwner, ChatMemberAdministrator, ChatMemberMember, ChatMemberRestricted, ChatMemberLeft, ChatMemberBanned]] = await bot.get_chat_administrators(...) + result: list[Union[ChatMemberOwner, ChatMemberAdministrator, ChatMemberMember, ChatMemberRestricted, ChatMemberLeft, ChatMemberBanned]] = await bot.get_chat_administrators(...) Method as object @@ -35,7 +35,7 @@ With specific bot .. code-block:: python - result: List[Union[ChatMemberOwner, ChatMemberAdministrator, ChatMemberMember, ChatMemberRestricted, ChatMemberLeft, ChatMemberBanned]] = await bot(GetChatAdministrators(...)) + result: list[Union[ChatMemberOwner, ChatMemberAdministrator, ChatMemberMember, ChatMemberRestricted, ChatMemberLeft, ChatMemberBanned]] = await bot(GetChatAdministrators(...)) diff --git a/docs/api/methods/get_custom_emoji_stickers.rst b/docs/api/methods/get_custom_emoji_stickers.rst index c7b4dbc5..26806e57 100644 --- a/docs/api/methods/get_custom_emoji_stickers.rst +++ b/docs/api/methods/get_custom_emoji_stickers.rst @@ -2,7 +2,7 @@ getCustomEmojiStickers ###################### -Returns: :obj:`List[Sticker]` +Returns: :obj:`list[Sticker]` .. automodule:: aiogram.methods.get_custom_emoji_stickers :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: List[Sticker] = await bot.get_custom_emoji_stickers(...) + result: list[Sticker] = await bot.get_custom_emoji_stickers(...) Method as object @@ -35,4 +35,4 @@ With specific bot .. code-block:: python - result: List[Sticker] = await bot(GetCustomEmojiStickers(...)) + result: list[Sticker] = await bot(GetCustomEmojiStickers(...)) diff --git a/docs/api/methods/get_forum_topic_icon_stickers.rst b/docs/api/methods/get_forum_topic_icon_stickers.rst index 5e6680a7..8d3e3062 100644 --- a/docs/api/methods/get_forum_topic_icon_stickers.rst +++ b/docs/api/methods/get_forum_topic_icon_stickers.rst @@ -2,7 +2,7 @@ getForumTopicIconStickers ######################### -Returns: :obj:`List[Sticker]` +Returns: :obj:`list[Sticker]` .. automodule:: aiogram.methods.get_forum_topic_icon_stickers :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: List[Sticker] = await bot.get_forum_topic_icon_stickers(...) + result: list[Sticker] = await bot.get_forum_topic_icon_stickers(...) Method as object @@ -35,4 +35,4 @@ With specific bot .. code-block:: python - result: List[Sticker] = await bot(GetForumTopicIconStickers(...)) + result: list[Sticker] = await bot(GetForumTopicIconStickers(...)) diff --git a/docs/api/methods/get_game_high_scores.rst b/docs/api/methods/get_game_high_scores.rst index 67b40ef3..9ca7fdc9 100644 --- a/docs/api/methods/get_game_high_scores.rst +++ b/docs/api/methods/get_game_high_scores.rst @@ -2,7 +2,7 @@ getGameHighScores ################# -Returns: :obj:`List[GameHighScore]` +Returns: :obj:`list[GameHighScore]` .. automodule:: aiogram.methods.get_game_high_scores :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: List[GameHighScore] = await bot.get_game_high_scores(...) + result: list[GameHighScore] = await bot.get_game_high_scores(...) Method as object @@ -35,4 +35,4 @@ With specific bot .. code-block:: python - result: List[GameHighScore] = await bot(GetGameHighScores(...)) + result: list[GameHighScore] = await bot(GetGameHighScores(...)) diff --git a/docs/api/methods/get_my_commands.rst b/docs/api/methods/get_my_commands.rst index 9ca3a907..1a4d7b80 100644 --- a/docs/api/methods/get_my_commands.rst +++ b/docs/api/methods/get_my_commands.rst @@ -2,7 +2,7 @@ getMyCommands ############# -Returns: :obj:`List[BotCommand]` +Returns: :obj:`list[BotCommand]` .. automodule:: aiogram.methods.get_my_commands :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: List[BotCommand] = await bot.get_my_commands(...) + result: list[BotCommand] = await bot.get_my_commands(...) Method as object @@ -35,4 +35,4 @@ With specific bot .. code-block:: python - result: List[BotCommand] = await bot(GetMyCommands(...)) + result: list[BotCommand] = await bot(GetMyCommands(...)) diff --git a/docs/api/methods/get_updates.rst b/docs/api/methods/get_updates.rst index f774aef1..005fd6de 100644 --- a/docs/api/methods/get_updates.rst +++ b/docs/api/methods/get_updates.rst @@ -2,7 +2,7 @@ getUpdates ########## -Returns: :obj:`List[Update]` +Returns: :obj:`list[Update]` .. automodule:: aiogram.methods.get_updates :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: List[Update] = await bot.get_updates(...) + result: list[Update] = await bot.get_updates(...) Method as object @@ -35,4 +35,4 @@ With specific bot .. code-block:: python - result: List[Update] = await bot(GetUpdates(...)) + result: list[Update] = await bot(GetUpdates(...)) diff --git a/docs/api/methods/send_media_group.rst b/docs/api/methods/send_media_group.rst index 149640f4..069d50be 100644 --- a/docs/api/methods/send_media_group.rst +++ b/docs/api/methods/send_media_group.rst @@ -2,7 +2,7 @@ sendMediaGroup ############## -Returns: :obj:`List[Message]` +Returns: :obj:`list[Message]` .. automodule:: aiogram.methods.send_media_group :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: List[Message] = await bot.send_media_group(...) + result: list[Message] = await bot.send_media_group(...) Method as object @@ -35,7 +35,7 @@ With specific bot .. code-block:: python - result: List[Message] = await bot(SendMediaGroup(...)) + result: list[Message] = await bot(SendMediaGroup(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/api/types/copy_text_button.rst b/docs/api/types/copy_text_button.rst new file mode 100644 index 00000000..779ebc25 --- /dev/null +++ b/docs/api/types/copy_text_button.rst @@ -0,0 +1,10 @@ +############## +CopyTextButton +############## + + +.. automodule:: aiogram.types.copy_text_button + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/index.rst b/docs/api/types/index.rst index ae16f951..5f9555a6 100644 --- a/docs/api/types/index.rst +++ b/docs/api/types/index.rst @@ -69,6 +69,7 @@ Available types chat_photo chat_shared contact + copy_text_button dice document external_reply_info @@ -238,6 +239,7 @@ Payments transaction_partner_fragment transaction_partner_other transaction_partner_telegram_ads + transaction_partner_telegram_api transaction_partner_user Telegram Passport diff --git a/docs/api/types/transaction_partner_telegram_api.rst b/docs/api/types/transaction_partner_telegram_api.rst new file mode 100644 index 00000000..c9168272 --- /dev/null +++ b/docs/api/types/transaction_partner_telegram_api.rst @@ -0,0 +1,10 @@ +############################# +TransactionPartnerTelegramApi +############################# + + +.. automodule:: aiogram.types.transaction_partner_telegram_api + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields