diff --git a/.apiversion b/.apiversion index 0f0fefae..37722ebb 100644 --- a/.apiversion +++ b/.apiversion @@ -1 +1 @@ -7.1 +7.4 diff --git a/.butcher/enums/ContentType.yml b/.butcher/enums/ContentType.yml index 4d0bb58a..321d6b92 100644 --- a/.butcher/enums/ContentType.yml +++ b/.butcher/enums/ContentType.yml @@ -37,3 +37,9 @@ extract: - link_preview_options - sender_boost_count - reply_to_story + - business_connection_id + - sender_business_bot + - is_from_offline + - has_media_spoiler + - effect_id + - show_caption_above_media diff --git a/.butcher/methods/addStickerToSet/entity.json b/.butcher/methods/addStickerToSet/entity.json index ea9b690e..e9cd5f42 100644 --- a/.butcher/methods/addStickerToSet/entity.json +++ b/.butcher/methods/addStickerToSet/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "addstickertoset", "name": "addStickerToSet", - "description": "Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.", - "html_description": "

Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.

", - "rst_description": "Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success.", + "description": "Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.", + "html_description": "

Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.

", + "rst_description": "Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns :code:`True` on success.", "annotations": [ { "type": "Integer", diff --git a/.butcher/methods/copyMessage/default.yml b/.butcher/methods/copyMessage/default.yml index 4f6fbe94..50d7b57d 100644 --- a/.butcher/methods/copyMessage/default.yml +++ b/.butcher/methods/copyMessage/default.yml @@ -1,2 +1,3 @@ parse_mode: parse_mode protect_content: protect_content +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/copyMessage/entity.json b/.butcher/methods/copyMessage/entity.json index 83697db9..b9efc617 100644 --- a/.butcher/methods/copyMessage/entity.json +++ b/.butcher/methods/copyMessage/entity.json @@ -67,6 +67,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.", + "html_description": "Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified.\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -94,9 +102,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/copyMessages/entity.json b/.butcher/methods/copyMessages/entity.json index e443a4ba..dd531360 100644 --- a/.butcher/methods/copyMessages/entity.json +++ b/.butcher/methods/copyMessages/entity.json @@ -38,9 +38,9 @@ { "type": "Array of Integer", "required": true, - "description": "Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.", - "html_description": "Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.", - "rst_description": "Identifiers of 1-100 messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order.\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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.\n", "name": "message_ids" }, { diff --git a/.butcher/methods/createInvoiceLink/entity.json b/.butcher/methods/createInvoiceLink/entity.json index 14bed157..0bd239b0 100644 --- a/.butcher/methods/createInvoiceLink/entity.json +++ b/.butcher/methods/createInvoiceLink/entity.json @@ -37,34 +37,34 @@ }, { "type": "String", - "required": true, - "description": "Payment provider token, obtained via BotFather", - "html_description": "Payment provider token, obtained via BotFather", - "rst_description": "Payment provider token, obtained via `BotFather `_\n", + "required": false, + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token" }, { "type": "String", "required": true, - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency" }, { "type": "Array of LabeledPrice", "required": true, - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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 `_.\n", "name": "prices" }, { "type": "Integer", "required": false, - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "rst_description": "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\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "rst_description": "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 `_.\n", "name": "max_tip_amount" }, { @@ -118,57 +118,57 @@ { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Pass True if you require the user's full name to complete the order", - "rst_description": "Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Pass True if you require the user's phone number to complete the order", - "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Pass True if you require the user's email address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Pass True if you require the user's shipping address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's phone number should be sent to the provider", - "html_description": "Pass True if the user's phone number should be sent to the provider", - "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's email address should be sent to the provider", - "html_description": "Pass True if the user's email address should be sent to the provider", - "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Pass True if the final price depends on the shipping method", - "rst_description": "Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible" } ], diff --git a/.butcher/methods/createNewStickerSet/entity.json b/.butcher/methods/createNewStickerSet/entity.json index 7050c925..3d9b7b7b 100644 --- a/.butcher/methods/createNewStickerSet/entity.json +++ b/.butcher/methods/createNewStickerSet/entity.json @@ -43,14 +43,6 @@ "rst_description": "A JSON-serialized list of 1-50 initial stickers to be added to the sticker set\n", "name": "stickers" }, - { - "type": "String", - "required": true, - "description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'", - "html_description": "Format of stickers in the set, must be one of “static”, “animated”, “video”", - "rst_description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'\n", - "name": "sticker_format" - }, { "type": "String", "required": false, @@ -66,6 +58,18 @@ "html_description": "Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only", "rst_description": "Pass :code:`True` if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only\n", "name": "needs_repainting" + }, + { + "type": "String", + "required": false, + "description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'", + "html_description": "Format of stickers in the set, must be one of “static”, “animated”, “video”", + "rst_description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'\n", + "name": "sticker_format", + "deprecated": { + "version": "7.2", + "release_date": "2024-03-31" + } } ], "category": "methods" diff --git a/.butcher/methods/deleteMessages/entity.json b/.butcher/methods/deleteMessages/entity.json index b88ea494..5533110f 100644 --- a/.butcher/methods/deleteMessages/entity.json +++ b/.butcher/methods/deleteMessages/entity.json @@ -22,9 +22,9 @@ { "type": "Array of Integer", "required": true, - "description": "Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted", - "html_description": "Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted", - "rst_description": "Identifiers of 1-100 messages to delete. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted\n", + "description": "A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted", + "html_description": "A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted", + "rst_description": "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\n", "name": "message_ids" } ], diff --git a/.butcher/methods/editMessageCaption/default.yml b/.butcher/methods/editMessageCaption/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/methods/editMessageCaption/default.yml +++ b/.butcher/methods/editMessageCaption/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/editMessageCaption/entity.json b/.butcher/methods/editMessageCaption/entity.json index 15126a36..570815c7 100644 --- a/.butcher/methods/editMessageCaption/entity.json +++ b/.butcher/methods/editMessageCaption/entity.json @@ -59,6 +59,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.", + "html_description": "Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages.\n", + "name": "show_caption_above_media" + }, { "type": "InlineKeyboardMarkup", "required": false, diff --git a/.butcher/methods/editMessageLiveLocation/entity.json b/.butcher/methods/editMessageLiveLocation/entity.json index 65b639f3..f2079277 100644 --- a/.butcher/methods/editMessageLiveLocation/entity.json +++ b/.butcher/methods/editMessageLiveLocation/entity.json @@ -51,6 +51,14 @@ "rst_description": "Longitude of new location\n", "name": "longitude" }, + { + "type": "Integer", + "required": false, + "description": "New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged", + "html_description": "New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged", + "rst_description": "New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current *live_period* by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then *live_period* remains unchanged\n", + "name": "live_period" + }, { "type": "Float", "required": false, diff --git a/.butcher/methods/forwardMessages/entity.json b/.butcher/methods/forwardMessages/entity.json index e7879395..9ae3024a 100644 --- a/.butcher/methods/forwardMessages/entity.json +++ b/.butcher/methods/forwardMessages/entity.json @@ -38,9 +38,9 @@ { "type": "Array of Integer", "required": true, - "description": "Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.", - "html_description": "Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.", - "rst_description": "Identifiers of 1-100 messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order.\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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.\n", "name": "message_ids" }, { diff --git a/.butcher/methods/getBusinessConnection/entity.json b/.butcher/methods/getBusinessConnection/entity.json new file mode 100644 index 00000000..8005a363 --- /dev/null +++ b/.butcher/methods/getBusinessConnection/entity.json @@ -0,0 +1,25 @@ +{ + "meta": {}, + "group": { + "title": "Available methods", + "anchor": "available-methods" + }, + "object": { + "anchor": "getbusinessconnection", + "name": "getBusinessConnection", + "description": "Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.", + "html_description": "

Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.

", + "rst_description": "Use this method to get information about the connection of the bot with a business account. Returns a :class:`aiogram.types.business_connection.BusinessConnection` object on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/getChat/entity.json b/.butcher/methods/getChat/entity.json index 53f3a5b9..586bf6dd 100644 --- a/.butcher/methods/getChat/entity.json +++ b/.butcher/methods/getChat/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "getchat", "name": "getChat", - "description": "Use this method to get up to date information about the chat. Returns a Chat object on success.", - "html_description": "

Use this method to get up to date information about the chat. Returns a Chat object on success.

", - "rst_description": "Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success.", + "description": "Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.", + "html_description": "

Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.

", + "rst_description": "Use this method to get up-to-date information about the chat. Returns a :class:`aiogram.types.chat_full_info.ChatFullInfo` object on success.", "annotations": [ { "type": "Integer or String", diff --git a/.butcher/methods/getCustomEmojiStickers/entity.json b/.butcher/methods/getCustomEmojiStickers/entity.json index ff08346b..8f3132f1 100644 --- a/.butcher/methods/getCustomEmojiStickers/entity.json +++ b/.butcher/methods/getCustomEmojiStickers/entity.json @@ -14,9 +14,9 @@ { "type": "Array of String", "required": true, - "description": "List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.", - "html_description": "List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.", - "rst_description": "List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.\n", + "description": "A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.", + "html_description": "A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.", + "rst_description": "A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.\n", "name": "custom_emoji_ids" } ], diff --git a/.butcher/methods/promoteChatMember/entity.json b/.butcher/methods/promoteChatMember/entity.json index a9f9d3e5..3203b082 100644 --- a/.butcher/methods/promoteChatMember/entity.json +++ b/.butcher/methods/promoteChatMember/entity.json @@ -102,9 +102,9 @@ { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can edit stories posted by other users", - "html_description": "Pass True if the administrator can edit stories posted by other users", - "rst_description": "Pass :code:`True` if the administrator can edit stories posted by other users\n", + "description": "Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "html_description": "Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "rst_description": "Pass :code:`True` if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive\n", "name": "can_edit_stories" }, { @@ -118,33 +118,33 @@ { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", - "html_description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", - "rst_description": "Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only\n", + "description": "Pass True if the administrator can post messages in the channel, or access channel statistics; for channels only", + "html_description": "Pass True if the administrator can post messages in the channel, or access channel statistics; for channels only", + "rst_description": "Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; for channels only\n", "name": "can_post_messages" }, { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", - "html_description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", - "rst_description": "Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only\n", + "description": "Pass True if the administrator can edit messages of other users and can pin messages; for channels only", + "html_description": "Pass True if the administrator can edit messages of other users and can pin messages; for channels only", + "rst_description": "Pass :code:`True` if the administrator can edit messages of other users and can pin messages; for channels only\n", "name": "can_edit_messages" }, { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can pin messages, supergroups only", - "html_description": "Pass True if the administrator can pin messages, supergroups only", - "rst_description": "Pass :code:`True` if the administrator can pin messages, supergroups only\n", + "description": "Pass True if the administrator can pin messages; for supergroups only", + "html_description": "Pass True if the administrator can pin messages; for supergroups only", + "rst_description": "Pass :code:`True` if the administrator can pin messages; for supergroups only\n", "name": "can_pin_messages" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only", - "html_description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only", - "rst_description": "Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only\n", + "description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "html_description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "rst_description": "Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only\n", "name": "can_manage_topics" } ], diff --git a/.butcher/methods/refundStarPayment/entity.json b/.butcher/methods/refundStarPayment/entity.json new file mode 100644 index 00000000..f48ba9e2 --- /dev/null +++ b/.butcher/methods/refundStarPayment/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Payments", + "anchor": "payments" + }, + "object": { + "anchor": "refundstarpayment", + "name": "refundStarPayment", + "description": "Refunds a successful payment in Telegram Stars. Returns True on success.", + "html_description": "

Refunds a successful payment in Telegram Stars. Returns True on success.

", + "rst_description": "Refunds a successful payment in `Telegram Stars `_. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer", + "required": true, + "description": "Identifier of the user whose payment will be refunded", + "html_description": "Identifier of the user whose payment will be refunded", + "rst_description": "Identifier of the user whose payment will be refunded\n", + "name": "user_id" + }, + { + "type": "String", + "required": true, + "description": "Telegram payment identifier", + "html_description": "Telegram payment identifier", + "rst_description": "Telegram payment identifier\n", + "name": "telegram_payment_charge_id" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/replaceStickerInSet/entity.json b/.butcher/methods/replaceStickerInSet/entity.json new file mode 100644 index 00000000..8ef0e9a3 --- /dev/null +++ b/.butcher/methods/replaceStickerInSet/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Stickers", + "anchor": "stickers" + }, + "object": { + "anchor": "replacestickerinset", + "name": "replaceStickerInSet", + "description": "Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.", + "html_description": "

Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.

", + "rst_description": "Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling :class:`aiogram.methods.delete_sticker_from_set.DeleteStickerFromSet`, then :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, then :class:`aiogram.methods.set_sticker_position_in_set.SetStickerPositionInSet`. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer", + "required": true, + "description": "User identifier of the sticker set owner", + "html_description": "User identifier of the sticker set owner", + "rst_description": "User identifier of the sticker set owner\n", + "name": "user_id" + }, + { + "type": "String", + "required": true, + "description": "Sticker set name", + "html_description": "Sticker set name", + "rst_description": "Sticker set name\n", + "name": "name" + }, + { + "type": "String", + "required": true, + "description": "File identifier of the replaced sticker", + "html_description": "File identifier of the replaced sticker", + "rst_description": "File identifier of the replaced sticker\n", + "name": "old_sticker" + }, + { + "type": "InputSticker", + "required": true, + "description": "A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.", + "html_description": "A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.", + "rst_description": "A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.\n", + "name": "sticker" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/sendAnimation/default.yml b/.butcher/methods/sendAnimation/default.yml index 4f6fbe94..50d7b57d 100644 --- a/.butcher/methods/sendAnimation/default.yml +++ b/.butcher/methods/sendAnimation/default.yml @@ -1,2 +1,3 @@ parse_mode: parse_mode protect_content: protect_content +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/sendAnimation/entity.json b/.butcher/methods/sendAnimation/entity.json index f3e82be9..987e6fec 100644 --- a/.butcher/methods/sendAnimation/entity.json +++ b/.butcher/methods/sendAnimation/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

", "rst_description": "Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -91,6 +99,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -115,6 +131,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -126,9 +150,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendAudio/entity.json b/.butcher/methods/sendAudio/entity.json index 94f4b1ff..bc81c541 100644 --- a/.butcher/methods/sendAudio/entity.json +++ b/.butcher/methods/sendAudio/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

For sending voice messages, use the sendVoice method instead.

", "rst_description": "Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.\nFor sending voice messages, use the :class:`aiogram.methods.send_voice.SendVoice` method instead.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -107,6 +115,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -118,9 +134,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendChatAction/entity.json b/.butcher/methods/sendChatAction/entity.json index e6b71ea9..180e1df5 100644 --- a/.butcher/methods/sendChatAction/entity.json +++ b/.butcher/methods/sendChatAction/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.

\n

Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.

\n

We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

", "rst_description": "Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns :code:`True` on success.\n\n Example: The `ImageBot `_ needs some time to process a request and upload the image. Instead of sending a text message along the lines of 'Retrieving image, please wait…', the bot may use :class:`aiogram.methods.send_chat_action.SendChatAction` with *action* = *upload_photo*. The user will see a 'sending photo' status for the bot.\n\nWe only recommend using this method when a response from the bot will take a **noticeable** amount of time to arrive.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the action will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the action will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the action will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -22,9 +30,9 @@ { "type": "Integer", "required": false, - "description": "Unique identifier for the target message thread; supergroups only", - "html_description": "Unique identifier for the target message thread; supergroups only", - "rst_description": "Unique identifier for the target message thread; supergroups only\n", + "description": "Unique identifier for the target message thread; for supergroups only", + "html_description": "Unique identifier for the target message thread; for supergroups only", + "rst_description": "Unique identifier for the target message thread; for supergroups only\n", "name": "message_thread_id" }, { diff --git a/.butcher/methods/sendContact/entity.json b/.butcher/methods/sendContact/entity.json index e72b59da..315b35b9 100644 --- a/.butcher/methods/sendContact/entity.json +++ b/.butcher/methods/sendContact/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send phone contacts. On success, the sent Message is returned.

", "rst_description": "Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -75,6 +83,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -86,9 +102,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendDice/entity.json b/.butcher/methods/sendDice/entity.json index f6d09e5d..d2faf000 100644 --- a/.butcher/methods/sendDice/entity.json +++ b/.butcher/methods/sendDice/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

", "rst_description": "Use this method to send an animated emoji that will display a random value. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -51,6 +59,14 @@ "rst_description": "Protects the contents of the sent message from forwarding\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -62,9 +78,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendDocument/entity.json b/.butcher/methods/sendDocument/entity.json index 4868bcd6..ca887f8e 100644 --- a/.butcher/methods/sendDocument/entity.json +++ b/.butcher/methods/sendDocument/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

", "rst_description": "Use this method to send general files. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -91,6 +99,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -102,9 +118,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendGame/entity.json b/.butcher/methods/sendGame/entity.json index 2532a480..0d83c915 100644 --- a/.butcher/methods/sendGame/entity.json +++ b/.butcher/methods/sendGame/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send a game. On success, the sent Message is returned.

", "rst_description": "Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer", "required": true, @@ -51,6 +59,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendInvoice/entity.json b/.butcher/methods/sendInvoice/entity.json index d51a042c..23eaaca8 100644 --- a/.butcher/methods/sendInvoice/entity.json +++ b/.butcher/methods/sendInvoice/entity.json @@ -53,34 +53,34 @@ }, { "type": "String", - "required": true, - "description": "Payment provider token, obtained via @BotFather", - "html_description": "Payment provider token, obtained via @BotFather", - "rst_description": "Payment provider token, obtained via `@BotFather `_\n", + "required": false, + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token" }, { "type": "String", "required": true, - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency" }, { "type": "Array of LabeledPrice", "required": true, - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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 `_.\n", "name": "prices" }, { "type": "Integer", "required": false, - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "rst_description": "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\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "rst_description": "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 `_.\n", "name": "max_tip_amount" }, { @@ -142,57 +142,57 @@ { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Pass True if you require the user's full name to complete the order", - "rst_description": "Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Pass True if you require the user's phone number to complete the order", - "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Pass True if you require the user's email address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Pass True if you require the user's shipping address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's phone number should be sent to provider", - "html_description": "Pass True if the user's phone number should be sent to provider", - "rst_description": "Pass :code:`True` if the user's phone number should be sent to provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's email address should be sent to provider", - "html_description": "Pass True if the user's email address should be sent to provider", - "rst_description": "Pass :code:`True` if the user's email address should be sent to provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Pass True if the final price depends on the shipping method", - "rst_description": "Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible" }, { @@ -211,6 +211,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendLocation/entity.json b/.butcher/methods/sendLocation/entity.json index 07fd9d5a..0685980e 100644 --- a/.butcher/methods/sendLocation/entity.json +++ b/.butcher/methods/sendLocation/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send point on the map. On success, the sent Message is returned.

", "rst_description": "Use this method to send point on the map. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -54,9 +62,9 @@ { "type": "Integer", "required": false, - "description": "Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.", - "html_description": "Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.", - "rst_description": "Period in seconds for which the location will be updated (see `Live Locations `_, should be between 60 and 86400.\n", + "description": "Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "html_description": "Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "rst_description": "Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.\n", "name": "live_period" }, { @@ -91,6 +99,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -102,9 +118,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendMediaGroup/entity.json b/.butcher/methods/sendMediaGroup/entity.json index 6f9c4490..91734565 100644 --- a/.butcher/methods/sendMediaGroup/entity.json +++ b/.butcher/methods/sendMediaGroup/entity.json @@ -11,6 +11,14 @@ "html_description": "

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.

", "rst_description": "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.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -51,6 +59,14 @@ "rst_description": "Protects the contents of the sent messages from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendMessage/entity.json b/.butcher/methods/sendMessage/entity.json index 8550f779..60ec3634 100644 --- a/.butcher/methods/sendMessage/entity.json +++ b/.butcher/methods/sendMessage/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send text messages. On success, the sent Message is returned.

", "rst_description": "Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -75,6 +83,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -86,9 +102,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendPhoto/default.yml b/.butcher/methods/sendPhoto/default.yml index 4f6fbe94..50d7b57d 100644 --- a/.butcher/methods/sendPhoto/default.yml +++ b/.butcher/methods/sendPhoto/default.yml @@ -1,2 +1,3 @@ parse_mode: parse_mode protect_content: protect_content +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/sendPhoto/entity.json b/.butcher/methods/sendPhoto/entity.json index fa65104b..b7c6cdff 100644 --- a/.butcher/methods/sendPhoto/entity.json +++ b/.butcher/methods/sendPhoto/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send photos. On success, the sent Message is returned.

", "rst_description": "Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -59,6 +67,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -83,6 +99,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -94,9 +118,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendPoll/default.yml b/.butcher/methods/sendPoll/default.yml index 482ea7de..26ac273c 100644 --- a/.butcher/methods/sendPoll/default.yml +++ b/.butcher/methods/sendPoll/default.yml @@ -1,2 +1,3 @@ explanation_parse_mode: parse_mode +question_parse_mode: parse_mode protect_content: protect_content diff --git a/.butcher/methods/sendPoll/entity.json b/.butcher/methods/sendPoll/entity.json index bf1daa6d..106a6eac 100644 --- a/.butcher/methods/sendPoll/entity.json +++ b/.butcher/methods/sendPoll/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send a native poll. On success, the sent Message is returned.

", "rst_description": "Use this method to send a native poll. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -36,11 +44,27 @@ "name": "question" }, { - "type": "Array of String", + "type": "String", + "required": false, + "description": "Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed", + "html_description": "Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed", + "rst_description": "Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed\n", + "name": "question_parse_mode" + }, + { + "type": "Array of MessageEntity", + "required": false, + "description": "A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode", + "html_description": "A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode", + "rst_description": "A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode*\n", + "name": "question_entities" + }, + { + "type": "Array of InputPollOption", "required": true, - "description": "A JSON-serialized list of answer options, 2-10 strings 1-100 characters each", - "html_description": "A JSON-serialized list of answer options, 2-10 strings 1-100 characters each", - "rst_description": "A JSON-serialized list of answer options, 2-10 strings 1-100 characters each\n", + "description": "A JSON-serialized list of 2-10 answer options", + "html_description": "A JSON-serialized list of 2-10 answer options", + "rst_description": "A JSON-serialized list of 2-10 answer options\n", "name": "options" }, { @@ -94,9 +118,9 @@ { "type": "Array of MessageEntity", "required": false, - "description": "A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode", - "html_description": "A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode", - "rst_description": "A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*\n", + "description": "A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode", + "html_description": "A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode", + "rst_description": "A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode*\n", "name": "explanation_entities" }, { @@ -139,6 +163,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -150,9 +182,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendPoll/replace.yml b/.butcher/methods/sendPoll/replace.yml index be2dac51..4bd38a64 100644 --- a/.butcher/methods/sendPoll/replace.yml +++ b/.butcher/methods/sendPoll/replace.yml @@ -9,3 +9,15 @@ annotations: name: datetime.timedelta - type: std name: int + options: + parsed_type: + type: array + items: + type: union + items: + - type: entity + references: + category: types + name: InputPollOption + - type: std + name: str diff --git a/.butcher/methods/sendSticker/entity.json b/.butcher/methods/sendSticker/entity.json index 9b67cb82..e14bac32 100644 --- a/.butcher/methods/sendSticker/entity.json +++ b/.butcher/methods/sendSticker/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.

", "rst_description": "Use this method to send static .WEBP, `animated `_ .TGS, or `video `_ .WEBM stickers. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -30,9 +38,9 @@ { "type": "InputFile or String", "required": true, - "description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. More information on Sending Files. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.", - "html_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. More information on Sending Files ». Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.", - "rst_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.\n", + "description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files. Video and animated stickers can't be sent via an HTTP URL.", + "html_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files ». Video and animated stickers can't be sent via an HTTP URL.", + "rst_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL.\n", "name": "sticker" }, { @@ -59,6 +67,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -70,9 +86,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendVenue/entity.json b/.butcher/methods/sendVenue/entity.json index 4b4c52e6..18b869d1 100644 --- a/.butcher/methods/sendVenue/entity.json +++ b/.butcher/methods/sendVenue/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send information about a venue. On success, the sent Message is returned.

", "rst_description": "Use this method to send information about a venue. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -107,6 +115,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -118,9 +134,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendVideo/default.yml b/.butcher/methods/sendVideo/default.yml index 4f6fbe94..50d7b57d 100644 --- a/.butcher/methods/sendVideo/default.yml +++ b/.butcher/methods/sendVideo/default.yml @@ -1,2 +1,3 @@ parse_mode: parse_mode protect_content: protect_content +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/sendVideo/entity.json b/.butcher/methods/sendVideo/entity.json index 1d117484..b6f21f09 100644 --- a/.butcher/methods/sendVideo/entity.json +++ b/.butcher/methods/sendVideo/entity.json @@ -11,6 +11,14 @@ "html_description": "

Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

", "rst_description": "Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -91,6 +99,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -123,6 +139,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -134,9 +158,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendVideoNote/entity.json b/.butcher/methods/sendVideoNote/entity.json index 2727d1b7..a9529783 100644 --- a/.butcher/methods/sendVideoNote/entity.json +++ b/.butcher/methods/sendVideoNote/entity.json @@ -11,6 +11,14 @@ "html_description": "

As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.

", "rst_description": "As of `v.4.0 `_, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -75,6 +83,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -86,9 +102,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendVoice/entity.json b/.butcher/methods/sendVoice/entity.json index b5a4da98..e3464acd 100644 --- a/.butcher/methods/sendVoice/entity.json +++ b/.butcher/methods/sendVoice/entity.json @@ -7,10 +7,18 @@ "object": { "anchor": "sendvoice", "name": "sendVoice", - "description": "Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.", - "html_description": "

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

", - "rst_description": "Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.", + "description": "Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.", + "html_description": "

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

", + "rst_description": "Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -83,6 +91,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -94,9 +110,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/setMessageReaction/entity.json b/.butcher/methods/setMessageReaction/entity.json index 3eb079a3..e26f914c 100644 --- a/.butcher/methods/setMessageReaction/entity.json +++ b/.butcher/methods/setMessageReaction/entity.json @@ -30,9 +30,9 @@ { "type": "Array of ReactionType", "required": false, - "description": "New 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.", - "html_description": "New 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.", - "rst_description": "New 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.\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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.\n", "name": "reaction" }, { diff --git a/.butcher/methods/setStickerSetThumbnail/entity.json b/.butcher/methods/setStickerSetThumbnail/entity.json index 906f7807..aa49f0de 100644 --- a/.butcher/methods/setStickerSetThumbnail/entity.json +++ b/.butcher/methods/setStickerSetThumbnail/entity.json @@ -34,6 +34,14 @@ "html_description": "A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. 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, or upload a new one using multipart/form-data. More information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.", "rst_description": "A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animated-sticker-requirements `_`https://core.telegram.org/stickers#animated-sticker-requirements `_ for animated sticker technical requirements), or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements `_`https://core.telegram.org/stickers#video-sticker-requirements `_ for video sticker technical requirements. 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, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.\n", "name": "thumbnail" + }, + { + "type": "String", + "required": true, + "description": "Format of the thumbnail, must be one of 'static' for a .WEBP or .PNG image, 'animated' for a .TGS animation, or 'video' for a WEBM video", + "html_description": "Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a WEBM video", + "rst_description": "Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **WEBM** video\n", + "name": "format" } ], "category": "methods" diff --git a/.butcher/methods/uploadStickerFile/entity.json b/.butcher/methods/uploadStickerFile/entity.json index 97bab16e..802df831 100644 --- a/.butcher/methods/uploadStickerFile/entity.json +++ b/.butcher/methods/uploadStickerFile/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "uploadstickerfile", "name": "uploadStickerFile", - "description": "Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times). Returns the uploaded File on success.", - "html_description": "

Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times). Returns the uploaded File on success.

", - "rst_description": "Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet` and :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.", + "description": "Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.", + "html_description": "

Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.

", + "rst_description": "Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet`, :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, or :class:`aiogram.methods.replace_sticker_in_set.ReplaceStickerInSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.", "annotations": [ { "type": "Integer", diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index e4833840..a50ca8b3 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -1,7 +1,7 @@ { "api": { - "version": "7.1", - "release_date": "2024-02-16" + "version": "7.4", + "release_date": "2024-05-28" }, "items": [ { @@ -55,6 +55,38 @@ "name": "edited_channel_post", "required": false }, + { + "type": "BusinessConnection", + "description": "The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot", + "html_description": "Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot", + "rst_description": "*Optional*. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot\n", + "name": "business_connection", + "required": false + }, + { + "type": "Message", + "description": "New message from a connected business account", + "html_description": "Optional. New message from a connected business account", + "rst_description": "*Optional*. New message from a connected business account\n", + "name": "business_message", + "required": false + }, + { + "type": "Message", + "description": "New version of a message from a connected business account", + "html_description": "Optional. New version of a message from a connected business account", + "rst_description": "*Optional*. New version of a message from a connected business account\n", + "name": "edited_business_message", + "required": false + }, + { + "type": "BusinessMessagesDeleted", + "description": "Messages were deleted from a connected business account", + "html_description": "Optional. Messages were deleted from a connected business account", + "rst_description": "*Optional*. Messages were deleted from a connected business account\n", + "name": "deleted_business_messages", + "required": false + }, { "type": "MessageReactionUpdated", "description": "A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify \"message_reaction\" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.", @@ -488,6 +520,14 @@ "rst_description": "*Optional*. :code:`True`, if the bot supports inline queries. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n", "name": "supports_inline_queries", "required": false + }, + { + "type": "Boolean", + "description": "True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.", + "html_description": "Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.", + "rst_description": "*Optional*. :code:`True`, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n", + "name": "can_connect_to_business", + "required": false } ], "category": "types" @@ -509,9 +549,75 @@ }, { "type": "String", - "description": "Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'", - "html_description": "Type of chat, can be either “private”, “group”, “supergroup” or “channel”", - "rst_description": "Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'\n", + "description": "Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'", + "html_description": "Type of the chat, can be either “private”, “group”, “supergroup” or “channel”", + "rst_description": "Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Title, for supergroups, channels and group chats", + "html_description": "Optional. Title, for supergroups, channels and group chats", + "rst_description": "*Optional*. Title, for supergroups, channels and group chats\n", + "name": "title", + "required": false + }, + { + "type": "String", + "description": "Username, for private chats, supergroups and channels if available", + "html_description": "Optional. Username, for private chats, supergroups and channels if available", + "rst_description": "*Optional*. Username, for private chats, supergroups and channels if available\n", + "name": "username", + "required": false + }, + { + "type": "String", + "description": "First name of the other party in a private chat", + "html_description": "Optional. First name of the other party in a private chat", + "rst_description": "*Optional*. First name of the other party in a private chat\n", + "name": "first_name", + "required": false + }, + { + "type": "String", + "description": "Last name of the other party in a private chat", + "html_description": "Optional. Last name of the other party in a private chat", + "rst_description": "*Optional*. Last name of the other party in a private chat\n", + "name": "last_name", + "required": false + }, + { + "type": "True", + "description": "True, if the supergroup chat is a forum (has topics enabled)", + "html_description": "Optional. True, if the supergroup chat is a forum (has topics enabled)", + "rst_description": "*Optional*. :code:`True`, if the supergroup chat is a forum (has `topics `_ enabled)\n", + "name": "is_forum", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "chatfullinfo", + "name": "ChatFullInfo", + "description": "This object contains full information about a chat.", + "html_description": "

This object contains full information about a chat.

", + "rst_description": "This object contains full information about a chat.", + "annotations": [ + { + "type": "Integer", + "description": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.", + "html_description": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.", + "rst_description": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.\n", + "name": "id", + "required": true + }, + { + "type": "String", + "description": "Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'", + "html_description": "Type of the chat, can be either “private”, “group”, “supergroup” or “channel”", + "rst_description": "Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'\n", "name": "type", "required": true }, @@ -555,243 +661,291 @@ "name": "is_forum", "required": false }, + { + "type": "Integer", + "description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.", + "html_description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.", + "rst_description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details.\n", + "name": "accent_color_id", + "required": true + }, + { + "type": "Integer", + "description": "The maximum number of reactions that can be set on a message in the chat", + "html_description": "The maximum number of reactions that can be set on a message in the chat", + "rst_description": "The maximum number of reactions that can be set on a message in the chat\n", + "name": "max_reaction_count", + "required": true + }, { "type": "ChatPhoto", - "description": "Chat photo. Returned only in getChat.", - "html_description": "Optional. Chat photo. Returned only in getChat.", - "rst_description": "*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Chat photo", + "html_description": "Optional. Chat photo", + "rst_description": "*Optional*. Chat photo\n", "name": "photo", "required": false }, { "type": "Array of String", - "description": "If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.", - "html_description": "Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.", - "rst_description": "*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`.\n", + "description": "If non-empty, the list of all active chat usernames; for private chats, supergroups and channels", + "html_description": "Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels", + "rst_description": "*Optional*. If non-empty, the list of all `active chat usernames `_; for private chats, supergroups and channels\n", "name": "active_usernames", "required": false }, + { + "type": "Birthdate", + "description": "For private chats, the date of birth of the user", + "html_description": "Optional. For private chats, the date of birth of the user", + "rst_description": "*Optional*. For private chats, the date of birth of the user\n", + "name": "birthdate", + "required": false + }, + { + "type": "BusinessIntro", + "description": "For private chats with business accounts, the intro of the business", + "html_description": "Optional. For private chats with business accounts, the intro of the business", + "rst_description": "*Optional*. For private chats with business accounts, the intro of the business\n", + "name": "business_intro", + "required": false + }, + { + "type": "BusinessLocation", + "description": "For private chats with business accounts, the location of the business", + "html_description": "Optional. For private chats with business accounts, the location of the business", + "rst_description": "*Optional*. For private chats with business accounts, the location of the business\n", + "name": "business_location", + "required": false + }, + { + "type": "BusinessOpeningHours", + "description": "For private chats with business accounts, the opening hours of the business", + "html_description": "Optional. For private chats with business accounts, the opening hours of the business", + "rst_description": "*Optional*. For private chats with business accounts, the opening hours of the business\n", + "name": "business_opening_hours", + "required": false + }, + { + "type": "Chat", + "description": "For private chats, the personal channel of the user", + "html_description": "Optional. For private chats, the personal channel of the user", + "rst_description": "*Optional*. For private chats, the personal channel of the user\n", + "name": "personal_chat", + "required": false + }, { "type": "Array of ReactionType", - "description": "List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.", - "html_description": "Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.", - "rst_description": "*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`.\n", + "description": "List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.", + "html_description": "Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.", + "rst_description": "*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions `_ are allowed.\n", "name": "available_reactions", "required": false }, - { - "type": "Integer", - "description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", - "html_description": "Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", - "rst_description": "*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "accent_color_id", - "required": false - }, { "type": "String", - "description": "Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.", - "html_description": "Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.", - "rst_description": "*Optional*. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background", + "html_description": "Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background", + "rst_description": "*Optional*. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background\n", "name": "background_custom_emoji_id", "required": false }, { "type": "Integer", - "description": "Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", - "html_description": "Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", - "rst_description": "*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Identifier of the accent color for the chat's profile background. See profile accent colors for more details.", + "html_description": "Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details.", + "rst_description": "*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details.\n", "name": "profile_accent_color_id", "required": false }, { "type": "String", - "description": "Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", - "html_description": "Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", - "rst_description": "*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Custom emoji identifier of the emoji chosen by the chat for its profile background", + "html_description": "Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background", + "rst_description": "*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background\n", "name": "profile_background_custom_emoji_id", "required": false }, { "type": "String", - "description": "Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", - "html_description": "Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", - "rst_description": "*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Custom emoji identifier of the emoji status of the chat or the other party in a private chat", + "html_description": "Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat", + "rst_description": "*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat\n", "name": "emoji_status_custom_emoji_id", "required": false }, { "type": "Integer", - "description": "Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", - "html_description": "Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", - "rst_description": "*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any", + "html_description": "Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any", + "rst_description": "*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any\n", "name": "emoji_status_expiration_date", "required": false }, { "type": "String", - "description": "Bio of the other party in a private chat. Returned only in getChat.", - "html_description": "Optional. Bio of the other party in a private chat. Returned only in getChat.", - "rst_description": "*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Bio of the other party in a private chat", + "html_description": "Optional. Bio of the other party in a private chat", + "rst_description": "*Optional*. Bio of the other party in a private chat\n", "name": "bio", "required": false }, { "type": "True", - "description": "True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user. Returned only in getChat.", - "html_description": "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user", + "html_description": "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user", + "rst_description": "*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=` links only in chats with the user\n", "name": "has_private_forwards", "required": false }, { "type": "True", - "description": "True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.", - "html_description": "Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat", + "html_description": "Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat", + "rst_description": "*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat\n", "name": "has_restricted_voice_and_video_messages", "required": false }, { "type": "True", - "description": "True, if users need to join the supergroup before they can send messages. Returned only in getChat.", - "html_description": "Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if users need to join the supergroup before they can send messages. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "True, if users need to join the supergroup before they can send messages", + "html_description": "Optional. True, if users need to join the supergroup before they can send messages", + "rst_description": "*Optional*. :code:`True`, if users need to join the supergroup before they can send messages\n", "name": "join_to_send_messages", "required": false }, { "type": "True", - "description": "True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.", - "html_description": "Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators", + "html_description": "Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators", + "rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators\n", "name": "join_by_request", "required": false }, { "type": "String", - "description": "Description, for groups, supergroups and channel chats. Returned only in getChat.", - "html_description": "Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.", - "rst_description": "*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Description, for groups, supergroups and channel chats", + "html_description": "Optional. Description, for groups, supergroups and channel chats", + "rst_description": "*Optional*. Description, for groups, supergroups and channel chats\n", "name": "description", "required": false }, { "type": "String", - "description": "Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.", - "html_description": "Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.", - "rst_description": "*Optional*. Primary invite link, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Primary invite link, for groups, supergroups and channel chats", + "html_description": "Optional. Primary invite link, for groups, supergroups and channel chats", + "rst_description": "*Optional*. Primary invite link, for groups, supergroups and channel chats\n", "name": "invite_link", "required": false }, { "type": "Message", - "description": "The most recent pinned message (by sending date). Returned only in getChat.", - "html_description": "Optional. The most recent pinned message (by sending date). Returned only in getChat.", - "rst_description": "*Optional*. The most recent pinned message (by sending date). Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "The most recent pinned message (by sending date)", + "html_description": "Optional. The most recent pinned message (by sending date)", + "rst_description": "*Optional*. The most recent pinned message (by sending date)\n", "name": "pinned_message", "required": false }, { "type": "ChatPermissions", - "description": "Default chat member permissions, for groups and supergroups. Returned only in getChat.", - "html_description": "Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.", - "rst_description": "*Optional*. Default chat member permissions, for groups and supergroups. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Default chat member permissions, for groups and supergroups", + "html_description": "Optional. Default chat member permissions, for groups and supergroups", + "rst_description": "*Optional*. Default chat member permissions, for groups and supergroups\n", "name": "permissions", "required": false }, { "type": "Integer", - "description": "For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat.", - "html_description": "Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat.", - "rst_description": "*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds", + "html_description": "Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds", + "rst_description": "*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds\n", "name": "slow_mode_delay", "required": false }, { "type": "Integer", - "description": "For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat.", - "html_description": "Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat.", - "rst_description": "*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions", + "html_description": "Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions", + "rst_description": "*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions\n", "name": "unrestrict_boost_count", "required": false }, { "type": "Integer", - "description": "The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.", - "html_description": "Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.", - "rst_description": "*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "The time after which all messages sent to the chat will be automatically deleted; in seconds", + "html_description": "Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds", + "rst_description": "*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds\n", "name": "message_auto_delete_time", "required": false }, { "type": "True", - "description": "True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.", - "html_description": "Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.", + "html_description": "Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.", + "rst_description": "*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.\n", "name": "has_aggressive_anti_spam_enabled", "required": false }, { "type": "True", - "description": "True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.", - "html_description": "Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "True, if non-administrators can only get the list of bots and administrators in the chat", + "html_description": "Optional. True, if non-administrators can only get the list of bots and administrators in the chat", + "rst_description": "*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat\n", "name": "has_hidden_members", "required": false }, { "type": "True", - "description": "True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.", - "html_description": "Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "True, if messages from the chat can't be forwarded to other chats", + "html_description": "Optional. True, if messages from the chat can't be forwarded to other chats", + "rst_description": "*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats\n", "name": "has_protected_content", "required": false }, { "type": "True", - "description": "True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", - "html_description": "Optional. True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "True, if new chat members will have access to old messages; available only to chat administrators", + "html_description": "Optional. True, if new chat members will have access to old messages; available only to chat administrators", + "rst_description": "*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators\n", "name": "has_visible_history", "required": false }, { "type": "String", - "description": "For supergroups, name of group sticker set. Returned only in getChat.", - "html_description": "Optional. For supergroups, name of group sticker set. Returned only in getChat.", - "rst_description": "*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "For supergroups, name of the group sticker set", + "html_description": "Optional. For supergroups, name of the group sticker set", + "rst_description": "*Optional*. For supergroups, name of the group sticker set\n", "name": "sticker_set_name", "required": false }, { "type": "True", - "description": "True, if the bot can change the group sticker set. Returned only in getChat.", - "html_description": "Optional. True, if the bot can change the group sticker set. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if the bot can change the group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "True, if the bot can change the group sticker set", + "html_description": "Optional. True, if the bot can change the group sticker set", + "rst_description": "*Optional*. :code:`True`, if the bot can change the group sticker set\n", "name": "can_set_sticker_set", "required": false }, { "type": "String", - "description": "For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in getChat.", - "html_description": "Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in getChat.", - "rst_description": "*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.", + "html_description": "Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.", + "rst_description": "*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.\n", "name": "custom_emoji_sticker_set_name", "required": false }, { "type": "Integer", - "description": "Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.", - "html_description": "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.", - "rst_description": "*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.", + "html_description": "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.", + "rst_description": "*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.\n", "name": "linked_chat_id", "required": false }, { "type": "ChatLocation", - "description": "For supergroups, the location to which the supergroup is connected. Returned only in getChat.", - "html_description": "Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.", - "rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "For supergroups, the location to which the supergroup is connected", + "html_description": "Optional. For supergroups, the location to which the supergroup is connected", + "rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected\n", "name": "location", "required": false } @@ -845,6 +999,14 @@ "name": "sender_boost_count", "required": false }, + { + "type": "User", + "description": "The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.", + "html_description": "Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.", + "rst_description": "*Optional*. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.\n", + "name": "sender_business_bot", + "required": false + }, { "type": "Integer", "description": "Date the message was sent in Unix time. It is always a positive number, representing a valid date.", @@ -853,6 +1015,14 @@ "name": "date", "required": true }, + { + "type": "String", + "description": "Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.", + "html_description": "Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.", + "rst_description": "*Optional*. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.\n", + "name": "business_connection_id", + "required": false + }, { "type": "Chat", "description": "Chat the message belongs to", @@ -941,6 +1111,14 @@ "name": "has_protected_content", "required": false }, + { + "type": "True", + "description": "True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message", + "html_description": "Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message", + "rst_description": "*Optional*. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message\n", + "name": "is_from_offline", + "required": false + }, { "type": "String", "description": "The unique identifier of a media message group this message belongs to", @@ -981,6 +1159,14 @@ "name": "link_preview_options", "required": false }, + { + "type": "String", + "description": "Unique identifier of the message effect added to the message", + "html_description": "Optional. Unique identifier of the message effect added to the message", + "rst_description": "*Optional*. Unique identifier of the message effect added to the message\n", + "name": "effect_id", + "required": false + }, { "type": "Animation", "description": "Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set", @@ -1069,6 +1255,14 @@ "name": "caption_entities", "required": false }, + { + "type": "True", + "description": "True, if the caption must be shown above the message media", + "html_description": "Optional. True, if the caption must be shown above the message media", + "rst_description": "*Optional*. True, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "True", "description": "True, if the message media is covered by a spoiler animation", @@ -1293,6 +1487,14 @@ "name": "boost_added", "required": false }, + { + "type": "ChatBackground", + "description": "Service message: chat background set", + "html_description": "Optional. Service message: chat background set", + "rst_description": "*Optional*. Service message: chat background set\n", + "name": "chat_background_set", + "required": false + }, { "type": "ForumTopicCreated", "description": "Service message: forum topic created", @@ -1494,9 +1696,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), '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), “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), '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), '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", "name": "type", "required": true }, @@ -1804,17 +2006,17 @@ }, { "type": "Integer or String", - "description": "If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)", - "html_description": "Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)", - "rst_description": "*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)\n", + "description": "If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account.", + "html_description": "Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account.", + "rst_description": "*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`). Not supported for messages sent on behalf of a business account.\n", "name": "chat_id", "required": false }, { "type": "Boolean", - "description": "Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.", - "html_description": "Optional. Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.", - "rst_description": "*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.\n", + "description": "Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account.", + "html_description": "Optional. Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account.", + "rst_description": "*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found. Always :code:`False` for replies in another chat or forum topic. Always :code:`True` for messages sent on behalf of a business account.\n", "name": "allow_sending_without_reply", "required": false }, @@ -2601,6 +2803,14 @@ "name": "text", "required": true }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts", + "html_description": "Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts", + "rst_description": "*Optional*. Special entities that appear in the option *text*. Currently, only custom emoji entities are allowed in poll option texts\n", + "name": "text_entities", + "required": false + }, { "type": "Integer", "description": "Number of users that voted for this option", @@ -2612,6 +2822,40 @@ ], "category": "types" }, + { + "anchor": "inputpolloption", + "name": "InputPollOption", + "description": "This object contains information about one answer option in a poll to send.", + "html_description": "

This object contains information about one answer option in a poll to send.

", + "rst_description": "This object contains information about one answer option in a poll to send.", + "annotations": [ + { + "type": "String", + "description": "Option text, 1-100 characters", + "html_description": "Option text, 1-100 characters", + "rst_description": "Option text, 1-100 characters\n", + "name": "text", + "required": true + }, + { + "type": "String", + "description": "Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed", + "html_description": "Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed", + "rst_description": "*Optional*. Mode for parsing entities in the text. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed\n", + "name": "text_parse_mode", + "required": false + }, + { + "type": "Array of MessageEntity", + "description": "A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode", + "html_description": "Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode", + "rst_description": "*Optional*. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of *text_parse_mode*\n", + "name": "text_entities", + "required": false + } + ], + "category": "types" + }, { "anchor": "pollanswer", "name": "PollAnswer", @@ -2677,6 +2921,14 @@ "name": "question", "required": true }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions", + "html_description": "Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions", + "rst_description": "*Optional*. Special entities that appear in the *question*. Currently, only custom emoji entities are allowed in poll questions\n", + "name": "question_entities", + "required": false + }, { "type": "Array of PollOption", "description": "List of poll options", @@ -2775,14 +3027,6 @@ "html_description": "

This object represents a point on the map.

", "rst_description": "This object represents a point on the map.", "annotations": [ - { - "type": "Float", - "description": "Longitude as defined by sender", - "html_description": "Longitude as defined by sender", - "rst_description": "Longitude as defined by sender\n", - "name": "longitude", - "required": true - }, { "type": "Float", "description": "Latitude as defined by sender", @@ -2791,6 +3035,14 @@ "name": "latitude", "required": true }, + { + "type": "Float", + "description": "Longitude as defined by sender", + "html_description": "Longitude as defined by sender", + "rst_description": "Longitude as defined by sender\n", + "name": "longitude", + "required": true + }, { "type": "Float", "description": "The radius of uncertainty for the location, measured in meters; 0-1500", @@ -2988,6 +3240,304 @@ ], "category": "types" }, + { + "anchor": "backgroundfill", + "name": "BackgroundFill", + "description": "This object describes the way a background is filled based on the selected colors. Currently, it can be one of\n - BackgroundFillSolid\n - BackgroundFillGradient\n - BackgroundFillFreeformGradient", + "html_description": "

This object describes the way a background is filled based on the selected colors. Currently, it can be one of

", + "rst_description": "This object describes the way a background is filled based on the selected colors. Currently, it can be one of\n\n - :class:`aiogram.types.background_fill_solid.BackgroundFillSolid`\n - :class:`aiogram.types.background_fill_gradient.BackgroundFillGradient`\n - :class:`aiogram.types.background_fill_freeform_gradient.BackgroundFillFreeformGradient`", + "annotations": [], + "category": "types" + }, + { + "anchor": "backgroundfillsolid", + "name": "BackgroundFillSolid", + "description": "The background is filled using the selected color.", + "html_description": "

The background is filled using the selected color.

", + "rst_description": "The background is filled using the selected color.", + "annotations": [ + { + "type": "String", + "description": "Type of the background fill, always 'solid'", + "html_description": "Type of the background fill, always “solid”", + "rst_description": "Type of the background fill, always 'solid'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "The color of the background fill in the RGB24 format", + "html_description": "The color of the background fill in the RGB24 format", + "rst_description": "The color of the background fill in the RGB24 format\n", + "name": "color", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "backgroundfillgradient", + "name": "BackgroundFillGradient", + "description": "The background is a gradient fill.", + "html_description": "

The background is a gradient fill.

", + "rst_description": "The background is a gradient fill.", + "annotations": [ + { + "type": "String", + "description": "Type of the background fill, always 'gradient'", + "html_description": "Type of the background fill, always “gradient”", + "rst_description": "Type of the background fill, always 'gradient'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Top color of the gradient in the RGB24 format", + "html_description": "Top color of the gradient in the RGB24 format", + "rst_description": "Top color of the gradient in the RGB24 format\n", + "name": "top_color", + "required": true + }, + { + "type": "Integer", + "description": "Bottom color of the gradient in the RGB24 format", + "html_description": "Bottom color of the gradient in the RGB24 format", + "rst_description": "Bottom color of the gradient in the RGB24 format\n", + "name": "bottom_color", + "required": true + }, + { + "type": "Integer", + "description": "Clockwise rotation angle of the background fill in degrees; 0-359", + "html_description": "Clockwise rotation angle of the background fill in degrees; 0-359", + "rst_description": "Clockwise rotation angle of the background fill in degrees; 0-359\n", + "name": "rotation_angle", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "backgroundfillfreeformgradient", + "name": "BackgroundFillFreeformGradient", + "description": "The background is a freeform gradient that rotates after every message in the chat.", + "html_description": "

The background is a freeform gradient that rotates after every message in the chat.

", + "rst_description": "The background is a freeform gradient that rotates after every message in the chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the background fill, always 'freeform_gradient'", + "html_description": "Type of the background fill, always “freeform_gradient”", + "rst_description": "Type of the background fill, always 'freeform_gradient'\n", + "name": "type", + "required": true + }, + { + "type": "Array of Integer", + "description": "A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format", + "html_description": "A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format", + "rst_description": "A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format\n", + "name": "colors", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "backgroundtype", + "name": "BackgroundType", + "description": "This object describes the type of a background. Currently, it can be one of\n - BackgroundTypeFill\n - BackgroundTypeWallpaper\n - BackgroundTypePattern\n - BackgroundTypeChatTheme", + "html_description": "

This object describes the type of a background. Currently, it can be one of

", + "rst_description": "This object describes the type of a background. Currently, it can be one of\n\n - :class:`aiogram.types.background_type_fill.BackgroundTypeFill`\n - :class:`aiogram.types.background_type_wallpaper.BackgroundTypeWallpaper`\n - :class:`aiogram.types.background_type_pattern.BackgroundTypePattern`\n - :class:`aiogram.types.background_type_chat_theme.BackgroundTypeChatTheme`", + "annotations": [], + "category": "types" + }, + { + "anchor": "backgroundtypefill", + "name": "BackgroundTypeFill", + "description": "The background is automatically filled based on the selected colors.", + "html_description": "

The background is automatically filled based on the selected colors.

", + "rst_description": "The background is automatically filled based on the selected colors.", + "annotations": [ + { + "type": "String", + "description": "Type of the background, always 'fill'", + "html_description": "Type of the background, always “fill”", + "rst_description": "Type of the background, always 'fill'\n", + "name": "type", + "required": true + }, + { + "type": "BackgroundFill", + "description": "The background fill", + "html_description": "The background fill", + "rst_description": "The background fill\n", + "name": "fill", + "required": true + }, + { + "type": "Integer", + "description": "Dimming of the background in dark themes, as a percentage; 0-100", + "html_description": "Dimming of the background in dark themes, as a percentage; 0-100", + "rst_description": "Dimming of the background in dark themes, as a percentage; 0-100\n", + "name": "dark_theme_dimming", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "backgroundtypewallpaper", + "name": "BackgroundTypeWallpaper", + "description": "The background is a wallpaper in the JPEG format.", + "html_description": "

The background is a wallpaper in the JPEG format.

", + "rst_description": "The background is a wallpaper in the JPEG format.", + "annotations": [ + { + "type": "String", + "description": "Type of the background, always 'wallpaper'", + "html_description": "Type of the background, always “wallpaper”", + "rst_description": "Type of the background, always 'wallpaper'\n", + "name": "type", + "required": true + }, + { + "type": "Document", + "description": "Document with the wallpaper", + "html_description": "Document with the wallpaper", + "rst_description": "Document with the wallpaper\n", + "name": "document", + "required": true + }, + { + "type": "Integer", + "description": "Dimming of the background in dark themes, as a percentage; 0-100", + "html_description": "Dimming of the background in dark themes, as a percentage; 0-100", + "rst_description": "Dimming of the background in dark themes, as a percentage; 0-100\n", + "name": "dark_theme_dimming", + "required": true + }, + { + "type": "True", + "description": "True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12", + "html_description": "Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12", + "rst_description": "*Optional*. :code:`True`, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12\n", + "name": "is_blurred", + "required": false + }, + { + "type": "True", + "description": "True, if the background moves slightly when the device is tilted", + "html_description": "Optional. True, if the background moves slightly when the device is tilted", + "rst_description": "*Optional*. :code:`True`, if the background moves slightly when the device is tilted\n", + "name": "is_moving", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "backgroundtypepattern", + "name": "BackgroundTypePattern", + "description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.", + "html_description": "

The background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.

", + "rst_description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.", + "annotations": [ + { + "type": "String", + "description": "Type of the background, always 'pattern'", + "html_description": "Type of the background, always “pattern”", + "rst_description": "Type of the background, always 'pattern'\n", + "name": "type", + "required": true + }, + { + "type": "Document", + "description": "Document with the pattern", + "html_description": "Document with the pattern", + "rst_description": "Document with the pattern\n", + "name": "document", + "required": true + }, + { + "type": "BackgroundFill", + "description": "The background fill that is combined with the pattern", + "html_description": "The background fill that is combined with the pattern", + "rst_description": "The background fill that is combined with the pattern\n", + "name": "fill", + "required": true + }, + { + "type": "Integer", + "description": "Intensity of the pattern when it is shown above the filled background; 0-100", + "html_description": "Intensity of the pattern when it is shown above the filled background; 0-100", + "rst_description": "Intensity of the pattern when it is shown above the filled background; 0-100\n", + "name": "intensity", + "required": true + }, + { + "type": "True", + "description": "True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only", + "html_description": "Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only", + "rst_description": "*Optional*. :code:`True`, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only\n", + "name": "is_inverted", + "required": false + }, + { + "type": "True", + "description": "True, if the background moves slightly when the device is tilted", + "html_description": "Optional. True, if the background moves slightly when the device is tilted", + "rst_description": "*Optional*. :code:`True`, if the background moves slightly when the device is tilted\n", + "name": "is_moving", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "backgroundtypechattheme", + "name": "BackgroundTypeChatTheme", + "description": "The background is taken directly from a built-in chat theme.", + "html_description": "

The background is taken directly from a built-in chat theme.

", + "rst_description": "The background is taken directly from a built-in chat theme.", + "annotations": [ + { + "type": "String", + "description": "Type of the background, always 'chat_theme'", + "html_description": "Type of the background, always “chat_theme”", + "rst_description": "Type of the background, always 'chat_theme'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Name of the chat theme, which is usually an emoji", + "html_description": "Name of the chat theme, which is usually an emoji", + "rst_description": "Name of the chat theme, which is usually an emoji\n", + "name": "theme_name", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "chatbackground", + "name": "ChatBackground", + "description": "This object represents a chat background.", + "html_description": "

This object represents a chat background.

", + "rst_description": "This object represents a chat background.", + "annotations": [ + { + "type": "BackgroundType", + "description": "Type of the background", + "html_description": "Type of the background", + "rst_description": "Type of the background\n", + "name": "type", + "required": true + } + ], + "category": "types" + }, { "anchor": "forumtopiccreated", "name": "ForumTopicCreated", @@ -3084,6 +3634,56 @@ "annotations": [], "category": "types" }, + { + "anchor": "shareduser", + "name": "SharedUser", + "description": "This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.", + "html_description": "

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.

", + "rst_description": "This object contains information about a user that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_users.KeyboardButtonRequestUsers` button.", + "annotations": [ + { + "type": "Integer", + "description": "Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.", + "html_description": "Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.", + "rst_description": "Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.\n", + "name": "user_id", + "required": true + }, + { + "type": "String", + "description": "First name of the user, if the name was requested by the bot", + "html_description": "Optional. First name of the user, if the name was requested by the bot", + "rst_description": "*Optional*. First name of the user, if the name was requested by the bot\n", + "name": "first_name", + "required": false + }, + { + "type": "String", + "description": "Last name of the user, if the name was requested by the bot", + "html_description": "Optional. Last name of the user, if the name was requested by the bot", + "rst_description": "*Optional*. Last name of the user, if the name was requested by the bot\n", + "name": "last_name", + "required": false + }, + { + "type": "String", + "description": "Username of the user, if the username was requested by the bot", + "html_description": "Optional. Username of the user, if the username was requested by the bot", + "rst_description": "*Optional*. Username of the user, if the username was requested by the bot\n", + "name": "username", + "required": false + }, + { + "type": "Array of PhotoSize", + "description": "Available sizes of the chat photo, if the photo was requested by the bot", + "html_description": "Optional. Available sizes of the chat photo, if the photo was requested by the bot", + "rst_description": "*Optional*. Available sizes of the chat photo, if the photo was requested by the bot\n", + "name": "photo", + "required": false + } + ], + "category": "types" + }, { "anchor": "usersshared", "name": "UsersShared", @@ -3100,11 +3700,11 @@ "required": true }, { - "type": "Array of Integer", - "description": "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.", - "html_description": "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.", - "rst_description": "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.\n", - "name": "user_ids", + "type": "Array of SharedUser", + "description": "Information about users shared with the bot.", + "html_description": "Information about users shared with the bot.", + "rst_description": "Information about users shared with the bot.\n", + "name": "users", "required": true } ], @@ -3113,9 +3713,9 @@ { "anchor": "chatshared", "name": "ChatShared", - "description": "This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.", - "html_description": "

This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.

", - "rst_description": "This object contains information about the chat whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_chat.KeyboardButtonRequestChat` button.", + "description": "This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.", + "html_description": "

This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.

", + "rst_description": "This object contains information about a chat that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_chat.KeyboardButtonRequestChat` button.", "annotations": [ { "type": "Integer", @@ -3132,6 +3732,30 @@ "rst_description": "Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.\n", "name": "chat_id", "required": true + }, + { + "type": "String", + "description": "Title of the chat, if the title was requested by the bot.", + "html_description": "Optional. Title of the chat, if the title was requested by the bot.", + "rst_description": "*Optional*. Title of the chat, if the title was requested by the bot.\n", + "name": "title", + "required": false + }, + { + "type": "String", + "description": "Username of the chat, if the username was requested by the bot and available.", + "html_description": "Optional. Username of the chat, if the username was requested by the bot and available.", + "rst_description": "*Optional*. Username of the chat, if the username was requested by the bot and available.\n", + "name": "username", + "required": false + }, + { + "type": "Array of PhotoSize", + "description": "Available sizes of the chat photo, if the photo was requested by the bot", + "html_description": "Optional. Available sizes of the chat photo, if the photo was requested by the bot", + "rst_description": "*Optional*. Available sizes of the chat photo, if the photo was requested by the bot\n", + "name": "photo", + "required": false } ], "category": "types" @@ -3587,9 +4211,9 @@ { "anchor": "replykeyboardmarkup", "name": "ReplyKeyboardMarkup", - "description": "This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).", - "html_description": "

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).

", - "rst_description": "This object represents a `custom keyboard `_ with reply options (see `Introduction to bots `_ for details and examples).", + "description": "This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.", + "html_description": "

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.

", + "rst_description": "This object represents a `custom keyboard `_ with reply options (see `Introduction to bots `_ for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.", "annotations": [ { "type": "Array of Array of KeyboardButton", @@ -3645,9 +4269,9 @@ { "anchor": "keyboardbutton", "name": "KeyboardButton", - "description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", - "html_description": "

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", - "rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_users*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", + "description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", + "html_description": "

This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", + "rst_description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", "annotations": [ { "type": "String", @@ -3711,9 +4335,9 @@ { "anchor": "keyboardbuttonrequestusers", "name": "KeyboardButtonRequestUsers", - "description": "This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed.", - "html_description": "

This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »

", - "rst_description": "This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_", + "description": "This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed.", + "html_description": "

This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »

", + "rst_description": "This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_", "annotations": [ { "type": "Integer", @@ -3746,6 +4370,30 @@ "rst_description": "*Optional*. The maximum number of users to be selected; 1-10. Defaults to 1.\n", "name": "max_quantity", "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' first and last names", + "html_description": "Optional. Pass True to request the users' first and last names", + "rst_description": "*Optional*. Pass :code:`True` to request the users' first and last names\n", + "name": "request_name", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' usernames", + "html_description": "Optional. Pass True to request the users' usernames", + "rst_description": "*Optional*. Pass :code:`True` to request the users' usernames\n", + "name": "request_username", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' photos", + "html_description": "Optional. Pass True to request the users' photos", + "rst_description": "*Optional*. Pass :code:`True` to request the users' photos\n", + "name": "request_photo", + "required": false } ], "category": "types" @@ -3753,9 +4401,9 @@ { "anchor": "keyboardbuttonrequestchat", "name": "KeyboardButtonRequestChat", - "description": "This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.", - "html_description": "

This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. More about requesting chats »

", - "rst_description": "This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. `More about requesting chats » `_", + "description": "This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate..", + "html_description": "

This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats ».

", + "rst_description": "This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. `More about requesting chats » `_.", "annotations": [ { "type": "Integer", @@ -3820,6 +4468,30 @@ "rst_description": "*Optional*. Pass :code:`True` to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.\n", "name": "bot_is_member", "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the chat's title", + "html_description": "Optional. Pass True to request the chat's title", + "rst_description": "*Optional*. Pass :code:`True` to request the chat's title\n", + "name": "request_title", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the chat's username", + "html_description": "Optional. Pass True to request the chat's username", + "rst_description": "*Optional*. Pass :code:`True` to request the chat's username\n", + "name": "request_username", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the chat's photo", + "html_description": "Optional. Pass True to request the chat's photo", + "rst_description": "*Optional*. Pass :code:`True` to request the chat's photo\n", + "name": "request_photo", + "required": false } ], "category": "types" @@ -3845,9 +4517,9 @@ { "anchor": "replykeyboardremove", "name": "ReplyKeyboardRemove", - "description": "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).", - "html_description": "

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).

", - "rst_description": "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`).", + "description": "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.", + "html_description": "

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.

", + "rst_description": "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`). Not supported in channels and for messages sent on behalf of a Telegram Business account.", "annotations": [ { "type": "True", @@ -3889,9 +4561,9 @@ { "anchor": "inlinekeyboardbutton", "name": "InlineKeyboardButton", - "description": "This object represents one button of an inline keyboard. You must use exactly one of the optional fields.", - "html_description": "

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

", - "rst_description": "This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields.", + "description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", + "html_description": "

This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.

", + "rst_description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", "annotations": [ { "type": "String", @@ -3911,17 +4583,17 @@ }, { "type": "String", - "description": "Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes", - "html_description": "Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes", - "rst_description": "*Optional*. Data to be sent in a `callback query `_ to the bot when button is pressed, 1-64 bytes\n", + "description": "Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account.", + "html_description": "Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account.", + "rst_description": "*Optional*. Data to be sent in a `callback query `_ to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account.\n", "name": "callback_data", "required": false }, { "type": "WebAppInfo", - "description": "Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.", - "html_description": "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.", - "rst_description": "*Optional*. Description of the `Web App `_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot.\n", + "description": "Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.", + "html_description": "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.", + "rst_description": "*Optional*. Description of the `Web App `_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.\n", "name": "web_app", "required": false }, @@ -3935,25 +4607,25 @@ }, { "type": "String", - "description": "If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.", - "html_description": "Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.", - "rst_description": "*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.\n", + "description": "If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account.", + "html_description": "Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account.", + "rst_description": "*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account.\n", "name": "switch_inline_query", "required": false }, { "type": "String", - "description": "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.\n\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.", - "html_description": "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.
\n
\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.", - "rst_description": "*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.\n\n\n\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.\n", + "description": "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.\n\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account.", + "html_description": "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.
\n
\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account.", + "rst_description": "*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.\n\n\n\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account.\n", "name": "switch_inline_query_current_chat", "required": false }, { "type": "SwitchInlineQueryChosenChat", - "description": "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", - "html_description": "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", - "rst_description": "*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\n", + "description": "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.", + "html_description": "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.", + "rst_description": "*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.\n", "name": "switch_inline_query_chosen_chat", "required": false }, @@ -3967,9 +4639,9 @@ }, { "type": "Boolean", - "description": "Specify True, to send a Pay button.\n\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", - "html_description": "Optional. Specify True, to send a Pay button.
\n
\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", - "rst_description": "*Optional*. Specify :code:`True`, to send a `Pay button `_.\n\n\n\n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages.\n", + "description": "Specify True, to send a Pay button. Substrings '' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.\n\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", + "html_description": "Optional. Specify True, to send a Pay button. Substrings “\"⭐\"/” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
\n
\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", + "rst_description": "*Optional*. Specify :code:`True`, to send a `Pay button `_. Substrings '⭐' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.\n\n\n\n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages.\n", "name": "pay", "required": false } @@ -4137,9 +4809,9 @@ { "anchor": "forcereply", "name": "ForceReply", - "description": "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.\nExample: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\n\nExplain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.\nGuide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.\nThe last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", - "html_description": "

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.

\n

Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

\n
    \n
  • Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
  • \n
  • Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
  • \n
\n

The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.

\n
", - "rst_description": "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode `_.\n\n **Example:** A `poll bot `_ for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\n \n - Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.\n - Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.\n \n The last option is definitely more attractive. And if you use :class:`aiogram.types.force_reply.ForceReply` in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", + "description": "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.\nExample: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\n\nExplain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.\nGuide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.\nThe last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", + "html_description": "

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.

\n

Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

\n
    \n
  • Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
  • \n
  • Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
  • \n
\n

The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.

\n
", + "rst_description": "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode `_. Not supported in channels and for messages sent on behalf of a Telegram Business account.\n\n **Example:** A `poll bot `_ for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\n \n - Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.\n - Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.\n \n The last option is definitely more attractive. And if you use :class:`aiogram.types.force_reply.ForceReply` in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", "annotations": [ { "type": "True", @@ -4373,9 +5045,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can edit stories posted by other users", - "html_description": "True, if the administrator can edit stories posted by other users", - "rst_description": ":code:`True`, if the administrator can edit stories posted by other users\n", + "description": "True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "html_description": "True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "rst_description": ":code:`True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive\n", "name": "can_edit_stories", "required": true }, @@ -4389,33 +5061,33 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", - "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", + "description": "True, if the administrator can post messages in the channel, or access channel statistics; for channels only", + "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; for channels only\n", "name": "can_post_messages", "required": false }, { "type": "Boolean", - "description": "True, if the administrator can edit messages of other users and can pin messages; channels only", - "html_description": "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only\n", + "description": "True, if the administrator can edit messages of other users and can pin messages; for channels only", + "html_description": "Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; for channels only\n", "name": "can_edit_messages", "required": false }, { "type": "Boolean", - "description": "True, if the user is allowed to pin messages; groups and supergroups only", - "html_description": "Optional. True, if the user is allowed to pin messages; groups and supergroups only", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only\n", + "description": "True, if the user is allowed to pin messages; for groups and supergroups only", + "html_description": "Optional. True, if the user is allowed to pin messages; for groups and supergroups only", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; for groups and supergroups only\n", "name": "can_pin_messages", "required": false }, { "type": "Boolean", - "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", - "html_description": "Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only\n", + "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "html_description": "Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only\n", "name": "can_manage_topics", "required": false } @@ -4477,6 +5149,14 @@ "name": "invite_link", "required": false }, + { + "type": "Boolean", + "description": "True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator", + "html_description": "Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator", + "rst_description": "*Optional*. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator\n", + "name": "via_join_request", + "required": false + }, { "type": "Boolean", "description": "True, if the user joined the chat via a chat folder invite link", @@ -4644,9 +5324,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can edit stories posted by other users", - "html_description": "True, if the administrator can edit stories posted by other users", - "rst_description": ":code:`True`, if the administrator can edit stories posted by other users\n", + "description": "True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "html_description": "True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "rst_description": ":code:`True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive\n", "name": "can_edit_stories", "required": true }, @@ -4660,33 +5340,33 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", - "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", + "description": "True, if the administrator can post messages in the channel, or access channel statistics; for channels only", + "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; for channels only\n", "name": "can_post_messages", "required": false }, { "type": "Boolean", - "description": "True, if the administrator can edit messages of other users and can pin messages; channels only", - "html_description": "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only\n", + "description": "True, if the administrator can edit messages of other users and can pin messages; for channels only", + "html_description": "Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; for channels only\n", "name": "can_edit_messages", "required": false }, { "type": "Boolean", - "description": "True, if the user is allowed to pin messages; groups and supergroups only", - "html_description": "Optional. True, if the user is allowed to pin messages; groups and supergroups only", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only\n", + "description": "True, if the user is allowed to pin messages; for groups and supergroups only", + "html_description": "Optional. True, if the user is allowed to pin messages; for groups and supergroups only", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; for groups and supergroups only\n", "name": "can_pin_messages", "required": false }, { "type": "Boolean", - "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", - "html_description": "Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only\n", + "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "html_description": "Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only\n", "name": "can_manage_topics", "required": false }, @@ -5121,6 +5801,152 @@ ], "category": "types" }, + { + "anchor": "birthdate", + "name": "Birthdate", + "description": "Describes the birthdate of a user.", + "html_description": "

Describes the birthdate of a user.

", + "rst_description": "Describes the birthdate of a user.", + "annotations": [ + { + "type": "Integer", + "description": "Day of the user's birth; 1-31", + "html_description": "Day of the user's birth; 1-31", + "rst_description": "Day of the user's birth; 1-31\n", + "name": "day", + "required": true + }, + { + "type": "Integer", + "description": "Month of the user's birth; 1-12", + "html_description": "Month of the user's birth; 1-12", + "rst_description": "Month of the user's birth; 1-12\n", + "name": "month", + "required": true + }, + { + "type": "Integer", + "description": "Year of the user's birth", + "html_description": "Optional. Year of the user's birth", + "rst_description": "*Optional*. Year of the user's birth\n", + "name": "year", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "businessintro", + "name": "BusinessIntro", + "description": "Contains information about the start page settings of a Telegram Business account.", + "html_description": "

Contains information about the start page settings of a Telegram Business account.

", + "rst_description": "Contains information about the start page settings of a Telegram Business account.", + "annotations": [ + { + "type": "String", + "description": "Title text of the business intro", + "html_description": "Optional. Title text of the business intro", + "rst_description": "*Optional*. Title text of the business intro\n", + "name": "title", + "required": false + }, + { + "type": "String", + "description": "Message text of the business intro", + "html_description": "Optional. Message text of the business intro", + "rst_description": "*Optional*. Message text of the business intro\n", + "name": "message", + "required": false + }, + { + "type": "Sticker", + "description": "Sticker of the business intro", + "html_description": "Optional. Sticker of the business intro", + "rst_description": "*Optional*. Sticker of the business intro\n", + "name": "sticker", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "businesslocation", + "name": "BusinessLocation", + "description": "Contains information about the location of a Telegram Business account.", + "html_description": "

Contains information about the location of a Telegram Business account.

", + "rst_description": "Contains information about the location of a Telegram Business account.", + "annotations": [ + { + "type": "String", + "description": "Address of the business", + "html_description": "Address of the business", + "rst_description": "Address of the business\n", + "name": "address", + "required": true + }, + { + "type": "Location", + "description": "Location of the business", + "html_description": "Optional. Location of the business", + "rst_description": "*Optional*. Location of the business\n", + "name": "location", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "businessopeninghoursinterval", + "name": "BusinessOpeningHoursInterval", + "description": "Describes an interval of time during which a business is open.", + "html_description": "

Describes an interval of time during which a business is open.

", + "rst_description": "Describes an interval of time during which a business is open.", + "annotations": [ + { + "type": "Integer", + "description": "The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60", + "html_description": "The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60", + "rst_description": "The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60\n", + "name": "opening_minute", + "required": true + }, + { + "type": "Integer", + "description": "The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60", + "html_description": "The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60", + "rst_description": "The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60\n", + "name": "closing_minute", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "businessopeninghours", + "name": "BusinessOpeningHours", + "description": "Describes the opening hours of a business.", + "html_description": "

Describes the opening hours of a business.

", + "rst_description": "Describes the opening hours of a business.", + "annotations": [ + { + "type": "String", + "description": "Unique name of the time zone for which the opening hours are defined", + "html_description": "Unique name of the time zone for which the opening hours are defined", + "rst_description": "Unique name of the time zone for which the opening hours are defined\n", + "name": "time_zone_name", + "required": true + }, + { + "type": "Array of BusinessOpeningHoursInterval", + "description": "List of time intervals describing business opening hours", + "html_description": "List of time intervals describing business opening hours", + "rst_description": "List of time intervals describing business opening hours\n", + "name": "opening_hours", + "required": true + } + ], + "category": "types" + }, { "anchor": "chatlocation", "name": "ChatLocation", @@ -5941,6 +6767,98 @@ ], "category": "types" }, + { + "anchor": "businessconnection", + "name": "BusinessConnection", + "description": "Describes the connection of the bot with a business account.", + "html_description": "

Describes the connection of the bot with a business account.

", + "rst_description": "Describes the connection of the bot with a business account.", + "annotations": [ + { + "type": "String", + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "id", + "required": true + }, + { + "type": "User", + "description": "Business account user that created the business connection", + "html_description": "Business account user that created the business connection", + "rst_description": "Business account user that created the business connection\n", + "name": "user", + "required": true + }, + { + "type": "Integer", + "description": "Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.", + "html_description": "Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.", + "rst_description": "Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.\n", + "name": "user_chat_id", + "required": true + }, + { + "type": "Integer", + "description": "Date the connection was established in Unix time", + "html_description": "Date the connection was established in Unix time", + "rst_description": "Date the connection was established in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Boolean", + "description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", + "html_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", + "rst_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours\n", + "name": "can_reply", + "required": true + }, + { + "type": "Boolean", + "description": "True, if the connection is active", + "html_description": "True, if the connection is active", + "rst_description": "True, if the connection is active\n", + "name": "is_enabled", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "businessmessagesdeleted", + "name": "BusinessMessagesDeleted", + "description": "This object is received when messages are deleted from a connected business account.", + "html_description": "

This object is received when messages are deleted from a connected business account.

", + "rst_description": "This object is received when messages are deleted from a connected business account.", + "annotations": [ + { + "type": "String", + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id", + "required": true + }, + { + "type": "Chat", + "description": "Information about a chat in the business account. The bot may not have access to the chat or the corresponding user.", + "html_description": "Information about a chat in the business account. The bot may not have access to the chat or the corresponding user.", + "rst_description": "Information about a chat in the business account. The bot may not have access to the chat or the corresponding user.\n", + "name": "chat", + "required": true + }, + { + "type": "Array of Integer", + "description": "The list of identifiers of deleted messages in the chat of the business account", + "html_description": "The list of identifiers of deleted messages in the chat of the business account", + "rst_description": "The list of identifiers of deleted messages in the chat of the business account\n", + "name": "message_ids", + "required": true + } + ], + "category": "types" + }, { "anchor": "responseparameters", "name": "ResponseParameters", @@ -6023,6 +6941,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Boolean", "description": "Pass True if the photo needs to be covered with a spoiler animation", @@ -6089,6 +7015,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Video width", @@ -6187,6 +7121,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Animation width", @@ -6420,6 +7362,14 @@ "html_description": "

Use this method to send text messages. On success, the sent Message is returned.

", "rst_description": "Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -6484,6 +7434,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -6495,9 +7453,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -6595,9 +7553,9 @@ { "type": "Array of Integer", "required": true, - "description": "Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.", - "html_description": "Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.", - "rst_description": "Identifiers of 1-100 messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order.\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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.\n", "name": "message_ids" }, { @@ -6682,6 +7640,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.", + "html_description": "Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified.\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -6709,9 +7675,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -6751,9 +7717,9 @@ { "type": "Array of Integer", "required": true, - "description": "Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.", - "html_description": "Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.", - "rst_description": "Identifiers of 1-100 messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order.\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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.\n", "name": "message_ids" }, { @@ -6790,6 +7756,14 @@ "html_description": "

Use this method to send photos. On success, the sent Message is returned.

", "rst_description": "Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -6838,6 +7812,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -6862,6 +7844,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -6873,9 +7863,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -6888,6 +7878,14 @@ "html_description": "

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

For sending voice messages, use the sendVoice method instead.

", "rst_description": "Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.\nFor sending voice messages, use the :class:`aiogram.methods.send_voice.SendVoice` method instead.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -6984,6 +7982,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -6995,9 +8001,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -7010,6 +8016,14 @@ "html_description": "

Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

", "rst_description": "Use this method to send general files. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7090,6 +8104,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7101,9 +8123,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -7116,6 +8138,14 @@ "html_description": "

Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

", "rst_description": "Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7196,6 +8226,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -7228,6 +8266,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7239,9 +8285,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -7254,6 +8300,14 @@ "html_description": "

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

", "rst_description": "Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7334,6 +8388,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -7358,6 +8420,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7369,9 +8439,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -7380,10 +8450,18 @@ { "anchor": "sendvoice", "name": "sendVoice", - "description": "Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.", - "html_description": "

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

", - "rst_description": "Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.", + "description": "Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.", + "html_description": "

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

", + "rst_description": "Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7456,6 +8534,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7467,9 +8553,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -7482,6 +8568,14 @@ "html_description": "

As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.

", "rst_description": "As of `v.4.0 `_, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7546,6 +8640,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7557,9 +8659,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -7572,6 +8674,14 @@ "html_description": "

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.

", "rst_description": "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.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7612,6 +8722,14 @@ "rst_description": "Protects the contents of the sent messages from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7630,6 +8748,14 @@ "html_description": "

Use this method to send point on the map. On success, the sent Message is returned.

", "rst_description": "Use this method to send point on the map. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7673,9 +8799,9 @@ { "type": "Integer", "required": false, - "description": "Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.", - "html_description": "Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.", - "rst_description": "Period in seconds for which the location will be updated (see `Live Locations `_, should be between 60 and 86400.\n", + "description": "Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "html_description": "Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "rst_description": "Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.\n", "name": "live_period" }, { @@ -7710,6 +8836,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7721,9 +8855,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -7736,6 +8870,14 @@ "html_description": "

Use this method to send information about a venue. On success, the sent Message is returned.

", "rst_description": "Use this method to send information about a venue. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7832,6 +8974,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7843,9 +8993,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -7858,6 +9008,14 @@ "html_description": "

Use this method to send phone contacts. On success, the sent Message is returned.

", "rst_description": "Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7922,6 +9080,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7933,9 +9099,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -7948,6 +9114,14 @@ "html_description": "

Use this method to send a native poll. On success, the sent Message is returned.

", "rst_description": "Use this method to send a native poll. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -7973,11 +9147,27 @@ "name": "question" }, { - "type": "Array of String", + "type": "String", + "required": false, + "description": "Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed", + "html_description": "Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed", + "rst_description": "Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed\n", + "name": "question_parse_mode" + }, + { + "type": "Array of MessageEntity", + "required": false, + "description": "A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode", + "html_description": "A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode", + "rst_description": "A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode*\n", + "name": "question_entities" + }, + { + "type": "Array of InputPollOption", "required": true, - "description": "A JSON-serialized list of answer options, 2-10 strings 1-100 characters each", - "html_description": "A JSON-serialized list of answer options, 2-10 strings 1-100 characters each", - "rst_description": "A JSON-serialized list of answer options, 2-10 strings 1-100 characters each\n", + "description": "A JSON-serialized list of 2-10 answer options", + "html_description": "A JSON-serialized list of 2-10 answer options", + "rst_description": "A JSON-serialized list of 2-10 answer options\n", "name": "options" }, { @@ -8031,9 +9221,9 @@ { "type": "Array of MessageEntity", "required": false, - "description": "A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode", - "html_description": "A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode", - "rst_description": "A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*\n", + "description": "A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode", + "html_description": "A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode", + "rst_description": "A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode*\n", "name": "explanation_entities" }, { @@ -8076,6 +9266,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8087,9 +9285,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -8102,6 +9300,14 @@ "html_description": "

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

", "rst_description": "Use this method to send an animated emoji that will display a random value. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -8142,6 +9348,14 @@ "rst_description": "Protects the contents of the sent message from forwarding\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8153,9 +9367,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -8168,6 +9382,14 @@ "html_description": "

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.

\n

Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.

\n

We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

", "rst_description": "Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns :code:`True` on success.\n\n Example: The `ImageBot `_ needs some time to process a request and upload the image. Instead of sending a text message along the lines of 'Retrieving image, please wait…', the bot may use :class:`aiogram.methods.send_chat_action.SendChatAction` with *action* = *upload_photo*. The user will see a 'sending photo' status for the bot.\n\nWe only recommend using this method when a response from the bot will take a **noticeable** amount of time to arrive.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the action will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the action will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the action will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -8179,9 +9401,9 @@ { "type": "Integer", "required": false, - "description": "Unique identifier for the target message thread; supergroups only", - "html_description": "Unique identifier for the target message thread; supergroups only", - "rst_description": "Unique identifier for the target message thread; supergroups only\n", + "description": "Unique identifier for the target message thread; for supergroups only", + "html_description": "Unique identifier for the target message thread; for supergroups only", + "rst_description": "Unique identifier for the target message thread; for supergroups only\n", "name": "message_thread_id" }, { @@ -8221,9 +9443,9 @@ { "type": "Array of ReactionType", "required": false, - "description": "New 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.", - "html_description": "New 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.", - "rst_description": "New 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.\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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.\n", "name": "reaction" }, { @@ -8513,9 +9735,9 @@ { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can edit stories posted by other users", - "html_description": "Pass True if the administrator can edit stories posted by other users", - "rst_description": "Pass :code:`True` if the administrator can edit stories posted by other users\n", + "description": "Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "html_description": "Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "rst_description": "Pass :code:`True` if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive\n", "name": "can_edit_stories" }, { @@ -8529,33 +9751,33 @@ { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", - "html_description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", - "rst_description": "Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only\n", + "description": "Pass True if the administrator can post messages in the channel, or access channel statistics; for channels only", + "html_description": "Pass True if the administrator can post messages in the channel, or access channel statistics; for channels only", + "rst_description": "Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; for channels only\n", "name": "can_post_messages" }, { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", - "html_description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", - "rst_description": "Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only\n", + "description": "Pass True if the administrator can edit messages of other users and can pin messages; for channels only", + "html_description": "Pass True if the administrator can edit messages of other users and can pin messages; for channels only", + "rst_description": "Pass :code:`True` if the administrator can edit messages of other users and can pin messages; for channels only\n", "name": "can_edit_messages" }, { "type": "Boolean", "required": false, - "description": "Pass True if the administrator can pin messages, supergroups only", - "html_description": "Pass True if the administrator can pin messages, supergroups only", - "rst_description": "Pass :code:`True` if the administrator can pin messages, supergroups only\n", + "description": "Pass True if the administrator can pin messages; for supergroups only", + "html_description": "Pass True if the administrator can pin messages; for supergroups only", + "rst_description": "Pass :code:`True` if the administrator can pin messages; for supergroups only\n", "name": "can_pin_messages" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only", - "html_description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only", - "rst_description": "Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only\n", + "description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "html_description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "rst_description": "Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only\n", "name": "can_manage_topics" } ], @@ -9080,9 +10302,9 @@ { "anchor": "getchat", "name": "getChat", - "description": "Use this method to get up to date information about the chat. Returns a Chat object on success.", - "html_description": "

Use this method to get up to date information about the chat. Returns a Chat object on success.

", - "rst_description": "Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success.", + "description": "Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.", + "html_description": "

Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.

", + "rst_description": "Use this method to get up-to-date information about the chat. Returns a :class:`aiogram.types.chat_full_info.ChatFullInfo` object on success.", "annotations": [ { "type": "Integer or String", @@ -9590,6 +10812,24 @@ ], "category": "methods" }, + { + "anchor": "getbusinessconnection", + "name": "getBusinessConnection", + "description": "Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.", + "html_description": "

Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.

", + "rst_description": "Use this method to get information about the connection of the bot with a business account. Returns a :class:`aiogram.types.business_connection.BusinessConnection` object on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + } + ], + "category": "methods" + }, { "anchor": "setmycommands", "name": "setMyCommands", @@ -10032,6 +11272,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.", + "html_description": "Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages.\n", + "name": "show_caption_above_media" + }, { "type": "InlineKeyboardMarkup", "required": false, @@ -10140,6 +11388,14 @@ "rst_description": "Longitude of new location\n", "name": "longitude" }, + { + "type": "Integer", + "required": false, + "description": "New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged", + "html_description": "New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged", + "rst_description": "New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current *live_period* by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then *live_period* remains unchanged\n", + "name": "live_period" + }, { "type": "Float", "required": false, @@ -10337,9 +11593,9 @@ { "type": "Array of Integer", "required": true, - "description": "Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted", - "html_description": "Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted", - "rst_description": "Identifiers of 1-100 messages to delete. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted\n", + "description": "A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted", + "html_description": "A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted", + "rst_description": "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\n", "name": "message_ids" } ], @@ -10513,22 +11769,6 @@ "name": "sticker_type", "required": true }, - { - "type": "Boolean", - "description": "True, if the sticker set contains animated stickers", - "html_description": "True, if the sticker set contains animated stickers", - "rst_description": ":code:`True`, if the sticker set contains `animated stickers `_\n", - "name": "is_animated", - "required": true - }, - { - "type": "Boolean", - "description": "True, if the sticker set contains video stickers", - "html_description": "True, if the sticker set contains video stickers", - "rst_description": ":code:`True`, if the sticker set contains `video stickers `_\n", - "name": "is_video", - "required": true - }, { "type": "Array of Sticker", "description": "List of all set stickers", @@ -10605,6 +11845,14 @@ "name": "sticker", "required": true }, + { + "type": "String", + "description": "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", + "html_description": "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", + "rst_description": "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\n", + "name": "format", + "required": true + }, { "type": "Array of String", "description": "List of 1-20 emoji associated with the sticker", @@ -10639,6 +11887,14 @@ "html_description": "

Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.

", "rst_description": "Use this method to send static .WEBP, `animated `_ .TGS, or `video `_ .WEBM stickers. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer or String", "required": true, @@ -10658,9 +11914,9 @@ { "type": "InputFile or String", "required": true, - "description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. More information on Sending Files. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.", - "html_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. More information on Sending Files ». Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.", - "rst_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.\n", + "description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files. Video and animated stickers can't be sent via an HTTP URL.", + "html_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files ». Video and animated stickers can't be sent via an HTTP URL.", + "rst_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL.\n", "name": "sticker" }, { @@ -10687,6 +11943,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -10698,9 +11962,9 @@ { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "required": false, - "description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", - "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", + "description": "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", + "html_description": "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", + "rst_description": "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\n", "name": "reply_markup" } ], @@ -10734,9 +11998,9 @@ { "type": "Array of String", "required": true, - "description": "List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.", - "html_description": "List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.", - "rst_description": "List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.\n", + "description": "A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.", + "html_description": "A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.", + "rst_description": "A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.\n", "name": "custom_emoji_ids" } ], @@ -10745,9 +12009,9 @@ { "anchor": "uploadstickerfile", "name": "uploadStickerFile", - "description": "Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times). Returns the uploaded File on success.", - "html_description": "

Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times). Returns the uploaded File on success.

", - "rst_description": "Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet` and :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.", + "description": "Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.", + "html_description": "

Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.

", + "rst_description": "Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet`, :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, or :class:`aiogram.methods.replace_sticker_in_set.ReplaceStickerInSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.", "annotations": [ { "type": "Integer", @@ -10815,14 +12079,6 @@ "rst_description": "A JSON-serialized list of 1-50 initial stickers to be added to the sticker set\n", "name": "stickers" }, - { - "type": "String", - "required": true, - "description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'", - "html_description": "Format of stickers in the set, must be one of “static”, “animated”, “video”", - "rst_description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'\n", - "name": "sticker_format" - }, { "type": "String", "required": false, @@ -10845,9 +12101,9 @@ { "anchor": "addstickertoset", "name": "addStickerToSet", - "description": "Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.", - "html_description": "

Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.

", - "rst_description": "Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success.", + "description": "Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.", + "html_description": "

Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.

", + "rst_description": "Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns :code:`True` on success.", "annotations": [ { "type": "Integer", @@ -10920,6 +12176,48 @@ ], "category": "methods" }, + { + "anchor": "replacestickerinset", + "name": "replaceStickerInSet", + "description": "Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.", + "html_description": "

Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.

", + "rst_description": "Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling :class:`aiogram.methods.delete_sticker_from_set.DeleteStickerFromSet`, then :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, then :class:`aiogram.methods.set_sticker_position_in_set.SetStickerPositionInSet`. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer", + "required": true, + "description": "User identifier of the sticker set owner", + "html_description": "User identifier of the sticker set owner", + "rst_description": "User identifier of the sticker set owner\n", + "name": "user_id" + }, + { + "type": "String", + "required": true, + "description": "Sticker set name", + "html_description": "Sticker set name", + "rst_description": "Sticker set name\n", + "name": "name" + }, + { + "type": "String", + "required": true, + "description": "File identifier of the replaced sticker", + "html_description": "File identifier of the replaced sticker", + "rst_description": "File identifier of the replaced sticker\n", + "name": "old_sticker" + }, + { + "type": "InputSticker", + "required": true, + "description": "A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.", + "html_description": "A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.", + "rst_description": "A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.\n", + "name": "sticker" + } + ], + "category": "methods" + }, { "anchor": "setstickeremojilist", "name": "setStickerEmojiList", @@ -11054,6 +12352,14 @@ "html_description": "A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. 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, or upload a new one using multipart/form-data. More information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.", "rst_description": "A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animated-sticker-requirements `_`https://core.telegram.org/stickers#animated-sticker-requirements `_ for animated sticker technical requirements), or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements `_`https://core.telegram.org/stickers#video-sticker-requirements `_ for video sticker technical requirements. 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, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.\n", "name": "thumbnail" + }, + { + "type": "String", + "required": true, + "description": "Format of the thumbnail, must be one of 'static' for a .WEBP or .PNG image, 'animated' for a .TGS animation, or 'video' for a WEBM video", + "html_description": "Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a WEBM video", + "rst_description": "Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **WEBM** video\n", + "name": "format" } ], "category": "methods" @@ -11461,6 +12767,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -11583,6 +12897,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -11705,6 +13027,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -11803,6 +13133,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Video width", @@ -12221,9 +13559,9 @@ }, { "type": "Integer", - "description": "Period in seconds for which the location can be updated, should be between 60 and 86400.", - "html_description": "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.", - "rst_description": "*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400.\n", + "description": "Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "html_description": "Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "rst_description": "*Optional*. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.\n", "name": "live_period", "required": false }, @@ -12627,6 +13965,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -12709,6 +14055,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -12791,6 +14145,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -13021,6 +14383,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -13280,9 +14650,9 @@ }, { "type": "Integer", - "description": "Period in seconds for which the location can be updated, should be between 60 and 86400.", - "html_description": "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.", - "rst_description": "*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400.\n", + "description": "Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "html_description": "Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "rst_description": "*Optional*. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.\n", "name": "live_period", "required": false }, @@ -13454,33 +14824,33 @@ }, { "type": "String", - "description": "Payment provider token, obtained via @BotFather", - "html_description": "Payment provider token, obtained via @BotFather", - "rst_description": "Payment provider token, obtained via `@BotFather `_\n", + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "*Optional*. Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token", - "required": true + "required": false }, { "type": "String", - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency", "required": true }, { "type": "Array of LabeledPrice", - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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 `_.\n", "name": "prices", "required": true }, { "type": "Integer", - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "html_description": "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 US$ 1.45 pass 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", - "rst_description": "*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\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "html_description": "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 US$ 1.45 pass 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.", + "rst_description": "*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 `_.\n", "name": "max_tip_amount", "required": false }, @@ -13534,57 +14904,57 @@ }, { "type": "Boolean", - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Optional. Pass True if you require the user's full name to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Optional. Pass True if you require the user's phone number to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Optional. Pass True if you require the user's email address to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Optional. Pass True if you require the user's shipping address to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address", "required": false }, { "type": "Boolean", - "description": "Pass True if the user's phone number should be sent to provider", - "html_description": "Optional. Pass True if the user's phone number should be sent to provider", - "rst_description": "*Optional*. Pass :code:`True` if the user's phone number should be sent to provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider", "required": false }, { "type": "Boolean", - "description": "Pass True if the user's email address should be sent to provider", - "html_description": "Optional. Pass True if the user's email address should be sent to provider", - "rst_description": "*Optional*. Pass :code:`True` if the user's email address should be sent to provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider", "required": false }, { "type": "Boolean", - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Optional. Pass True if the final price depends on the shipping method", - "rst_description": "*Optional*. Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible", "required": false } @@ -13741,34 +15111,34 @@ }, { "type": "String", - "required": true, - "description": "Payment provider token, obtained via @BotFather", - "html_description": "Payment provider token, obtained via @BotFather", - "rst_description": "Payment provider token, obtained via `@BotFather `_\n", + "required": false, + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token" }, { "type": "String", "required": true, - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency" }, { "type": "Array of LabeledPrice", "required": true, - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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 `_.\n", "name": "prices" }, { "type": "Integer", "required": false, - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "rst_description": "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\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "rst_description": "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 `_.\n", "name": "max_tip_amount" }, { @@ -13830,57 +15200,57 @@ { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Pass True if you require the user's full name to complete the order", - "rst_description": "Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Pass True if you require the user's phone number to complete the order", - "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Pass True if you require the user's email address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Pass True if you require the user's shipping address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's phone number should be sent to provider", - "html_description": "Pass True if the user's phone number should be sent to provider", - "rst_description": "Pass :code:`True` if the user's phone number should be sent to provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's email address should be sent to provider", - "html_description": "Pass True if the user's email address should be sent to provider", - "rst_description": "Pass :code:`True` if the user's email address should be sent to provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Pass True if the final price depends on the shipping method", - "rst_description": "Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible" }, { @@ -13899,6 +15269,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -13951,34 +15329,34 @@ }, { "type": "String", - "required": true, - "description": "Payment provider token, obtained via BotFather", - "html_description": "Payment provider token, obtained via BotFather", - "rst_description": "Payment provider token, obtained via `BotFather `_\n", + "required": false, + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token" }, { "type": "String", "required": true, - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency" }, { "type": "Array of LabeledPrice", "required": true, - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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 `_.\n", "name": "prices" }, { "type": "Integer", "required": false, - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "rst_description": "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\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "rst_description": "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 `_.\n", "name": "max_tip_amount" }, { @@ -14032,57 +15410,57 @@ { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Pass True if you require the user's full name to complete the order", - "rst_description": "Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Pass True if you require the user's phone number to complete the order", - "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Pass True if you require the user's email address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Pass True if you require the user's shipping address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's phone number should be sent to the provider", - "html_description": "Pass True if the user's phone number should be sent to the provider", - "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's email address should be sent to the provider", - "html_description": "Pass True if the user's email address should be sent to the provider", - "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Pass True if the final price depends on the shipping method", - "rst_description": "Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible" } ], @@ -14164,6 +15542,32 @@ ], "category": "methods" }, + { + "anchor": "refundstarpayment", + "name": "refundStarPayment", + "description": "Refunds a successful payment in Telegram Stars. Returns True on success.", + "html_description": "

Refunds a successful payment in Telegram Stars. Returns True on success.

", + "rst_description": "Refunds a successful payment in `Telegram Stars `_. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer", + "required": true, + "description": "Identifier of the user whose payment will be refunded", + "html_description": "Identifier of the user whose payment will be refunded", + "rst_description": "Identifier of the user whose payment will be refunded\n", + "name": "user_id" + }, + { + "type": "String", + "required": true, + "description": "Telegram payment identifier", + "html_description": "Telegram payment identifier", + "rst_description": "Telegram payment identifier\n", + "name": "telegram_payment_charge_id" + } + ], + "category": "methods" + }, { "anchor": "labeledprice", "name": "LabeledPrice", @@ -14223,9 +15627,9 @@ }, { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, @@ -14383,9 +15787,9 @@ "annotations": [ { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, @@ -14507,9 +15911,9 @@ }, { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, @@ -14640,65 +16044,65 @@ }, { "type": "String", - "description": "Base64-encoded encrypted Telegram Passport element data provided by the user, available for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Base64-encoded encrypted Telegram Passport element data provided by the user, available for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.\n", + "description": "Base64-encoded encrypted Telegram Passport element data provided by the user; available only for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying EncryptedCredentials.", + "html_description": "Optional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.", + "rst_description": "*Optional*. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.\n", "name": "data", "required": false }, { "type": "String", - "description": "User's verified phone number, available only for 'phone_number' type", - "html_description": "Optional. User's verified phone number, available only for “phone_number” type", - "rst_description": "*Optional*. User's verified phone number, available only for 'phone_number' type\n", + "description": "User's verified phone number; available only for 'phone_number' type", + "html_description": "Optional. User's verified phone number; available only for “phone_number” type", + "rst_description": "*Optional*. User's verified phone number; available only for 'phone_number' type\n", "name": "phone_number", "required": false }, { "type": "String", - "description": "User's verified email address, available only for 'email' type", - "html_description": "Optional. User's verified email address, available only for “email” type", - "rst_description": "*Optional*. User's verified email address, available only for 'email' type\n", + "description": "User's verified email address; available only for 'email' type", + "html_description": "Optional. User's verified email address; available only for “email” type", + "rst_description": "*Optional*. User's verified email address; available only for 'email' type\n", "name": "email", "required": false }, { "type": "Array of PassportFile", - "description": "Array of encrypted files with documents provided by the user, available for 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' types. Files can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Array of encrypted files with documents provided by the user, available 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`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "files", "required": false }, { "type": "PassportFile", - "description": "Encrypted file with the front side of the document, provided by the user. Available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Encrypted file with the front side of the document, provided by the user. Available 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`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "front_side", "required": false }, { "type": "PassportFile", - "description": "Encrypted file with the reverse side of the document, provided by the user. Available for 'driver_license' and 'identity_card'. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Encrypted file with the reverse side of the document, provided by the user. Available for 'driver_license' and 'identity_card'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "reverse_side", "required": false }, { "type": "PassportFile", - "description": "Encrypted file with the selfie of the user holding a document, provided by the user; available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Encrypted file with the selfie of the user holding a document, provided by the user; available 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`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "selfie", "required": false }, { "type": "Array of PassportFile", - "description": "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 EncryptedCredentials.", - "html_description": "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 EncryptedCredentials.", - "rst_description": "*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`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "translation", "required": false }, @@ -15182,6 +16586,14 @@ "html_description": "

Use this method to send a game. On success, the sent Message is returned.

", "rst_description": "Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ + { + "type": "String", + "required": false, + "description": "Unique identifier of the business connection on behalf of which the message will be sent", + "html_description": "Unique identifier of the business connection on behalf of which the message will be sent", + "rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n", + "name": "business_connection_id" + }, { "type": "Integer", "required": true, @@ -15222,6 +16634,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/types/BackgroundFill/entity.json b/.butcher/types/BackgroundFill/entity.json new file mode 100644 index 00000000..90ca7d49 --- /dev/null +++ b/.butcher/types/BackgroundFill/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "backgroundfill", + "name": "BackgroundFill", + "description": "This object describes the way a background is filled based on the selected colors. Currently, it can be one of\n - BackgroundFillSolid\n - BackgroundFillGradient\n - BackgroundFillFreeformGradient", + "html_description": "

This object describes the way a background is filled based on the selected colors. Currently, it can be one of

", + "rst_description": "This object describes the way a background is filled based on the selected colors. Currently, it can be one of\n\n - :class:`aiogram.types.background_fill_solid.BackgroundFillSolid`\n - :class:`aiogram.types.background_fill_gradient.BackgroundFillGradient`\n - :class:`aiogram.types.background_fill_freeform_gradient.BackgroundFillFreeformGradient`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/BackgroundFill/subtypes.yml b/.butcher/types/BackgroundFill/subtypes.yml new file mode 100644 index 00000000..6756ad51 --- /dev/null +++ b/.butcher/types/BackgroundFill/subtypes.yml @@ -0,0 +1 @@ +discriminator: "type" diff --git a/.butcher/types/BackgroundFillFreeformGradient/entity.json b/.butcher/types/BackgroundFillFreeformGradient/entity.json new file mode 100644 index 00000000..fda187cc --- /dev/null +++ b/.butcher/types/BackgroundFillFreeformGradient/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "backgroundfillfreeformgradient", + "name": "BackgroundFillFreeformGradient", + "description": "The background is a freeform gradient that rotates after every message in the chat.", + "html_description": "

The background is a freeform gradient that rotates after every message in the chat.

", + "rst_description": "The background is a freeform gradient that rotates after every message in the chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the background fill, always 'freeform_gradient'", + "html_description": "Type of the background fill, always “freeform_gradient”", + "rst_description": "Type of the background fill, always 'freeform_gradient'\n", + "name": "type", + "required": true + }, + { + "type": "Array of Integer", + "description": "A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format", + "html_description": "A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format", + "rst_description": "A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format\n", + "name": "colors", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BackgroundFillGradient/entity.json b/.butcher/types/BackgroundFillGradient/entity.json new file mode 100644 index 00000000..1c2ba94d --- /dev/null +++ b/.butcher/types/BackgroundFillGradient/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "backgroundfillgradient", + "name": "BackgroundFillGradient", + "description": "The background is a gradient fill.", + "html_description": "

The background is a gradient fill.

", + "rst_description": "The background is a gradient fill.", + "annotations": [ + { + "type": "String", + "description": "Type of the background fill, always 'gradient'", + "html_description": "Type of the background fill, always “gradient”", + "rst_description": "Type of the background fill, always 'gradient'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Top color of the gradient in the RGB24 format", + "html_description": "Top color of the gradient in the RGB24 format", + "rst_description": "Top color of the gradient in the RGB24 format\n", + "name": "top_color", + "required": true + }, + { + "type": "Integer", + "description": "Bottom color of the gradient in the RGB24 format", + "html_description": "Bottom color of the gradient in the RGB24 format", + "rst_description": "Bottom color of the gradient in the RGB24 format\n", + "name": "bottom_color", + "required": true + }, + { + "type": "Integer", + "description": "Clockwise rotation angle of the background fill in degrees; 0-359", + "html_description": "Clockwise rotation angle of the background fill in degrees; 0-359", + "rst_description": "Clockwise rotation angle of the background fill in degrees; 0-359\n", + "name": "rotation_angle", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BackgroundFillSolid/entity.json b/.butcher/types/BackgroundFillSolid/entity.json new file mode 100644 index 00000000..9cea62b2 --- /dev/null +++ b/.butcher/types/BackgroundFillSolid/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "backgroundfillsolid", + "name": "BackgroundFillSolid", + "description": "The background is filled using the selected color.", + "html_description": "

The background is filled using the selected color.

", + "rst_description": "The background is filled using the selected color.", + "annotations": [ + { + "type": "String", + "description": "Type of the background fill, always 'solid'", + "html_description": "Type of the background fill, always “solid”", + "rst_description": "Type of the background fill, always 'solid'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "The color of the background fill in the RGB24 format", + "html_description": "The color of the background fill in the RGB24 format", + "rst_description": "The color of the background fill in the RGB24 format\n", + "name": "color", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BackgroundType/entity.json b/.butcher/types/BackgroundType/entity.json new file mode 100644 index 00000000..897450be --- /dev/null +++ b/.butcher/types/BackgroundType/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "backgroundtype", + "name": "BackgroundType", + "description": "This object describes the type of a background. Currently, it can be one of\n - BackgroundTypeFill\n - BackgroundTypeWallpaper\n - BackgroundTypePattern\n - BackgroundTypeChatTheme", + "html_description": "

This object describes the type of a background. Currently, it can be one of

", + "rst_description": "This object describes the type of a background. Currently, it can be one of\n\n - :class:`aiogram.types.background_type_fill.BackgroundTypeFill`\n - :class:`aiogram.types.background_type_wallpaper.BackgroundTypeWallpaper`\n - :class:`aiogram.types.background_type_pattern.BackgroundTypePattern`\n - :class:`aiogram.types.background_type_chat_theme.BackgroundTypeChatTheme`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/BackgroundType/subtypes.yml b/.butcher/types/BackgroundType/subtypes.yml new file mode 100644 index 00000000..6756ad51 --- /dev/null +++ b/.butcher/types/BackgroundType/subtypes.yml @@ -0,0 +1 @@ +discriminator: "type" diff --git a/.butcher/types/BackgroundTypeChatTheme/entity.json b/.butcher/types/BackgroundTypeChatTheme/entity.json new file mode 100644 index 00000000..1c29be7c --- /dev/null +++ b/.butcher/types/BackgroundTypeChatTheme/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "backgroundtypechattheme", + "name": "BackgroundTypeChatTheme", + "description": "The background is taken directly from a built-in chat theme.", + "html_description": "

The background is taken directly from a built-in chat theme.

", + "rst_description": "The background is taken directly from a built-in chat theme.", + "annotations": [ + { + "type": "String", + "description": "Type of the background, always 'chat_theme'", + "html_description": "Type of the background, always “chat_theme”", + "rst_description": "Type of the background, always 'chat_theme'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Name of the chat theme, which is usually an emoji", + "html_description": "Name of the chat theme, which is usually an emoji", + "rst_description": "Name of the chat theme, which is usually an emoji\n", + "name": "theme_name", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BackgroundTypeFill/entity.json b/.butcher/types/BackgroundTypeFill/entity.json new file mode 100644 index 00000000..c506702d --- /dev/null +++ b/.butcher/types/BackgroundTypeFill/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "backgroundtypefill", + "name": "BackgroundTypeFill", + "description": "The background is automatically filled based on the selected colors.", + "html_description": "

The background is automatically filled based on the selected colors.

", + "rst_description": "The background is automatically filled based on the selected colors.", + "annotations": [ + { + "type": "String", + "description": "Type of the background, always 'fill'", + "html_description": "Type of the background, always “fill”", + "rst_description": "Type of the background, always 'fill'\n", + "name": "type", + "required": true + }, + { + "type": "BackgroundFill", + "description": "The background fill", + "html_description": "The background fill", + "rst_description": "The background fill\n", + "name": "fill", + "required": true + }, + { + "type": "Integer", + "description": "Dimming of the background in dark themes, as a percentage; 0-100", + "html_description": "Dimming of the background in dark themes, as a percentage; 0-100", + "rst_description": "Dimming of the background in dark themes, as a percentage; 0-100\n", + "name": "dark_theme_dimming", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BackgroundTypePattern/entity.json b/.butcher/types/BackgroundTypePattern/entity.json new file mode 100644 index 00000000..1f286b9f --- /dev/null +++ b/.butcher/types/BackgroundTypePattern/entity.json @@ -0,0 +1,65 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "backgroundtypepattern", + "name": "BackgroundTypePattern", + "description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.", + "html_description": "

The background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.

", + "rst_description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.", + "annotations": [ + { + "type": "String", + "description": "Type of the background, always 'pattern'", + "html_description": "Type of the background, always “pattern”", + "rst_description": "Type of the background, always 'pattern'\n", + "name": "type", + "required": true + }, + { + "type": "Document", + "description": "Document with the pattern", + "html_description": "Document with the pattern", + "rst_description": "Document with the pattern\n", + "name": "document", + "required": true + }, + { + "type": "BackgroundFill", + "description": "The background fill that is combined with the pattern", + "html_description": "The background fill that is combined with the pattern", + "rst_description": "The background fill that is combined with the pattern\n", + "name": "fill", + "required": true + }, + { + "type": "Integer", + "description": "Intensity of the pattern when it is shown above the filled background; 0-100", + "html_description": "Intensity of the pattern when it is shown above the filled background; 0-100", + "rst_description": "Intensity of the pattern when it is shown above the filled background; 0-100\n", + "name": "intensity", + "required": true + }, + { + "type": "True", + "description": "True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only", + "html_description": "Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only", + "rst_description": "*Optional*. :code:`True`, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only\n", + "name": "is_inverted", + "required": false + }, + { + "type": "True", + "description": "True, if the background moves slightly when the device is tilted", + "html_description": "Optional. True, if the background moves slightly when the device is tilted", + "rst_description": "*Optional*. :code:`True`, if the background moves slightly when the device is tilted\n", + "name": "is_moving", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BackgroundTypeWallpaper/entity.json b/.butcher/types/BackgroundTypeWallpaper/entity.json new file mode 100644 index 00000000..85b89982 --- /dev/null +++ b/.butcher/types/BackgroundTypeWallpaper/entity.json @@ -0,0 +1,57 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "backgroundtypewallpaper", + "name": "BackgroundTypeWallpaper", + "description": "The background is a wallpaper in the JPEG format.", + "html_description": "

The background is a wallpaper in the JPEG format.

", + "rst_description": "The background is a wallpaper in the JPEG format.", + "annotations": [ + { + "type": "String", + "description": "Type of the background, always 'wallpaper'", + "html_description": "Type of the background, always “wallpaper”", + "rst_description": "Type of the background, always 'wallpaper'\n", + "name": "type", + "required": true + }, + { + "type": "Document", + "description": "Document with the wallpaper", + "html_description": "Document with the wallpaper", + "rst_description": "Document with the wallpaper\n", + "name": "document", + "required": true + }, + { + "type": "Integer", + "description": "Dimming of the background in dark themes, as a percentage; 0-100", + "html_description": "Dimming of the background in dark themes, as a percentage; 0-100", + "rst_description": "Dimming of the background in dark themes, as a percentage; 0-100\n", + "name": "dark_theme_dimming", + "required": true + }, + { + "type": "True", + "description": "True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12", + "html_description": "Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12", + "rst_description": "*Optional*. :code:`True`, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12\n", + "name": "is_blurred", + "required": false + }, + { + "type": "True", + "description": "True, if the background moves slightly when the device is tilted", + "html_description": "Optional. True, if the background moves slightly when the device is tilted", + "rst_description": "*Optional*. :code:`True`, if the background moves slightly when the device is tilted\n", + "name": "is_moving", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/Birthdate/entity.json b/.butcher/types/Birthdate/entity.json new file mode 100644 index 00000000..0be28d72 --- /dev/null +++ b/.butcher/types/Birthdate/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "birthdate", + "name": "Birthdate", + "description": "Describes the birthdate of a user.", + "html_description": "

Describes the birthdate of a user.

", + "rst_description": "Describes the birthdate of a user.", + "annotations": [ + { + "type": "Integer", + "description": "Day of the user's birth; 1-31", + "html_description": "Day of the user's birth; 1-31", + "rst_description": "Day of the user's birth; 1-31\n", + "name": "day", + "required": true + }, + { + "type": "Integer", + "description": "Month of the user's birth; 1-12", + "html_description": "Month of the user's birth; 1-12", + "rst_description": "Month of the user's birth; 1-12\n", + "name": "month", + "required": true + }, + { + "type": "Integer", + "description": "Year of the user's birth", + "html_description": "Optional. Year of the user's birth", + "rst_description": "*Optional*. Year of the user's birth\n", + "name": "year", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BusinessConnection/entity.json b/.butcher/types/BusinessConnection/entity.json new file mode 100644 index 00000000..09b9a0ef --- /dev/null +++ b/.butcher/types/BusinessConnection/entity.json @@ -0,0 +1,65 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "businessconnection", + "name": "BusinessConnection", + "description": "Describes the connection of the bot with a business account.", + "html_description": "

Describes the connection of the bot with a business account.

", + "rst_description": "Describes the connection of the bot with a business account.", + "annotations": [ + { + "type": "String", + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "id", + "required": true + }, + { + "type": "User", + "description": "Business account user that created the business connection", + "html_description": "Business account user that created the business connection", + "rst_description": "Business account user that created the business connection\n", + "name": "user", + "required": true + }, + { + "type": "Integer", + "description": "Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.", + "html_description": "Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.", + "rst_description": "Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.\n", + "name": "user_chat_id", + "required": true + }, + { + "type": "Integer", + "description": "Date the connection was established in Unix time", + "html_description": "Date the connection was established in Unix time", + "rst_description": "Date the connection was established in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Boolean", + "description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", + "html_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", + "rst_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours\n", + "name": "can_reply", + "required": true + }, + { + "type": "Boolean", + "description": "True, if the connection is active", + "html_description": "True, if the connection is active", + "rst_description": "True, if the connection is active\n", + "name": "is_enabled", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BusinessConnection/replace.yml b/.butcher/types/BusinessConnection/replace.yml new file mode 100644 index 00000000..80c48d76 --- /dev/null +++ b/.butcher/types/BusinessConnection/replace.yml @@ -0,0 +1,5 @@ +annotations: + date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/BusinessIntro/entity.json b/.butcher/types/BusinessIntro/entity.json new file mode 100644 index 00000000..8aa85394 --- /dev/null +++ b/.butcher/types/BusinessIntro/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "businessintro", + "name": "BusinessIntro", + "description": "Contains information about the start page settings of a Telegram Business account.", + "html_description": "

Contains information about the start page settings of a Telegram Business account.

", + "rst_description": "Contains information about the start page settings of a Telegram Business account.", + "annotations": [ + { + "type": "String", + "description": "Title text of the business intro", + "html_description": "Optional. Title text of the business intro", + "rst_description": "*Optional*. Title text of the business intro\n", + "name": "title", + "required": false + }, + { + "type": "String", + "description": "Message text of the business intro", + "html_description": "Optional. Message text of the business intro", + "rst_description": "*Optional*. Message text of the business intro\n", + "name": "message", + "required": false + }, + { + "type": "Sticker", + "description": "Sticker of the business intro", + "html_description": "Optional. Sticker of the business intro", + "rst_description": "*Optional*. Sticker of the business intro\n", + "name": "sticker", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BusinessLocation/entity.json b/.butcher/types/BusinessLocation/entity.json new file mode 100644 index 00000000..d38d713b --- /dev/null +++ b/.butcher/types/BusinessLocation/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "businesslocation", + "name": "BusinessLocation", + "description": "Contains information about the location of a Telegram Business account.", + "html_description": "

Contains information about the location of a Telegram Business account.

", + "rst_description": "Contains information about the location of a Telegram Business account.", + "annotations": [ + { + "type": "String", + "description": "Address of the business", + "html_description": "Address of the business", + "rst_description": "Address of the business\n", + "name": "address", + "required": true + }, + { + "type": "Location", + "description": "Location of the business", + "html_description": "Optional. Location of the business", + "rst_description": "*Optional*. Location of the business\n", + "name": "location", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BusinessMessagesDeleted/entity.json b/.butcher/types/BusinessMessagesDeleted/entity.json new file mode 100644 index 00000000..4a990c13 --- /dev/null +++ b/.butcher/types/BusinessMessagesDeleted/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "businessmessagesdeleted", + "name": "BusinessMessagesDeleted", + "description": "This object is received when messages are deleted from a connected business account.", + "html_description": "

This object is received when messages are deleted from a connected business account.

", + "rst_description": "This object is received when messages are deleted from a connected business account.", + "annotations": [ + { + "type": "String", + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id", + "required": true + }, + { + "type": "Chat", + "description": "Information about a chat in the business account. The bot may not have access to the chat or the corresponding user.", + "html_description": "Information about a chat in the business account. The bot may not have access to the chat or the corresponding user.", + "rst_description": "Information about a chat in the business account. The bot may not have access to the chat or the corresponding user.\n", + "name": "chat", + "required": true + }, + { + "type": "Array of Integer", + "description": "The list of identifiers of deleted messages in the chat of the business account", + "html_description": "The list of identifiers of deleted messages in the chat of the business account", + "rst_description": "The list of identifiers of deleted messages in the chat of the business account\n", + "name": "message_ids", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BusinessOpeningHours/entity.json b/.butcher/types/BusinessOpeningHours/entity.json new file mode 100644 index 00000000..448b2572 --- /dev/null +++ b/.butcher/types/BusinessOpeningHours/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "businessopeninghours", + "name": "BusinessOpeningHours", + "description": "Describes the opening hours of a business.", + "html_description": "

Describes the opening hours of a business.

", + "rst_description": "Describes the opening hours of a business.", + "annotations": [ + { + "type": "String", + "description": "Unique name of the time zone for which the opening hours are defined", + "html_description": "Unique name of the time zone for which the opening hours are defined", + "rst_description": "Unique name of the time zone for which the opening hours are defined\n", + "name": "time_zone_name", + "required": true + }, + { + "type": "Array of BusinessOpeningHoursInterval", + "description": "List of time intervals describing business opening hours", + "html_description": "List of time intervals describing business opening hours", + "rst_description": "List of time intervals describing business opening hours\n", + "name": "opening_hours", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BusinessOpeningHoursInterval/entity.json b/.butcher/types/BusinessOpeningHoursInterval/entity.json new file mode 100644 index 00000000..ea60e2ec --- /dev/null +++ b/.butcher/types/BusinessOpeningHoursInterval/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "businessopeninghoursinterval", + "name": "BusinessOpeningHoursInterval", + "description": "Describes an interval of time during which a business is open.", + "html_description": "

Describes an interval of time during which a business is open.

", + "rst_description": "Describes an interval of time during which a business is open.", + "annotations": [ + { + "type": "Integer", + "description": "The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60", + "html_description": "The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60", + "rst_description": "The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60\n", + "name": "opening_minute", + "required": true + }, + { + "type": "Integer", + "description": "The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60", + "html_description": "The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60", + "rst_description": "The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60\n", + "name": "closing_minute", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/Chat/entity.json b/.butcher/types/Chat/entity.json index 6bd7efd4..df2e25b1 100644 --- a/.butcher/types/Chat/entity.json +++ b/.butcher/types/Chat/entity.json @@ -21,9 +21,9 @@ }, { "type": "String", - "description": "Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'", - "html_description": "Type of chat, can be either “private”, “group”, “supergroup” or “channel”", - "rst_description": "Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'\n", + "description": "Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'", + "html_description": "Type of the chat, can be either “private”, “group”, “supergroup” or “channel”", + "rst_description": "Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'\n", "name": "type", "required": true }, @@ -68,12 +68,16 @@ "required": false }, { - "type": "ChatPhoto", - "description": "Chat photo. Returned only in getChat.", - "html_description": "Optional. Chat photo. Returned only in getChat.", - "rst_description": "*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "photo", - "required": false + "type": "Integer", + "description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", + "html_description": "Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", + "rst_description": "*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "accent_color_id", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { "type": "Array of String", @@ -81,7 +85,11 @@ "html_description": "Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.", "rst_description": "*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`.\n", "name": "active_usernames", - "required": false + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { "type": "Array of ReactionType", @@ -89,15 +97,11 @@ "html_description": "Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.", "rst_description": "*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`.\n", "name": "available_reactions", - "required": false - }, - { - "type": "Integer", - "description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", - "html_description": "Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", - "rst_description": "*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "accent_color_id", - "required": false + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { "type": "String", @@ -105,39 +109,11 @@ "html_description": "Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.", "rst_description": "*Optional*. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "background_custom_emoji_id", - "required": false - }, - { - "type": "Integer", - "description": "Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", - "html_description": "Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", - "rst_description": "*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "profile_accent_color_id", - "required": false - }, - { - "type": "String", - "description": "Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", - "html_description": "Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", - "rst_description": "*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "profile_background_custom_emoji_id", - "required": false - }, - { - "type": "String", - "description": "Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", - "html_description": "Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", - "rst_description": "*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "emoji_status_custom_emoji_id", - "required": false - }, - { - "type": "Integer", - "description": "Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", - "html_description": "Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", - "rst_description": "*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "emoji_status_expiration_date", - "required": false + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { "type": "String", @@ -145,135 +121,59 @@ "html_description": "Optional. Bio of the other party in a private chat. Returned only in getChat.", "rst_description": "*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "bio", - "required": false + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { - "type": "True", - "description": "True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user. Returned only in getChat.", - "html_description": "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "has_private_forwards", - "required": false + "type": "Birthdate", + "description": "For private chats, the date of birth of the user. Returned only in getChat.", + "html_description": "Optional. For private chats, the date of birth of the user. Returned only in getChat.", + "rst_description": "*Optional*. For private chats, the date of birth of the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "birthdate", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { - "type": "True", - "description": "True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.", - "html_description": "Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "has_restricted_voice_and_video_messages", - "required": false + "type": "BusinessIntro", + "description": "For private chats with business accounts, the intro of the business. Returned only in getChat.", + "html_description": "Optional. For private chats with business accounts, the intro of the business. Returned only in getChat.", + "rst_description": "*Optional*. For private chats with business accounts, the intro of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "business_intro", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { - "type": "True", - "description": "True, if users need to join the supergroup before they can send messages. Returned only in getChat.", - "html_description": "Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if users need to join the supergroup before they can send messages. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "join_to_send_messages", - "required": false + "type": "BusinessLocation", + "description": "For private chats with business accounts, the location of the business. Returned only in getChat.", + "html_description": "Optional. For private chats with business accounts, the location of the business. Returned only in getChat.", + "rst_description": "*Optional*. For private chats with business accounts, the location of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "business_location", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { - "type": "True", - "description": "True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.", - "html_description": "Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "join_by_request", - "required": false - }, - { - "type": "String", - "description": "Description, for groups, supergroups and channel chats. Returned only in getChat.", - "html_description": "Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.", - "rst_description": "*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "description", - "required": false - }, - { - "type": "String", - "description": "Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.", - "html_description": "Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.", - "rst_description": "*Optional*. Primary invite link, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "invite_link", - "required": false - }, - { - "type": "Message", - "description": "The most recent pinned message (by sending date). Returned only in getChat.", - "html_description": "Optional. The most recent pinned message (by sending date). Returned only in getChat.", - "rst_description": "*Optional*. The most recent pinned message (by sending date). Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "pinned_message", - "required": false - }, - { - "type": "ChatPermissions", - "description": "Default chat member permissions, for groups and supergroups. Returned only in getChat.", - "html_description": "Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.", - "rst_description": "*Optional*. Default chat member permissions, for groups and supergroups. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "permissions", - "required": false - }, - { - "type": "Integer", - "description": "For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat.", - "html_description": "Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat.", - "rst_description": "*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "slow_mode_delay", - "required": false - }, - { - "type": "Integer", - "description": "For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat.", - "html_description": "Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat.", - "rst_description": "*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "unrestrict_boost_count", - "required": false - }, - { - "type": "Integer", - "description": "The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.", - "html_description": "Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.", - "rst_description": "*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "message_auto_delete_time", - "required": false - }, - { - "type": "True", - "description": "True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.", - "html_description": "Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "has_aggressive_anti_spam_enabled", - "required": false - }, - { - "type": "True", - "description": "True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.", - "html_description": "Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "has_hidden_members", - "required": false - }, - { - "type": "True", - "description": "True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.", - "html_description": "Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "has_protected_content", - "required": false - }, - { - "type": "True", - "description": "True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", - "html_description": "Optional. True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", - "rst_description": "*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "has_visible_history", - "required": false - }, - { - "type": "String", - "description": "For supergroups, name of group sticker set. Returned only in getChat.", - "html_description": "Optional. For supergroups, name of group sticker set. Returned only in getChat.", - "rst_description": "*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "sticker_set_name", - "required": false + "type": "BusinessOpeningHours", + "description": "For private chats with business accounts, the opening hours of the business. Returned only in getChat.", + "html_description": "Optional. For private chats with business accounts, the opening hours of the business. Returned only in getChat.", + "rst_description": "*Optional*. For private chats with business accounts, the opening hours of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "business_opening_hours", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { "type": "True", @@ -281,7 +181,11 @@ "html_description": "Optional. True, if the bot can change the group sticker set. Returned only in getChat.", "rst_description": "*Optional*. :code:`True`, if the bot can change the group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "can_set_sticker_set", - "required": false + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { "type": "String", @@ -289,7 +193,155 @@ "html_description": "Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in getChat.", "rst_description": "*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "custom_emoji_sticker_set_name", - "required": false + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "String", + "description": "Description, for groups, supergroups and channel chats. Returned only in getChat.", + "html_description": "Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.", + "rst_description": "*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "description", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "String", + "description": "Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", + "html_description": "Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", + "rst_description": "*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "emoji_status_custom_emoji_id", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "Integer", + "description": "Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", + "html_description": "Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", + "rst_description": "*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "emoji_status_expiration_date", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "True", + "description": "True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.", + "html_description": "Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "has_aggressive_anti_spam_enabled", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "True", + "description": "True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.", + "html_description": "Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "has_hidden_members", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "True", + "description": "True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user. Returned only in getChat.", + "html_description": "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "has_private_forwards", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "True", + "description": "True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.", + "html_description": "Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "has_protected_content", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "True", + "description": "True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.", + "html_description": "Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "has_restricted_voice_and_video_messages", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "True", + "description": "True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", + "html_description": "Optional. True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "has_visible_history", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "String", + "description": "Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.", + "html_description": "Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.", + "rst_description": "*Optional*. Primary invite link, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "invite_link", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "True", + "description": "True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.", + "html_description": "Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "join_by_request", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "True", + "description": "True, if users need to join the supergroup before they can send messages. Returned only in getChat.", + "html_description": "Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if users need to join the supergroup before they can send messages. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "join_to_send_messages", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { "type": "Integer", @@ -297,7 +349,11 @@ "html_description": "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.", "rst_description": "*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "linked_chat_id", - "required": false + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } }, { "type": "ChatLocation", @@ -305,7 +361,131 @@ "html_description": "Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.", "rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "location", - "required": false + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "Integer", + "description": "The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.", + "html_description": "Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.", + "rst_description": "*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "message_auto_delete_time", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "ChatPermissions", + "description": "Default chat member permissions, for groups and supergroups. Returned only in getChat.", + "html_description": "Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.", + "rst_description": "*Optional*. Default chat member permissions, for groups and supergroups. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "permissions", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "Chat", + "description": "For private chats, the personal channel of the user. Returned only in getChat.", + "html_description": "Optional. For private chats, the personal channel of the user. Returned only in getChat.", + "rst_description": "*Optional*. For private chats, the personal channel of the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "personal_chat", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "ChatPhoto", + "description": "Chat photo. Returned only in getChat.", + "html_description": "Optional. Chat photo. Returned only in getChat.", + "rst_description": "*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "photo", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "Message", + "description": "The most recent pinned message (by sending date). Returned only in getChat.", + "html_description": "Optional. The most recent pinned message (by sending date). Returned only in getChat.", + "rst_description": "*Optional*. The most recent pinned message (by sending date). Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "pinned_message", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "Integer", + "description": "Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", + "html_description": "Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", + "rst_description": "*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "profile_accent_color_id", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "String", + "description": "Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", + "html_description": "Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", + "rst_description": "*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "profile_background_custom_emoji_id", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "Integer", + "description": "For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat.", + "html_description": "Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat.", + "rst_description": "*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "slow_mode_delay", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "String", + "description": "For supergroups, name of group sticker set. Returned only in getChat.", + "html_description": "Optional. For supergroups, name of group sticker set. Returned only in getChat.", + "rst_description": "*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "sticker_set_name", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } + }, + { + "type": "Integer", + "description": "For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat.", + "html_description": "Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat.", + "rst_description": "*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "unrestrict_boost_count", + "required": false, + "deprecated": { + "version": "7.3", + "release_date": "2024-05-06" + } } ], "category": "types" diff --git a/.butcher/types/ChatAdministratorRights/entity.json b/.butcher/types/ChatAdministratorRights/entity.json index d45cda66..21f5e36c 100644 --- a/.butcher/types/ChatAdministratorRights/entity.json +++ b/.butcher/types/ChatAdministratorRights/entity.json @@ -85,9 +85,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can edit stories posted by other users", - "html_description": "True, if the administrator can edit stories posted by other users", - "rst_description": ":code:`True`, if the administrator can edit stories posted by other users\n", + "description": "True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "html_description": "True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "rst_description": ":code:`True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive\n", "name": "can_edit_stories", "required": true }, @@ -101,33 +101,33 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", - "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", + "description": "True, if the administrator can post messages in the channel, or access channel statistics; for channels only", + "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; for channels only\n", "name": "can_post_messages", "required": false }, { "type": "Boolean", - "description": "True, if the administrator can edit messages of other users and can pin messages; channels only", - "html_description": "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only\n", + "description": "True, if the administrator can edit messages of other users and can pin messages; for channels only", + "html_description": "Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; for channels only\n", "name": "can_edit_messages", "required": false }, { "type": "Boolean", - "description": "True, if the user is allowed to pin messages; groups and supergroups only", - "html_description": "Optional. True, if the user is allowed to pin messages; groups and supergroups only", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only\n", + "description": "True, if the user is allowed to pin messages; for groups and supergroups only", + "html_description": "Optional. True, if the user is allowed to pin messages; for groups and supergroups only", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; for groups and supergroups only\n", "name": "can_pin_messages", "required": false }, { "type": "Boolean", - "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", - "html_description": "Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only\n", + "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "html_description": "Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only\n", "name": "can_manage_topics", "required": false } diff --git a/.butcher/types/ChatBackground/entity.json b/.butcher/types/ChatBackground/entity.json new file mode 100644 index 00000000..a0eaddf9 --- /dev/null +++ b/.butcher/types/ChatBackground/entity.json @@ -0,0 +1,25 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatbackground", + "name": "ChatBackground", + "description": "This object represents a chat background.", + "html_description": "

This object represents a chat background.

", + "rst_description": "This object represents a chat background.", + "annotations": [ + { + "type": "BackgroundType", + "description": "Type of the background", + "html_description": "Type of the background", + "rst_description": "Type of the background\n", + "name": "type", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ChatFullInfo/entity.json b/.butcher/types/ChatFullInfo/entity.json new file mode 100644 index 00000000..1b3045e3 --- /dev/null +++ b/.butcher/types/ChatFullInfo/entity.json @@ -0,0 +1,361 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatfullinfo", + "name": "ChatFullInfo", + "description": "This object contains full information about a chat.", + "html_description": "

This object contains full information about a chat.

", + "rst_description": "This object contains full information about a chat.", + "annotations": [ + { + "type": "Integer", + "description": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.", + "html_description": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.", + "rst_description": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.\n", + "name": "id", + "required": true + }, + { + "type": "String", + "description": "Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'", + "html_description": "Type of the chat, can be either “private”, “group”, “supergroup” or “channel”", + "rst_description": "Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Title, for supergroups, channels and group chats", + "html_description": "Optional. Title, for supergroups, channels and group chats", + "rst_description": "*Optional*. Title, for supergroups, channels and group chats\n", + "name": "title", + "required": false + }, + { + "type": "String", + "description": "Username, for private chats, supergroups and channels if available", + "html_description": "Optional. Username, for private chats, supergroups and channels if available", + "rst_description": "*Optional*. Username, for private chats, supergroups and channels if available\n", + "name": "username", + "required": false + }, + { + "type": "String", + "description": "First name of the other party in a private chat", + "html_description": "Optional. First name of the other party in a private chat", + "rst_description": "*Optional*. First name of the other party in a private chat\n", + "name": "first_name", + "required": false + }, + { + "type": "String", + "description": "Last name of the other party in a private chat", + "html_description": "Optional. Last name of the other party in a private chat", + "rst_description": "*Optional*. Last name of the other party in a private chat\n", + "name": "last_name", + "required": false + }, + { + "type": "True", + "description": "True, if the supergroup chat is a forum (has topics enabled)", + "html_description": "Optional. True, if the supergroup chat is a forum (has topics enabled)", + "rst_description": "*Optional*. :code:`True`, if the supergroup chat is a forum (has `topics `_ enabled)\n", + "name": "is_forum", + "required": false + }, + { + "type": "Integer", + "description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.", + "html_description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.", + "rst_description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details.\n", + "name": "accent_color_id", + "required": true + }, + { + "type": "Integer", + "description": "The maximum number of reactions that can be set on a message in the chat", + "html_description": "The maximum number of reactions that can be set on a message in the chat", + "rst_description": "The maximum number of reactions that can be set on a message in the chat\n", + "name": "max_reaction_count", + "required": true + }, + { + "type": "ChatPhoto", + "description": "Chat photo", + "html_description": "Optional. Chat photo", + "rst_description": "*Optional*. Chat photo\n", + "name": "photo", + "required": false + }, + { + "type": "Array of String", + "description": "If non-empty, the list of all active chat usernames; for private chats, supergroups and channels", + "html_description": "Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels", + "rst_description": "*Optional*. If non-empty, the list of all `active chat usernames `_; for private chats, supergroups and channels\n", + "name": "active_usernames", + "required": false + }, + { + "type": "Birthdate", + "description": "For private chats, the date of birth of the user", + "html_description": "Optional. For private chats, the date of birth of the user", + "rst_description": "*Optional*. For private chats, the date of birth of the user\n", + "name": "birthdate", + "required": false + }, + { + "type": "BusinessIntro", + "description": "For private chats with business accounts, the intro of the business", + "html_description": "Optional. For private chats with business accounts, the intro of the business", + "rst_description": "*Optional*. For private chats with business accounts, the intro of the business\n", + "name": "business_intro", + "required": false + }, + { + "type": "BusinessLocation", + "description": "For private chats with business accounts, the location of the business", + "html_description": "Optional. For private chats with business accounts, the location of the business", + "rst_description": "*Optional*. For private chats with business accounts, the location of the business\n", + "name": "business_location", + "required": false + }, + { + "type": "BusinessOpeningHours", + "description": "For private chats with business accounts, the opening hours of the business", + "html_description": "Optional. For private chats with business accounts, the opening hours of the business", + "rst_description": "*Optional*. For private chats with business accounts, the opening hours of the business\n", + "name": "business_opening_hours", + "required": false + }, + { + "type": "Chat", + "description": "For private chats, the personal channel of the user", + "html_description": "Optional. For private chats, the personal channel of the user", + "rst_description": "*Optional*. For private chats, the personal channel of the user\n", + "name": "personal_chat", + "required": false + }, + { + "type": "Array of ReactionType", + "description": "List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.", + "html_description": "Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.", + "rst_description": "*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions `_ are allowed.\n", + "name": "available_reactions", + "required": false + }, + { + "type": "String", + "description": "Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background", + "html_description": "Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background", + "rst_description": "*Optional*. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background\n", + "name": "background_custom_emoji_id", + "required": false + }, + { + "type": "Integer", + "description": "Identifier of the accent color for the chat's profile background. See profile accent colors for more details.", + "html_description": "Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details.", + "rst_description": "*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details.\n", + "name": "profile_accent_color_id", + "required": false + }, + { + "type": "String", + "description": "Custom emoji identifier of the emoji chosen by the chat for its profile background", + "html_description": "Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background", + "rst_description": "*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background\n", + "name": "profile_background_custom_emoji_id", + "required": false + }, + { + "type": "String", + "description": "Custom emoji identifier of the emoji status of the chat or the other party in a private chat", + "html_description": "Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat", + "rst_description": "*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat\n", + "name": "emoji_status_custom_emoji_id", + "required": false + }, + { + "type": "Integer", + "description": "Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any", + "html_description": "Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any", + "rst_description": "*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any\n", + "name": "emoji_status_expiration_date", + "required": false + }, + { + "type": "String", + "description": "Bio of the other party in a private chat", + "html_description": "Optional. Bio of the other party in a private chat", + "rst_description": "*Optional*. Bio of the other party in a private chat\n", + "name": "bio", + "required": false + }, + { + "type": "True", + "description": "True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user", + "html_description": "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user", + "rst_description": "*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=` links only in chats with the user\n", + "name": "has_private_forwards", + "required": false + }, + { + "type": "True", + "description": "True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat", + "html_description": "Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat", + "rst_description": "*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat\n", + "name": "has_restricted_voice_and_video_messages", + "required": false + }, + { + "type": "True", + "description": "True, if users need to join the supergroup before they can send messages", + "html_description": "Optional. True, if users need to join the supergroup before they can send messages", + "rst_description": "*Optional*. :code:`True`, if users need to join the supergroup before they can send messages\n", + "name": "join_to_send_messages", + "required": false + }, + { + "type": "True", + "description": "True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators", + "html_description": "Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators", + "rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators\n", + "name": "join_by_request", + "required": false + }, + { + "type": "String", + "description": "Description, for groups, supergroups and channel chats", + "html_description": "Optional. Description, for groups, supergroups and channel chats", + "rst_description": "*Optional*. Description, for groups, supergroups and channel chats\n", + "name": "description", + "required": false + }, + { + "type": "String", + "description": "Primary invite link, for groups, supergroups and channel chats", + "html_description": "Optional. Primary invite link, for groups, supergroups and channel chats", + "rst_description": "*Optional*. Primary invite link, for groups, supergroups and channel chats\n", + "name": "invite_link", + "required": false + }, + { + "type": "Message", + "description": "The most recent pinned message (by sending date)", + "html_description": "Optional. The most recent pinned message (by sending date)", + "rst_description": "*Optional*. The most recent pinned message (by sending date)\n", + "name": "pinned_message", + "required": false + }, + { + "type": "ChatPermissions", + "description": "Default chat member permissions, for groups and supergroups", + "html_description": "Optional. Default chat member permissions, for groups and supergroups", + "rst_description": "*Optional*. Default chat member permissions, for groups and supergroups\n", + "name": "permissions", + "required": false + }, + { + "type": "Integer", + "description": "For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds", + "html_description": "Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds", + "rst_description": "*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds\n", + "name": "slow_mode_delay", + "required": false + }, + { + "type": "Integer", + "description": "For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions", + "html_description": "Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions", + "rst_description": "*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions\n", + "name": "unrestrict_boost_count", + "required": false + }, + { + "type": "Integer", + "description": "The time after which all messages sent to the chat will be automatically deleted; in seconds", + "html_description": "Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds", + "rst_description": "*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds\n", + "name": "message_auto_delete_time", + "required": false + }, + { + "type": "True", + "description": "True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.", + "html_description": "Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.", + "rst_description": "*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.\n", + "name": "has_aggressive_anti_spam_enabled", + "required": false + }, + { + "type": "True", + "description": "True, if non-administrators can only get the list of bots and administrators in the chat", + "html_description": "Optional. True, if non-administrators can only get the list of bots and administrators in the chat", + "rst_description": "*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat\n", + "name": "has_hidden_members", + "required": false + }, + { + "type": "True", + "description": "True, if messages from the chat can't be forwarded to other chats", + "html_description": "Optional. True, if messages from the chat can't be forwarded to other chats", + "rst_description": "*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats\n", + "name": "has_protected_content", + "required": false + }, + { + "type": "True", + "description": "True, if new chat members will have access to old messages; available only to chat administrators", + "html_description": "Optional. True, if new chat members will have access to old messages; available only to chat administrators", + "rst_description": "*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators\n", + "name": "has_visible_history", + "required": false + }, + { + "type": "String", + "description": "For supergroups, name of the group sticker set", + "html_description": "Optional. For supergroups, name of the group sticker set", + "rst_description": "*Optional*. For supergroups, name of the group sticker set\n", + "name": "sticker_set_name", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can change the group sticker set", + "html_description": "Optional. True, if the bot can change the group sticker set", + "rst_description": "*Optional*. :code:`True`, if the bot can change the group sticker set\n", + "name": "can_set_sticker_set", + "required": false + }, + { + "type": "String", + "description": "For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.", + "html_description": "Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.", + "rst_description": "*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.\n", + "name": "custom_emoji_sticker_set_name", + "required": false + }, + { + "type": "Integer", + "description": "Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.", + "html_description": "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.", + "rst_description": "*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.\n", + "name": "linked_chat_id", + "required": false + }, + { + "type": "ChatLocation", + "description": "For supergroups, the location to which the supergroup is connected", + "html_description": "Optional. For supergroups, the location to which the supergroup is connected", + "rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected\n", + "name": "location", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ChatFullInfo/replace.yml b/.butcher/types/ChatFullInfo/replace.yml new file mode 100644 index 00000000..2070e8a0 --- /dev/null +++ b/.butcher/types/ChatFullInfo/replace.yml @@ -0,0 +1,7 @@ +bases: + - Chat +annotations: + emoji_status_expiration_date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/ChatMemberAdministrator/entity.json b/.butcher/types/ChatMemberAdministrator/entity.json index b0e4a00c..f217b3fe 100644 --- a/.butcher/types/ChatMemberAdministrator/entity.json +++ b/.butcher/types/ChatMemberAdministrator/entity.json @@ -109,9 +109,9 @@ }, { "type": "Boolean", - "description": "True, if the administrator can edit stories posted by other users", - "html_description": "True, if the administrator can edit stories posted by other users", - "rst_description": ":code:`True`, if the administrator can edit stories posted by other users\n", + "description": "True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "html_description": "True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive", + "rst_description": ":code:`True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive\n", "name": "can_edit_stories", "required": true }, @@ -125,33 +125,33 @@ }, { "type": "Boolean", - "description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", - "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", + "description": "True, if the administrator can post messages in the channel, or access channel statistics; for channels only", + "html_description": "Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; for channels only\n", "name": "can_post_messages", "required": false }, { "type": "Boolean", - "description": "True, if the administrator can edit messages of other users and can pin messages; channels only", - "html_description": "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only", - "rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only\n", + "description": "True, if the administrator can edit messages of other users and can pin messages; for channels only", + "html_description": "Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only", + "rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; for channels only\n", "name": "can_edit_messages", "required": false }, { "type": "Boolean", - "description": "True, if the user is allowed to pin messages; groups and supergroups only", - "html_description": "Optional. True, if the user is allowed to pin messages; groups and supergroups only", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only\n", + "description": "True, if the user is allowed to pin messages; for groups and supergroups only", + "html_description": "Optional. True, if the user is allowed to pin messages; for groups and supergroups only", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; for groups and supergroups only\n", "name": "can_pin_messages", "required": false }, { "type": "Boolean", - "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", - "html_description": "Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only\n", + "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "html_description": "Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only\n", "name": "can_manage_topics", "required": false }, diff --git a/.butcher/types/ChatMemberUpdated/entity.json b/.butcher/types/ChatMemberUpdated/entity.json index fbec5160..e76773dc 100644 --- a/.butcher/types/ChatMemberUpdated/entity.json +++ b/.butcher/types/ChatMemberUpdated/entity.json @@ -59,6 +59,14 @@ "name": "invite_link", "required": false }, + { + "type": "Boolean", + "description": "True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator", + "html_description": "Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator", + "rst_description": "*Optional*. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator\n", + "name": "via_join_request", + "required": false + }, { "type": "Boolean", "description": "True, if the user joined the chat via a chat folder invite link", diff --git a/.butcher/types/ChatShared/entity.json b/.butcher/types/ChatShared/entity.json index ceaeb604..eb8b6c17 100644 --- a/.butcher/types/ChatShared/entity.json +++ b/.butcher/types/ChatShared/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "chatshared", "name": "ChatShared", - "description": "This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.", - "html_description": "

This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.

", - "rst_description": "This object contains information about the chat whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_chat.KeyboardButtonRequestChat` button.", + "description": "This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.", + "html_description": "

This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.

", + "rst_description": "This object contains information about a chat that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_chat.KeyboardButtonRequestChat` button.", "annotations": [ { "type": "Integer", @@ -26,6 +26,30 @@ "rst_description": "Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.\n", "name": "chat_id", "required": true + }, + { + "type": "String", + "description": "Title of the chat, if the title was requested by the bot.", + "html_description": "Optional. Title of the chat, if the title was requested by the bot.", + "rst_description": "*Optional*. Title of the chat, if the title was requested by the bot.\n", + "name": "title", + "required": false + }, + { + "type": "String", + "description": "Username of the chat, if the username was requested by the bot and available.", + "html_description": "Optional. Username of the chat, if the username was requested by the bot and available.", + "rst_description": "*Optional*. Username of the chat, if the username was requested by the bot and available.\n", + "name": "username", + "required": false + }, + { + "type": "Array of PhotoSize", + "description": "Available sizes of the chat photo, if the photo was requested by the bot", + "html_description": "Optional. Available sizes of the chat photo, if the photo was requested by the bot", + "rst_description": "*Optional*. Available sizes of the chat photo, if the photo was requested by the bot\n", + "name": "photo", + "required": false } ], "category": "types" diff --git a/.butcher/types/EncryptedPassportElement/entity.json b/.butcher/types/EncryptedPassportElement/entity.json index 33fd2827..2d969e3e 100644 --- a/.butcher/types/EncryptedPassportElement/entity.json +++ b/.butcher/types/EncryptedPassportElement/entity.json @@ -21,65 +21,65 @@ }, { "type": "String", - "description": "Base64-encoded encrypted Telegram Passport element data provided by the user, available for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Base64-encoded encrypted Telegram Passport element data provided by the user, available for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.\n", + "description": "Base64-encoded encrypted Telegram Passport element data provided by the user; available only for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying EncryptedCredentials.", + "html_description": "Optional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.", + "rst_description": "*Optional*. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.\n", "name": "data", "required": false }, { "type": "String", - "description": "User's verified phone number, available only for 'phone_number' type", - "html_description": "Optional. User's verified phone number, available only for “phone_number” type", - "rst_description": "*Optional*. User's verified phone number, available only for 'phone_number' type\n", + "description": "User's verified phone number; available only for 'phone_number' type", + "html_description": "Optional. User's verified phone number; available only for “phone_number” type", + "rst_description": "*Optional*. User's verified phone number; available only for 'phone_number' type\n", "name": "phone_number", "required": false }, { "type": "String", - "description": "User's verified email address, available only for 'email' type", - "html_description": "Optional. User's verified email address, available only for “email” type", - "rst_description": "*Optional*. User's verified email address, available only for 'email' type\n", + "description": "User's verified email address; available only for 'email' type", + "html_description": "Optional. User's verified email address; available only for “email” type", + "rst_description": "*Optional*. User's verified email address; available only for 'email' type\n", "name": "email", "required": false }, { "type": "Array of PassportFile", - "description": "Array of encrypted files with documents provided by the user, available for 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' types. Files can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Array of encrypted files with documents provided by the user, available 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`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "files", "required": false }, { "type": "PassportFile", - "description": "Encrypted file with the front side of the document, provided by the user. Available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Encrypted file with the front side of the document, provided by the user. Available 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`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "front_side", "required": false }, { "type": "PassportFile", - "description": "Encrypted file with the reverse side of the document, provided by the user. Available for 'driver_license' and 'identity_card'. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Encrypted file with the reverse side of the document, provided by the user. Available for 'driver_license' and 'identity_card'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "reverse_side", "required": false }, { "type": "PassportFile", - "description": "Encrypted file with the selfie of the user holding a document, provided by the user; available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "html_description": "Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.", - "rst_description": "*Optional*. Encrypted file with the selfie of the user holding a document, provided by the user; available 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`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "selfie", "required": false }, { "type": "Array of PassportFile", - "description": "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 EncryptedCredentials.", - "html_description": "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 EncryptedCredentials.", - "rst_description": "*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`.\n", + "description": "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 EncryptedCredentials.", + "html_description": "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 EncryptedCredentials.", + "rst_description": "*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`.\n", "name": "translation", "required": false }, diff --git a/.butcher/types/ForceReply/entity.json b/.butcher/types/ForceReply/entity.json index e8ff7c60..30b2418e 100644 --- a/.butcher/types/ForceReply/entity.json +++ b/.butcher/types/ForceReply/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "forcereply", "name": "ForceReply", - "description": "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.\nExample: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\n\nExplain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.\nGuide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.\nThe last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", - "html_description": "

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.

\n

Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

\n
    \n
  • Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
  • \n
  • Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
  • \n
\n

The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.

\n
", - "rst_description": "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode `_.\n\n **Example:** A `poll bot `_ for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\n \n - Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.\n - Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.\n \n The last option is definitely more attractive. And if you use :class:`aiogram.types.force_reply.ForceReply` in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", + "description": "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.\nExample: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\n\nExplain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.\nGuide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.\nThe last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", + "html_description": "

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.

\n

Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

\n
    \n
  • Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
  • \n
  • Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
  • \n
\n

The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.

\n
", + "rst_description": "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode `_. Not supported in channels and for messages sent on behalf of a Telegram Business account.\n\n **Example:** A `poll bot `_ for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:\n \n - Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.\n - Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.\n \n The last option is definitely more attractive. And if you use :class:`aiogram.types.force_reply.ForceReply` in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.", "annotations": [ { "type": "True", diff --git a/.butcher/types/InlineKeyboardButton/entity.json b/.butcher/types/InlineKeyboardButton/entity.json index 678b0cfb..7b502151 100644 --- a/.butcher/types/InlineKeyboardButton/entity.json +++ b/.butcher/types/InlineKeyboardButton/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "inlinekeyboardbutton", "name": "InlineKeyboardButton", - "description": "This object represents one button of an inline keyboard. You must use exactly one of the optional fields.", - "html_description": "

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

", - "rst_description": "This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields.", + "description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", + "html_description": "

This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.

", + "rst_description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", "annotations": [ { "type": "String", @@ -29,17 +29,17 @@ }, { "type": "String", - "description": "Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes", - "html_description": "Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes", - "rst_description": "*Optional*. Data to be sent in a `callback query `_ to the bot when button is pressed, 1-64 bytes\n", + "description": "Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account.", + "html_description": "Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account.", + "rst_description": "*Optional*. Data to be sent in a `callback query `_ to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account.\n", "name": "callback_data", "required": false }, { "type": "WebAppInfo", - "description": "Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.", - "html_description": "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.", - "rst_description": "*Optional*. Description of the `Web App `_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot.\n", + "description": "Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.", + "html_description": "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.", + "rst_description": "*Optional*. Description of the `Web App `_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.\n", "name": "web_app", "required": false }, @@ -53,25 +53,25 @@ }, { "type": "String", - "description": "If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.", - "html_description": "Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.", - "rst_description": "*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.\n", + "description": "If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account.", + "html_description": "Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account.", + "rst_description": "*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account.\n", "name": "switch_inline_query", "required": false }, { "type": "String", - "description": "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.\n\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.", - "html_description": "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.
\n
\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.", - "rst_description": "*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.\n\n\n\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.\n", + "description": "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.\n\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account.", + "html_description": "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.
\n
\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account.", + "rst_description": "*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.\n\n\n\nThis offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account.\n", "name": "switch_inline_query_current_chat", "required": false }, { "type": "SwitchInlineQueryChosenChat", - "description": "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", - "html_description": "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", - "rst_description": "*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\n", + "description": "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.", + "html_description": "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.", + "rst_description": "*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.\n", "name": "switch_inline_query_chosen_chat", "required": false }, @@ -85,9 +85,9 @@ }, { "type": "Boolean", - "description": "Specify True, to send a Pay button.\n\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", - "html_description": "Optional. Specify True, to send a Pay button.
\n
\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", - "rst_description": "*Optional*. Specify :code:`True`, to send a `Pay button `_.\n\n\n\n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages.\n", + "description": "Specify True, to send a Pay button. Substrings '' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.\n\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", + "html_description": "Optional. Specify True, to send a Pay button. Substrings “\"⭐\"/” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
\n
\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", + "rst_description": "*Optional*. Specify :code:`True`, to send a `Pay button `_. Substrings '⭐' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.\n\n\n\n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages.\n", "name": "pay", "required": false } diff --git a/.butcher/types/InlineQueryResultCachedGif/default.yml b/.butcher/types/InlineQueryResultCachedGif/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultCachedGif/default.yml +++ b/.butcher/types/InlineQueryResultCachedGif/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultCachedGif/entity.json b/.butcher/types/InlineQueryResultCachedGif/entity.json index 51c90620..2c342fa8 100644 --- a/.butcher/types/InlineQueryResultCachedGif/entity.json +++ b/.butcher/types/InlineQueryResultCachedGif/entity.json @@ -67,6 +67,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultCachedMpeg4Gif/default.yml b/.butcher/types/InlineQueryResultCachedMpeg4Gif/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultCachedMpeg4Gif/default.yml +++ b/.butcher/types/InlineQueryResultCachedMpeg4Gif/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultCachedMpeg4Gif/entity.json b/.butcher/types/InlineQueryResultCachedMpeg4Gif/entity.json index bd91435e..70c6c36c 100644 --- a/.butcher/types/InlineQueryResultCachedMpeg4Gif/entity.json +++ b/.butcher/types/InlineQueryResultCachedMpeg4Gif/entity.json @@ -67,6 +67,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultCachedPhoto/default.yml b/.butcher/types/InlineQueryResultCachedPhoto/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultCachedPhoto/default.yml +++ b/.butcher/types/InlineQueryResultCachedPhoto/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultCachedPhoto/entity.json b/.butcher/types/InlineQueryResultCachedPhoto/entity.json index d0bc2b9b..8060ce8a 100644 --- a/.butcher/types/InlineQueryResultCachedPhoto/entity.json +++ b/.butcher/types/InlineQueryResultCachedPhoto/entity.json @@ -75,6 +75,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultCachedVideo/default.yml b/.butcher/types/InlineQueryResultCachedVideo/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultCachedVideo/default.yml +++ b/.butcher/types/InlineQueryResultCachedVideo/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultCachedVideo/entity.json b/.butcher/types/InlineQueryResultCachedVideo/entity.json index 2b35ddc6..2fe47f84 100644 --- a/.butcher/types/InlineQueryResultCachedVideo/entity.json +++ b/.butcher/types/InlineQueryResultCachedVideo/entity.json @@ -75,6 +75,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultGif/default.yml b/.butcher/types/InlineQueryResultGif/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultGif/default.yml +++ b/.butcher/types/InlineQueryResultGif/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultGif/entity.json b/.butcher/types/InlineQueryResultGif/entity.json index 7824368a..7c104615 100644 --- a/.butcher/types/InlineQueryResultGif/entity.json +++ b/.butcher/types/InlineQueryResultGif/entity.json @@ -107,6 +107,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultLocation/entity.json b/.butcher/types/InlineQueryResultLocation/entity.json index cf171e89..4bce223c 100644 --- a/.butcher/types/InlineQueryResultLocation/entity.json +++ b/.butcher/types/InlineQueryResultLocation/entity.json @@ -61,9 +61,9 @@ }, { "type": "Integer", - "description": "Period in seconds for which the location can be updated, should be between 60 and 86400.", - "html_description": "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.", - "rst_description": "*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400.\n", + "description": "Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "html_description": "Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "rst_description": "*Optional*. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.\n", "name": "live_period", "required": false }, diff --git a/.butcher/types/InlineQueryResultMpeg4Gif/default.yml b/.butcher/types/InlineQueryResultMpeg4Gif/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultMpeg4Gif/default.yml +++ b/.butcher/types/InlineQueryResultMpeg4Gif/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultMpeg4Gif/entity.json b/.butcher/types/InlineQueryResultMpeg4Gif/entity.json index c365a134..fa4c3e81 100644 --- a/.butcher/types/InlineQueryResultMpeg4Gif/entity.json +++ b/.butcher/types/InlineQueryResultMpeg4Gif/entity.json @@ -107,6 +107,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultPhoto/default.yml b/.butcher/types/InlineQueryResultPhoto/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultPhoto/default.yml +++ b/.butcher/types/InlineQueryResultPhoto/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultPhoto/entity.json b/.butcher/types/InlineQueryResultPhoto/entity.json index 67130359..94f9867a 100644 --- a/.butcher/types/InlineQueryResultPhoto/entity.json +++ b/.butcher/types/InlineQueryResultPhoto/entity.json @@ -99,6 +99,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultVideo/default.yml b/.butcher/types/InlineQueryResultVideo/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultVideo/default.yml +++ b/.butcher/types/InlineQueryResultVideo/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultVideo/entity.json b/.butcher/types/InlineQueryResultVideo/entity.json index 7164306c..77910b7c 100644 --- a/.butcher/types/InlineQueryResultVideo/entity.json +++ b/.butcher/types/InlineQueryResultVideo/entity.json @@ -83,6 +83,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Video width", diff --git a/.butcher/types/InputInvoiceMessageContent/entity.json b/.butcher/types/InputInvoiceMessageContent/entity.json index 27195732..bed9e656 100644 --- a/.butcher/types/InputInvoiceMessageContent/entity.json +++ b/.butcher/types/InputInvoiceMessageContent/entity.json @@ -37,33 +37,33 @@ }, { "type": "String", - "description": "Payment provider token, obtained via @BotFather", - "html_description": "Payment provider token, obtained via @BotFather", - "rst_description": "Payment provider token, obtained via `@BotFather `_\n", + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "*Optional*. Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token", - "required": true + "required": false }, { "type": "String", - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency", "required": true }, { "type": "Array of LabeledPrice", - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "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.", + "html_description": "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.", + "rst_description": "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 `_.\n", "name": "prices", "required": true }, { "type": "Integer", - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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", - "html_description": "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 US$ 1.45 pass 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", - "rst_description": "*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\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass 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.", + "html_description": "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 US$ 1.45 pass 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.", + "rst_description": "*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 `_.\n", "name": "max_tip_amount", "required": false }, @@ -117,57 +117,57 @@ }, { "type": "Boolean", - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Optional. Pass True if you require the user's full name to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Optional. Pass True if you require the user's phone number to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Optional. Pass True if you require the user's email address to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Optional. Pass True if you require the user's shipping address to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address", "required": false }, { "type": "Boolean", - "description": "Pass True if the user's phone number should be sent to provider", - "html_description": "Optional. Pass True if the user's phone number should be sent to provider", - "rst_description": "*Optional*. Pass :code:`True` if the user's phone number should be sent to provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider", "required": false }, { "type": "Boolean", - "description": "Pass True if the user's email address should be sent to provider", - "html_description": "Optional. Pass True if the user's email address should be sent to provider", - "rst_description": "*Optional*. Pass :code:`True` if the user's email address should be sent to provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider", "required": false }, { "type": "Boolean", - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Optional. Pass True if the final price depends on the shipping method", - "rst_description": "*Optional*. Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible", "required": false } diff --git a/.butcher/types/InputLocationMessageContent/entity.json b/.butcher/types/InputLocationMessageContent/entity.json index d77afb30..cc0546b4 100644 --- a/.butcher/types/InputLocationMessageContent/entity.json +++ b/.butcher/types/InputLocationMessageContent/entity.json @@ -37,9 +37,9 @@ }, { "type": "Integer", - "description": "Period in seconds for which the location can be updated, should be between 60 and 86400.", - "html_description": "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.", - "rst_description": "*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400.\n", + "description": "Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "html_description": "Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.", + "rst_description": "*Optional*. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.\n", "name": "live_period", "required": false }, diff --git a/.butcher/types/InputMediaAnimation/default.yml b/.butcher/types/InputMediaAnimation/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InputMediaAnimation/default.yml +++ b/.butcher/types/InputMediaAnimation/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InputMediaAnimation/entity.json b/.butcher/types/InputMediaAnimation/entity.json index 1bd2e3b4..e311a1ee 100644 --- a/.butcher/types/InputMediaAnimation/entity.json +++ b/.butcher/types/InputMediaAnimation/entity.json @@ -59,6 +59,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Animation width", diff --git a/.butcher/types/InputMediaPhoto/default.yml b/.butcher/types/InputMediaPhoto/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InputMediaPhoto/default.yml +++ b/.butcher/types/InputMediaPhoto/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InputMediaPhoto/entity.json b/.butcher/types/InputMediaPhoto/entity.json index 3437668f..4fe1e134 100644 --- a/.butcher/types/InputMediaPhoto/entity.json +++ b/.butcher/types/InputMediaPhoto/entity.json @@ -51,6 +51,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Boolean", "description": "Pass True if the photo needs to be covered with a spoiler animation", diff --git a/.butcher/types/InputMediaVideo/default.yml b/.butcher/types/InputMediaVideo/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InputMediaVideo/default.yml +++ b/.butcher/types/InputMediaVideo/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InputMediaVideo/entity.json b/.butcher/types/InputMediaVideo/entity.json index 3bfbb06a..f1dc1989 100644 --- a/.butcher/types/InputMediaVideo/entity.json +++ b/.butcher/types/InputMediaVideo/entity.json @@ -59,6 +59,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Video width", diff --git a/.butcher/types/InputPollOption/default.yml b/.butcher/types/InputPollOption/default.yml new file mode 100644 index 00000000..48a2b31a --- /dev/null +++ b/.butcher/types/InputPollOption/default.yml @@ -0,0 +1 @@ +text_parse_mode: parse_mode diff --git a/.butcher/types/InputPollOption/entity.json b/.butcher/types/InputPollOption/entity.json new file mode 100644 index 00000000..7c0034a5 --- /dev/null +++ b/.butcher/types/InputPollOption/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "inputpolloption", + "name": "InputPollOption", + "description": "This object contains information about one answer option in a poll to send.", + "html_description": "

This object contains information about one answer option in a poll to send.

", + "rst_description": "This object contains information about one answer option in a poll to send.", + "annotations": [ + { + "type": "String", + "description": "Option text, 1-100 characters", + "html_description": "Option text, 1-100 characters", + "rst_description": "Option text, 1-100 characters\n", + "name": "text", + "required": true + }, + { + "type": "String", + "description": "Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed", + "html_description": "Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed", + "rst_description": "*Optional*. Mode for parsing entities in the text. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed\n", + "name": "text_parse_mode", + "required": false + }, + { + "type": "Array of MessageEntity", + "description": "A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode", + "html_description": "Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode", + "rst_description": "*Optional*. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of *text_parse_mode*\n", + "name": "text_entities", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/InputSticker/entity.json b/.butcher/types/InputSticker/entity.json index 9968d594..2df660ae 100644 --- a/.butcher/types/InputSticker/entity.json +++ b/.butcher/types/InputSticker/entity.json @@ -19,6 +19,14 @@ "name": "sticker", "required": true }, + { + "type": "String", + "description": "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", + "html_description": "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", + "rst_description": "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\n", + "name": "format", + "required": true + }, { "type": "Array of String", "description": "List of 1-20 emoji associated with the sticker", diff --git a/.butcher/types/Invoice/entity.json b/.butcher/types/Invoice/entity.json index 2ae83aa4..d53aa161 100644 --- a/.butcher/types/Invoice/entity.json +++ b/.butcher/types/Invoice/entity.json @@ -37,9 +37,9 @@ }, { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, diff --git a/.butcher/types/KeyboardButton/entity.json b/.butcher/types/KeyboardButton/entity.json index fe33466a..f98688ff 100644 --- a/.butcher/types/KeyboardButton/entity.json +++ b/.butcher/types/KeyboardButton/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "keyboardbutton", "name": "KeyboardButton", - "description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", - "html_description": "

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", - "rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_users*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", + "description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", + "html_description": "

This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", + "rst_description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", "annotations": [ { "type": "String", diff --git a/.butcher/types/KeyboardButtonRequestChat/entity.json b/.butcher/types/KeyboardButtonRequestChat/entity.json index a8674be8..d7cb0d21 100644 --- a/.butcher/types/KeyboardButtonRequestChat/entity.json +++ b/.butcher/types/KeyboardButtonRequestChat/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "keyboardbuttonrequestchat", "name": "KeyboardButtonRequestChat", - "description": "This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.", - "html_description": "

This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. More about requesting chats »

", - "rst_description": "This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. `More about requesting chats » `_", + "description": "This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate..", + "html_description": "

This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats ».

", + "rst_description": "This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. `More about requesting chats » `_.", "annotations": [ { "type": "Integer", @@ -74,6 +74,30 @@ "rst_description": "*Optional*. Pass :code:`True` to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.\n", "name": "bot_is_member", "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the chat's title", + "html_description": "Optional. Pass True to request the chat's title", + "rst_description": "*Optional*. Pass :code:`True` to request the chat's title\n", + "name": "request_title", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the chat's username", + "html_description": "Optional. Pass True to request the chat's username", + "rst_description": "*Optional*. Pass :code:`True` to request the chat's username\n", + "name": "request_username", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the chat's photo", + "html_description": "Optional. Pass True to request the chat's photo", + "rst_description": "*Optional*. Pass :code:`True` to request the chat's photo\n", + "name": "request_photo", + "required": false } ], "category": "types" diff --git a/.butcher/types/KeyboardButtonRequestUsers/entity.json b/.butcher/types/KeyboardButtonRequestUsers/entity.json index d49552ed..59355b26 100644 --- a/.butcher/types/KeyboardButtonRequestUsers/entity.json +++ b/.butcher/types/KeyboardButtonRequestUsers/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "keyboardbuttonrequestusers", "name": "KeyboardButtonRequestUsers", - "description": "This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed.", - "html_description": "

This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »

", - "rst_description": "This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_", + "description": "This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed.", + "html_description": "

This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »

", + "rst_description": "This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_", "annotations": [ { "type": "Integer", @@ -42,6 +42,30 @@ "rst_description": "*Optional*. The maximum number of users to be selected; 1-10. Defaults to 1.\n", "name": "max_quantity", "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' first and last names", + "html_description": "Optional. Pass True to request the users' first and last names", + "rst_description": "*Optional*. Pass :code:`True` to request the users' first and last names\n", + "name": "request_name", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' usernames", + "html_description": "Optional. Pass True to request the users' usernames", + "rst_description": "*Optional*. Pass :code:`True` to request the users' usernames\n", + "name": "request_username", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' photos", + "html_description": "Optional. Pass True to request the users' photos", + "rst_description": "*Optional*. Pass :code:`True` to request the users' photos\n", + "name": "request_photo", + "required": false } ], "category": "types" diff --git a/.butcher/types/Location/entity.json b/.butcher/types/Location/entity.json index 2551b11b..a62b44aa 100644 --- a/.butcher/types/Location/entity.json +++ b/.butcher/types/Location/entity.json @@ -11,14 +11,6 @@ "html_description": "

This object represents a point on the map.

", "rst_description": "This object represents a point on the map.", "annotations": [ - { - "type": "Float", - "description": "Longitude as defined by sender", - "html_description": "Longitude as defined by sender", - "rst_description": "Longitude as defined by sender\n", - "name": "longitude", - "required": true - }, { "type": "Float", "description": "Latitude as defined by sender", @@ -27,6 +19,14 @@ "name": "latitude", "required": true }, + { + "type": "Float", + "description": "Longitude as defined by sender", + "html_description": "Longitude as defined by sender", + "rst_description": "Longitude as defined by sender\n", + "name": "longitude", + "required": true + }, { "type": "Float", "description": "The radius of uncertainty for the location, measured in meters; 0-1500", diff --git a/.butcher/types/Message/aliases.yml b/.butcher/types/Message/aliases.yml index d0abce81..3168f30d 100644 --- a/.butcher/types/Message/aliases.yml +++ b/.butcher/types/Message/aliases.yml @@ -5,6 +5,7 @@ answer: fill: &fill-answer chat_id: self.chat.id message_thread_id: self.message_thread_id if self.is_topic_message else None + business_connection_id: self.business_connection_id reply: method: sendMessage diff --git a/.butcher/types/Message/entity.json b/.butcher/types/Message/entity.json index ded375e3..229c9c7d 100644 --- a/.butcher/types/Message/entity.json +++ b/.butcher/types/Message/entity.json @@ -51,6 +51,14 @@ "name": "sender_boost_count", "required": false }, + { + "type": "User", + "description": "The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.", + "html_description": "Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.", + "rst_description": "*Optional*. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.\n", + "name": "sender_business_bot", + "required": false + }, { "type": "Integer", "description": "Date the message was sent in Unix time. It is always a positive number, representing a valid date.", @@ -59,6 +67,14 @@ "name": "date", "required": true }, + { + "type": "String", + "description": "Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.", + "html_description": "Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.", + "rst_description": "*Optional*. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.\n", + "name": "business_connection_id", + "required": false + }, { "type": "Chat", "description": "Chat the message belongs to", @@ -147,6 +163,14 @@ "name": "has_protected_content", "required": false }, + { + "type": "True", + "description": "True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message", + "html_description": "Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message", + "rst_description": "*Optional*. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message\n", + "name": "is_from_offline", + "required": false + }, { "type": "String", "description": "The unique identifier of a media message group this message belongs to", @@ -187,6 +211,14 @@ "name": "link_preview_options", "required": false }, + { + "type": "String", + "description": "Unique identifier of the message effect added to the message", + "html_description": "Optional. Unique identifier of the message effect added to the message", + "rst_description": "*Optional*. Unique identifier of the message effect added to the message\n", + "name": "effect_id", + "required": false + }, { "type": "Animation", "description": "Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set", @@ -275,6 +307,14 @@ "name": "caption_entities", "required": false }, + { + "type": "True", + "description": "True, if the caption must be shown above the message media", + "html_description": "Optional. True, if the caption must be shown above the message media", + "rst_description": "*Optional*. True, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "True", "description": "True, if the message media is covered by a spoiler animation", @@ -499,6 +539,14 @@ "name": "boost_added", "required": false }, + { + "type": "ChatBackground", + "description": "Service message: chat background set", + "html_description": "Optional. Service message: chat background set", + "rst_description": "*Optional*. Service message: chat background set\n", + "name": "chat_background_set", + "required": false + }, { "type": "ForumTopicCreated", "description": "Service message: forum topic created", diff --git a/.butcher/types/MessageEntity/entity.json b/.butcher/types/MessageEntity/entity.json index 8de41cef..1ffb569b 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), '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), “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), '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), '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", "name": "type", "required": true }, diff --git a/.butcher/types/Poll/entity.json b/.butcher/types/Poll/entity.json index dcf1bf7c..00b93cc3 100644 --- a/.butcher/types/Poll/entity.json +++ b/.butcher/types/Poll/entity.json @@ -27,6 +27,14 @@ "name": "question", "required": true }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions", + "html_description": "Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions", + "rst_description": "*Optional*. Special entities that appear in the *question*. Currently, only custom emoji entities are allowed in poll questions\n", + "name": "question_entities", + "required": false + }, { "type": "Array of PollOption", "description": "List of poll options", diff --git a/.butcher/types/PollOption/entity.json b/.butcher/types/PollOption/entity.json index 0b06084a..5c5efa26 100644 --- a/.butcher/types/PollOption/entity.json +++ b/.butcher/types/PollOption/entity.json @@ -19,6 +19,14 @@ "name": "text", "required": true }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts", + "html_description": "Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts", + "rst_description": "*Optional*. Special entities that appear in the option *text*. Currently, only custom emoji entities are allowed in poll option texts\n", + "name": "text_entities", + "required": false + }, { "type": "Integer", "description": "Number of users that voted for this option", diff --git a/.butcher/types/PreCheckoutQuery/entity.json b/.butcher/types/PreCheckoutQuery/entity.json index 5fb05a1c..9a8218e9 100644 --- a/.butcher/types/PreCheckoutQuery/entity.json +++ b/.butcher/types/PreCheckoutQuery/entity.json @@ -29,9 +29,9 @@ }, { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, diff --git a/.butcher/types/ReplyKeyboardMarkup/entity.json b/.butcher/types/ReplyKeyboardMarkup/entity.json index 366f7bc2..23f83ec3 100644 --- a/.butcher/types/ReplyKeyboardMarkup/entity.json +++ b/.butcher/types/ReplyKeyboardMarkup/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "replykeyboardmarkup", "name": "ReplyKeyboardMarkup", - "description": "This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).", - "html_description": "

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).

", - "rst_description": "This object represents a `custom keyboard `_ with reply options (see `Introduction to bots `_ for details and examples).", + "description": "This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.", + "html_description": "

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.

", + "rst_description": "This object represents a `custom keyboard `_ with reply options (see `Introduction to bots `_ for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.", "annotations": [ { "type": "Array of Array of KeyboardButton", diff --git a/.butcher/types/ReplyKeyboardRemove/entity.json b/.butcher/types/ReplyKeyboardRemove/entity.json index a1e5018c..48f49840 100644 --- a/.butcher/types/ReplyKeyboardRemove/entity.json +++ b/.butcher/types/ReplyKeyboardRemove/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "replykeyboardremove", "name": "ReplyKeyboardRemove", - "description": "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).", - "html_description": "

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).

", - "rst_description": "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`).", + "description": "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.", + "html_description": "

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.

", + "rst_description": "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`). Not supported in channels and for messages sent on behalf of a Telegram Business account.", "annotations": [ { "type": "True", diff --git a/.butcher/types/ReplyParameters/entity.json b/.butcher/types/ReplyParameters/entity.json index 1e7e2778..94a43e43 100644 --- a/.butcher/types/ReplyParameters/entity.json +++ b/.butcher/types/ReplyParameters/entity.json @@ -21,17 +21,17 @@ }, { "type": "Integer or String", - "description": "If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)", - "html_description": "Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)", - "rst_description": "*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)\n", + "description": "If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account.", + "html_description": "Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account.", + "rst_description": "*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`). Not supported for messages sent on behalf of a business account.\n", "name": "chat_id", "required": false }, { "type": "Boolean", - "description": "Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.", - "html_description": "Optional. Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.", - "rst_description": "*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.\n", + "description": "Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account.", + "html_description": "Optional. Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account.", + "rst_description": "*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found. Always :code:`False` for replies in another chat or forum topic. Always :code:`True` for messages sent on behalf of a business account.\n", "name": "allow_sending_without_reply", "required": false }, diff --git a/.butcher/types/SharedUser/entity.json b/.butcher/types/SharedUser/entity.json new file mode 100644 index 00000000..af99a0b4 --- /dev/null +++ b/.butcher/types/SharedUser/entity.json @@ -0,0 +1,57 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "shareduser", + "name": "SharedUser", + "description": "This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.", + "html_description": "

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.

", + "rst_description": "This object contains information about a user that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_users.KeyboardButtonRequestUsers` button.", + "annotations": [ + { + "type": "Integer", + "description": "Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.", + "html_description": "Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.", + "rst_description": "Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.\n", + "name": "user_id", + "required": true + }, + { + "type": "String", + "description": "First name of the user, if the name was requested by the bot", + "html_description": "Optional. First name of the user, if the name was requested by the bot", + "rst_description": "*Optional*. First name of the user, if the name was requested by the bot\n", + "name": "first_name", + "required": false + }, + { + "type": "String", + "description": "Last name of the user, if the name was requested by the bot", + "html_description": "Optional. Last name of the user, if the name was requested by the bot", + "rst_description": "*Optional*. Last name of the user, if the name was requested by the bot\n", + "name": "last_name", + "required": false + }, + { + "type": "String", + "description": "Username of the user, if the username was requested by the bot", + "html_description": "Optional. Username of the user, if the username was requested by the bot", + "rst_description": "*Optional*. Username of the user, if the username was requested by the bot\n", + "name": "username", + "required": false + }, + { + "type": "Array of PhotoSize", + "description": "Available sizes of the chat photo, if the photo was requested by the bot", + "html_description": "Optional. Available sizes of the chat photo, if the photo was requested by the bot", + "rst_description": "*Optional*. Available sizes of the chat photo, if the photo was requested by the bot\n", + "name": "photo", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/StickerSet/entity.json b/.butcher/types/StickerSet/entity.json index d74eb635..e9c1fe5b 100644 --- a/.butcher/types/StickerSet/entity.json +++ b/.butcher/types/StickerSet/entity.json @@ -35,22 +35,6 @@ "name": "sticker_type", "required": true }, - { - "type": "Boolean", - "description": "True, if the sticker set contains animated stickers", - "html_description": "True, if the sticker set contains animated stickers", - "rst_description": ":code:`True`, if the sticker set contains `animated stickers `_\n", - "name": "is_animated", - "required": true - }, - { - "type": "Boolean", - "description": "True, if the sticker set contains video stickers", - "html_description": "True, if the sticker set contains video stickers", - "rst_description": ":code:`True`, if the sticker set contains `video stickers `_\n", - "name": "is_video", - "required": true - }, { "type": "Array of Sticker", "description": "List of all set stickers", @@ -66,6 +50,30 @@ "rst_description": "*Optional*. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format\n", "name": "thumbnail", "required": false + }, + { + "type": "Boolean", + "description": "True, if the sticker set contains animated stickers", + "html_description": "True, if the sticker set contains animated stickers", + "rst_description": ":code:`True`, if the sticker set contains `animated stickers `_\n", + "name": "is_animated", + "required": false, + "deprecated": { + "version": "7.2", + "release_date": "2024-03-31" + } + }, + { + "type": "Boolean", + "description": "True, if the sticker set contains video stickers", + "html_description": "True, if the sticker set contains video stickers", + "rst_description": ":code:`True`, if the sticker set contains `video stickers `_\n", + "name": "is_video", + "required": false, + "deprecated": { + "version": "7.2", + "release_date": "2024-03-31" + } } ], "category": "types" diff --git a/.butcher/types/SuccessfulPayment/entity.json b/.butcher/types/SuccessfulPayment/entity.json index bbe8b21c..b555d08b 100644 --- a/.butcher/types/SuccessfulPayment/entity.json +++ b/.butcher/types/SuccessfulPayment/entity.json @@ -13,9 +13,9 @@ "annotations": [ { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, diff --git a/.butcher/types/Update/entity.json b/.butcher/types/Update/entity.json index 756fcb01..ce43e9f9 100644 --- a/.butcher/types/Update/entity.json +++ b/.butcher/types/Update/entity.json @@ -51,6 +51,38 @@ "name": "edited_channel_post", "required": false }, + { + "type": "BusinessConnection", + "description": "The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot", + "html_description": "Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot", + "rst_description": "*Optional*. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot\n", + "name": "business_connection", + "required": false + }, + { + "type": "Message", + "description": "New message from a connected business account", + "html_description": "Optional. New message from a connected business account", + "rst_description": "*Optional*. New message from a connected business account\n", + "name": "business_message", + "required": false + }, + { + "type": "Message", + "description": "New version of a message from a connected business account", + "html_description": "Optional. New version of a message from a connected business account", + "rst_description": "*Optional*. New version of a message from a connected business account\n", + "name": "edited_business_message", + "required": false + }, + { + "type": "BusinessMessagesDeleted", + "description": "Messages were deleted from a connected business account", + "html_description": "Optional. Messages were deleted from a connected business account", + "rst_description": "*Optional*. Messages were deleted from a connected business account\n", + "name": "deleted_business_messages", + "required": false + }, { "type": "MessageReactionUpdated", "description": "A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify \"message_reaction\" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.", diff --git a/.butcher/types/User/entity.json b/.butcher/types/User/entity.json index a753bb16..f502c62b 100644 --- a/.butcher/types/User/entity.json +++ b/.butcher/types/User/entity.json @@ -98,6 +98,14 @@ "rst_description": "*Optional*. :code:`True`, if the bot supports inline queries. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n", "name": "supports_inline_queries", "required": false + }, + { + "type": "Boolean", + "description": "True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.", + "html_description": "Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.", + "rst_description": "*Optional*. :code:`True`, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n", + "name": "can_connect_to_business", + "required": false } ], "category": "types" diff --git a/.butcher/types/UsersShared/entity.json b/.butcher/types/UsersShared/entity.json index a46f7ddf..e105e039 100644 --- a/.butcher/types/UsersShared/entity.json +++ b/.butcher/types/UsersShared/entity.json @@ -19,13 +19,25 @@ "name": "request_id", "required": true }, + { + "type": "Array of SharedUser", + "description": "Information about users shared with the bot.", + "html_description": "Information about users shared with the bot.", + "rst_description": "Information about users shared with the bot.\n", + "name": "users", + "required": true + }, { "type": "Array of Integer", "description": "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.", "html_description": "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.", "rst_description": "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.\n", "name": "user_ids", - "required": true + "required": false, + "deprecated": { + "version": "7.2", + "release_date": "2024-03-31" + } } ], "category": "types" diff --git a/.github/workflows/pull_request_changelog.yml b/.github/workflows/pull_request_changelog.yml index 9115e29a..c481bc9b 100644 --- a/.github/workflows/pull_request_changelog.yml +++ b/.github/workflows/pull_request_changelog.yml @@ -14,13 +14,13 @@ jobs: if: "!contains(github.event.pull_request.labels.*.name, 'skip news')" steps: - name: Checkout code - uses: actions/checkout@master + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: '0' - name: Set up Python 3.10 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: "3.10" diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 6991e206..7b3e86dd 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -10,10 +10,10 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 030da513..0d95be48 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,15 +44,18 @@ jobs: env: # Windows has some limitations: - # – Redis is not supported on GitHub Windows runners; + # – Redis and MongoDB is not supported on GitHub Windows runners; IS_WINDOWS: ${{ startswith(matrix.os, 'windows') }} + # MongoDB has some limitations: + # – MongoDB container action is only supported on Linux; + IS_UBUNTU: ${{ startswith(matrix.os, 'ubuntu') }} steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" @@ -60,11 +63,11 @@ jobs: - name: Install project dependencies run: | - pip install -e .[dev,test,redis,proxy,i18n,fast] + pip install -e .[dev,test,redis,mongo,proxy,i18n,fast] - name: Lint code run: | - ruff --output-format=github aiogram examples + ruff check --output-format=github aiogram examples mypy aiogram black --check --diff aiogram tests @@ -74,14 +77,24 @@ jobs: with: redis-version: 6 + - name: Setup mongodb + if: ${{ env.IS_UBUNTU == 'true' }} + uses: supercharge/mongodb-github-action@1.10.0 + with: + mongodb-version: '7.0' + mongodb-username: mongo + mongodb-password: mongo + mongodb-port: 27017 + - name: Run tests run: | flags="$flags --cov=aiogram --cov-config .coveragerc --cov-report=xml" [[ "$IS_WINDOWS" == "false" ]] && flags="$flags --redis redis://localhost:6379/0" + [[ "$IS_UBUNTU" == "true" ]] && flags="$flags --mongo mongodb://mongo:mongo@localhost:27017" pytest $flags - name: Upload coverage data - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml @@ -100,6 +113,7 @@ jobs: python-version: - 'pypy3.8' - 'pypy3.9' + - 'pypy3.10' defaults: # Windows sucks. Force use bash instead of PowerShell @@ -113,7 +127,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" @@ -121,12 +135,7 @@ jobs: - name: Install project dependencies run: | - pip install -e .[dev,test,redis,proxy,i18n,fast] - - - name: Setup redis - uses: shogo82148/actions-setup-redis@v1 - with: - redis-version: 6 + pip install -e .[dev,test,redis,mongo,proxy,i18n,fast] - name: Run tests run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bf00554d..c42ea91e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.6.0 hooks: - id: "trailing-whitespace" - id: "check-case-conflict" @@ -14,13 +14,12 @@ repos: - id: "check-json" - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 24.4.2 hooks: - id: black files: &files '^(aiogram|tests|examples)' - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.215' + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: 'v0.4.9' hooks: - id: ruff - args: [ "--force-exclude" ] diff --git a/.readthedocs.yml b/.readthedocs.yml index b61b3f17..90f0fc0a 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,7 +6,7 @@ build: python: "3.11" jobs: post_install: - - pip install .[docs,redis] + - pip install .[docs,redis,mongo] sphinx: configuration: docs/conf.py diff --git a/CHANGES.rst b/CHANGES.rst index 2dded341..2ed0a519 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,10 +12,116 @@ Changelog WARNING: Don't drop the next directive! -.. towncrier-draft-entries:: |release| [UNRELEASED DRAFT] +.. towncrier-draft-entries:: [UPCOMING UPDATE] .. towncrier release notes start +3.7.0 (2024-05-31) +=================== + +Features +-------- + +- Added new storage :code:`aiogram.fsm.storage.MongoStorage` for Finite State Machine based on Mongo DB (using :code:`motor` library) + `#1434 `_ +- Added full support of `Bot API 7.4 `_ + `#1498 `_ + + +Bugfixes +-------- + +- Fixed wrong :code:`MarkdownV2` custom emoji parsing in :code:`aiogram.utils.text_decorations` + `#1496 `_ + + +Deprecations and Removals +------------------------- + +- Removed deprecated arguments from Bot class + :code:`parse_mode`, :code:`disable_web_page_preview`, :code:`protect_content` as previously announced in v3.4.0. + `#1494 `_ + + +Misc +---- + +- Improved code consistency and readability in code examples by refactoring imports, adjusting the base webhook URL, modifying bot instance initialization to utilize DefaultBotProperties, and updating router message handlers. + `#1482 `_ + + +3.6.0 (2024-05-06) +=================== + +Features +-------- + +- Added full support of `Bot API 7.3 `_ + `#1480 `_ + + +Improved Documentation +---------------------- + +- Added telegram objects transformation block in 2.x -> 3.x migration guide + `#1412 `_ + + +3.5.0 (2024-04-23) +=================== + +Features +-------- + +- Added **message_thread_id** parameter to **ChatActionSender** class methods. + `#1437 `_ +- Added context manager interface to Bot instance, from now you can use: + + .. code-block:: python + + async with Bot(...) as bot: + ... + + instead of + + .. code-block:: python + + async with Bot(...).context() as bot: + ... + `#1468 `_ + + +Bugfixes +-------- + +- - **WebAppUser Class Fields**: Added missing `is_premium`, `added_to_attachment_menu`, and `allows_write_to_pm` fields to `WebAppUser` class to align with the Telegram API. + + - **WebAppChat Class Implementation**: Introduced the `WebAppChat` class with all its fields (`id`, `type`, `title`, `username`, and `photo_url`) as specified in the Telegram API, which was previously missing from the library. + + - **WebAppInitData Class Fields**: Included previously omitted fields in the `WebAppInitData` class: `chat`, `chat_type`, `chat_instance`, to match the official documentation for a complete Telegram Web Apps support. + `#1424 `_ +- Fixed poll answer FSM context by handling :code:`voter_chat` for :code:`poll_answer` event + `#1436 `_ +- Added missing error handling to :code:`_background_feed_update` (when in :code:`handle_in_background=True` webhook mode) + `#1458 `_ + + +Improved Documentation +---------------------- + +- Added WebAppChat class to WebApp docs, updated uk_UA localisation of WebApp docs. + `#1433 `_ + + +Misc +---- + +- Added full support of `Bot API 7.2 `_ + `#1444 `_ +- Loosened pydantic version upper restriction from ``<2.7`` to ``<2.8`` + `#1460 `_ + + 3.4.1 (2024-02-17) =================== diff --git a/CHANGES/1424.bugfix.rst b/CHANGES/1424.bugfix.rst deleted file mode 100644 index 3055f50d..00000000 --- a/CHANGES/1424.bugfix.rst +++ /dev/null @@ -1,5 +0,0 @@ -- **WebAppUser Class Fields**: Added missing `is_premium`, `added_to_attachment_menu`, and `allows_write_to_pm` fields to `WebAppUser` class to align with the Telegram API. - -- **WebAppChat Class Implementation**: Introduced the `WebAppChat` class with all its fields (`id`, `type`, `title`, `username`, and `photo_url`) as specified in the Telegram API, which was previously missing from the library. - -- **WebAppInitData Class Fields**: Included previously omitted fields in the `WebAppInitData` class: `chat`, `chat_type`, `chat_instance`, to match the official documentation for a complete Telegram Web Apps support. diff --git a/CHANGES/1433.doc.rst b/CHANGES/1433.doc.rst deleted file mode 100644 index 781304bb..00000000 --- a/CHANGES/1433.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Added WebAppChat class to WebApp docs, updated uk_UA localisation of WebApp docs. \ No newline at end of file diff --git a/CHANGES/1436.bugfix.rst b/CHANGES/1436.bugfix.rst deleted file mode 100644 index defb7d37..00000000 --- a/CHANGES/1436.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed poll answer FSM context by handling :code:`voter_chat` for :code:`poll_answer` event diff --git a/CHANGES/1437.feature.rst b/CHANGES/1437.feature.rst deleted file mode 100644 index e095f4e5..00000000 --- a/CHANGES/1437.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added **message_thread_id** parameter to **ChatActionSender** class methods. \ No newline at end of file diff --git a/CHANGES/1500.bugfix.rst b/CHANGES/1500.bugfix.rst new file mode 100644 index 00000000..23b78e8c --- /dev/null +++ b/CHANGES/1500.bugfix.rst @@ -0,0 +1 @@ +Increased DNS cache ttl setting to aiohttp session as a workaround for DNS resolution issues in aiohttp. diff --git a/CHANGES/1501.doc.rst b/CHANGES/1501.doc.rst new file mode 100644 index 00000000..780dd167 --- /dev/null +++ b/CHANGES/1501.doc.rst @@ -0,0 +1 @@ +Fixed MongoStorage section in the documentation by adding extra dependency to ReadTheDocs configuration. diff --git a/CHANGES/1504.doc.rst b/CHANGES/1504.doc.rst new file mode 100644 index 00000000..323ee342 --- /dev/null +++ b/CHANGES/1504.doc.rst @@ -0,0 +1 @@ +Added information about dependency changes to the :code:`2.x --> 3.x` migration guide. diff --git a/CHANGES/1510.misc.rst b/CHANGES/1510.misc.rst new file mode 100644 index 00000000..5a4fb587 --- /dev/null +++ b/CHANGES/1510.misc.rst @@ -0,0 +1,11 @@ +[Only for contributors] Fail redis and mongo tests if incorrect URI provided + some storages tests refactoring + +If incorrect URIs provided to "--redis" and/or "--mongo" options tests should fail with errors instead of skipping. +Otherwise the next scenario is possible: + 1) developer breaks RedisStorage and/or MongoStorage code + 2) tests are run with incorrect redis and/or mongo URIsprovided by "--redis" and "--mongo" options (for example, wrong port specified) + 3) tests pass because skipping doesn't fail tests run + 4) developer or reviewer doesn't notice that redis and/or mongo tests were skipped + 5) broken code gets in codebase + +Also some refactorings done (related with storages and storages tests). diff --git a/Makefile b/Makefile index 128ff5fe..41eaba49 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ code_dir := $(package_dir) $(tests_dir) $(scripts_dir) $(examples_dir) reports_dir := reports redis_connection := redis://localhost:6379 +mongo_connection := mongodb://mongo:mongo@localhost:27017 # ================================================================================================= # Environment @@ -25,6 +26,11 @@ clean: rm -f .coverage rm -rf {build,dist,site,.cache,.mypy_cache,.ruff_cache,reports} +.PHONY: install +install: clean + pip install -e ."[dev,test,docs]" -U --upgrade-strategy=eager + pre-commit install + # ================================================================================================= # Code quality # ================================================================================================= @@ -33,7 +39,7 @@ clean: lint: isort --check-only $(code_dir) black --check --diff $(code_dir) - ruff $(package_dir) + ruff check $(package_dir) $(examples_dir) mypy $(package_dir) .PHONY: reformat @@ -50,12 +56,12 @@ test-run-services: .PHONY: test test: test-run-services - pytest --cov=aiogram --cov-config .coveragerc tests/ --redis $(redis_connection) + pytest --cov=aiogram --cov-config .coveragerc tests/ --redis $(redis_connection) --mongo $(mongo_connection) .PHONY: test-coverage test-coverage: test-run-services mkdir -p $(reports_dir)/tests/ - pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/ --redis $(redis_connection) + pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/ --redis $(redis_connection) --mongo $(mongo_connection) coverage html -d $(reports_dir)/coverage .PHONY: test-coverage-view diff --git a/README.rst b/README.rst index 4ebf2f2d..cacc6908 100644 --- a/README.rst +++ b/README.rst @@ -35,7 +35,7 @@ aiogram :alt: Codecov **aiogram** is a modern and fully asynchronous framework for -`Telegram Bot API `_ written in Python 3.8 using +`Telegram Bot API `_ written in Python 3.8+ using `asyncio `_ and `aiohttp `_. @@ -52,7 +52,7 @@ Features - Asynchronous (`asyncio docs `_, :pep:`492`) - Has type hints (:pep:`484`) and can be used with `mypy `_ - Supports `PyPy `_ -- Supports `Telegram Bot API 7.1 `_ and gets fast updates to the latest versions of the Bot API +- Supports `Telegram Bot API 7.4 `_ and gets fast updates to the latest versions of the Bot API - Telegram Bot API integration code was `autogenerated `_ and can be easily re-generated when API gets updated - Updates router (Blueprints) - Has Finite State Machine diff --git a/aiogram/__meta__.py b/aiogram/__meta__.py index 3e6d24e8..008ad63f 100644 --- a/aiogram/__meta__.py +++ b/aiogram/__meta__.py @@ -1,2 +1,2 @@ -__version__ = "3.4.1" -__api_version__ = "7.1" +__version__ = "3.7.0" +__api_version__ = "7.4" diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index ab25a549..d083aa0c 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -3,8 +3,8 @@ from __future__ import annotations import datetime import io import pathlib -import warnings from contextlib import asynccontextmanager +from types import TracebackType from typing import ( Any, AsyncGenerator, @@ -12,6 +12,7 @@ from typing import ( BinaryIO, List, Optional, + Type, TypeVar, Union, cast, @@ -61,6 +62,7 @@ from ..methods import ( ExportChatInviteLink, ForwardMessage, ForwardMessages, + GetBusinessConnection, GetChat, GetChatAdministrators, GetChatMember, @@ -86,8 +88,10 @@ from ..methods import ( LogOut, PinChatMessage, PromoteChatMember, + RefundStarPayment, ReopenForumTopic, ReopenGeneralForumTopic, + ReplaceStickerInSet, RestrictChatMember, RevokeChatInviteLink, SendAnimation, @@ -155,8 +159,9 @@ from ..types import ( BotDescription, BotName, BotShortDescription, - Chat, + BusinessConnection, ChatAdministratorRights, + ChatFullInfo, ChatInviteLink, ChatMemberAdministrator, ChatMemberBanned, @@ -198,6 +203,7 @@ from ..types import ( InputMediaDocument, InputMediaPhoto, InputMediaVideo, + InputPollOption, InputSticker, LabeledPrice, LinkPreviewOptions, @@ -245,10 +251,8 @@ class Bot: self, token: str, session: Optional[BaseSession] = None, - parse_mode: Optional[str] = None, - disable_web_page_preview: Optional[bool] = None, - protect_content: Optional[bool] = None, default: Optional[DefaultBotProperties] = None, + **kwargs: Any, ) -> None: """ Bot class @@ -256,12 +260,6 @@ class Bot: :param token: Telegram Bot token `Obtained from @BotFather `_ :param session: HTTP Client session (For example AiohttpSession). If not specified it will be automatically created. - :param parse_mode: Default parse mode. - If specified it will be propagated into the API methods at runtime. - :param disable_web_page_preview: Default disable_web_page_preview mode. - If specified it will be propagated into the API methods at runtime. - :param protect_content: Default protect_content mode. - If specified it will be propagated into the API methods at runtime. :param default: Default bot properties. If specified it will be propagated into the API methods at runtime. :raise TokenValidationError: When token has invalid format this exception will be raised @@ -272,24 +270,33 @@ class Bot: if session is None: session = AiohttpSession() if default is None: - default = DefaultBotProperties( - parse_mode=parse_mode, - link_preview_is_disabled=disable_web_page_preview, - protect_content=protect_content, - ) + default = DefaultBotProperties() self.session = session + + # Few arguments are completely removed in 3.7.0 version + # Temporary solution to raise an error if user passed these arguments + # with explanation how to fix it + parse_mode = kwargs.get("parse_mode", None) + link_preview_is_disabled = kwargs.get("disable_web_page_preview", None) + protect_content = kwargs.get("protect_content", None) if ( parse_mode is not None - or disable_web_page_preview is not None + or link_preview_is_disabled is not None or protect_content is not None ): - warnings.warn( + example_kwargs = { + "parse_mode": parse_mode, + "link_preview_is_disabled": link_preview_is_disabled, + "protect_content": protect_content, + } + replacement_spec = ", ".join( + f"{k}={v!r}" for k, v in example_kwargs.items() if v is not None + ) + raise TypeError( "Passing `parse_mode`, `disable_web_page_preview` or `protect_content` " - "to Bot initializer is deprecated. This arguments will be removed in 3.7.0 version\n" - "Use `default=DefaultBotProperties(...)` instead.", - category=DeprecationWarning, - stacklevel=2, + "to Bot initializer is not supported anymore. These arguments have been removed " + f"in 3.7.0 version. Use `default=DefaultBotProperties({replacement_spec})` argument instead." ) self.default = default @@ -297,35 +304,16 @@ class Bot: self.__token = token self._me: Optional[User] = None - @property - def parse_mode(self) -> Optional[str]: - warnings.warn( - "Accessing `parse_mode` from Bot instance is deprecated. This attribute will be removed in 3.5.0 version\n" - "Use `bot.default.parse_mode` instead.", - category=DeprecationWarning, - stacklevel=2, - ) - return self.default.parse_mode + async def __aenter__(self) -> "Bot": + return self - @property - def disable_web_page_preview(self) -> Optional[bool]: - warnings.warn( - "Accessing `disable_web_page_preview` from Bot instance is deprecated. This attribute will be removed in 3.5.0 version\n" - "Use `bot.default.link_preview_is_disabled` instead.", - category=DeprecationWarning, - stacklevel=2, - ) - return self.default.link_preview_is_disabled - - @property - def protect_content(self) -> Optional[bool]: - warnings.warn( - "Accessing `protect_content` from Bot instance is deprecated. This attribute will be removed in 3.5.0 version\n" - "Use `bot.default.protect_content` instead.", - category=DeprecationWarning, - stacklevel=2, - ) - return self.default.protect_content + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> None: + await self.session.close() @property def token(self) -> str: @@ -518,7 +506,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success. + Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#addstickertoset @@ -858,6 +846,9 @@ class Bot: caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), reply_parameters: Optional[ReplyParameters] = None, @@ -880,10 +871,11 @@ class Bot: :param caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept :param parse_mode: Mode for parsing entities in the new caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode* + :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -898,6 +890,7 @@ class Bot: caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, protect_content=protect_content, reply_parameters=reply_parameters, @@ -973,9 +966,9 @@ class Bot: title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, provider_data: Optional[str] = None, @@ -1000,23 +993,23 @@ class Bot: :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: 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*. :param provider_data: 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. :param photo_url: URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param is_flexible: Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_. :param request_timeout: Request timeout :return: Returns the created invoice link as *String* on success. """ @@ -1025,9 +1018,9 @@ class Bot: title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, provider_data=provider_data, @@ -1051,9 +1044,9 @@ class Bot: name: str, title: str, stickers: List[InputSticker], - sticker_format: str, sticker_type: Optional[str] = None, needs_repainting: Optional[bool] = None, + sticker_format: Optional[str] = None, request_timeout: Optional[int] = None, ) -> bool: """ @@ -1065,9 +1058,9 @@ class Bot: :param name: 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. :param title: Sticker set title, 1-64 characters :param stickers: A JSON-serialized list of 1-50 initial stickers to be added to the sticker set - :param sticker_format: Format of stickers in the set, must be one of 'static', 'animated', 'video' :param sticker_type: Type of stickers in the set, pass 'regular', 'mask', or 'custom_emoji'. By default, a regular sticker set is created. :param needs_repainting: Pass :code:`True` if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only + :param sticker_format: Format of stickers in the set, must be one of 'static', 'animated', 'video' :param request_timeout: Request timeout :return: Returns :code:`True` on success. """ @@ -1077,9 +1070,9 @@ class Bot: name=name, title=title, stickers=stickers, - sticker_format=sticker_format, sticker_type=sticker_type, needs_repainting=needs_repainting, + sticker_format=sticker_format, ) return await self(call, request_timeout=request_timeout) @@ -1355,6 +1348,9 @@ class Bot: caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, request_timeout: Optional[int] = None, ) -> Union[Message, bool]: @@ -1369,6 +1365,7 @@ class Bot: :param caption: New caption of the message, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the message caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param 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. :param reply_markup: A JSON-serialized object for an `inline keyboard `_. :param request_timeout: Request timeout :return: 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. @@ -1381,6 +1378,7 @@ class Bot: caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, ) return await self(call, request_timeout=request_timeout) @@ -1392,6 +1390,7 @@ class Bot: chat_id: Optional[Union[int, str]] = None, message_id: Optional[int] = None, inline_message_id: Optional[str] = None, + live_period: Optional[int] = None, horizontal_accuracy: Optional[float] = None, heading: Optional[int] = None, proximity_alert_radius: Optional[int] = None, @@ -1408,6 +1407,7 @@ class Bot: :param chat_id: Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param message_id: Required if *inline_message_id* is not specified. Identifier of the message to edit :param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message + :param live_period: New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current *live_period* by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then *live_period* remains unchanged :param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500 :param heading: Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. :param proximity_alert_radius: The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. @@ -1422,6 +1422,7 @@ class Bot: chat_id=chat_id, message_id=message_id, inline_message_id=inline_message_id, + live_period=live_period, horizontal_accuracy=horizontal_accuracy, heading=heading, proximity_alert_radius=proximity_alert_radius, @@ -1603,15 +1604,15 @@ class Bot: self, chat_id: Union[int, str], request_timeout: Optional[int] = None, - ) -> Chat: + ) -> ChatFullInfo: """ - Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success. + Use this method to get up-to-date information about the chat. Returns a :class:`aiogram.types.chat_full_info.ChatFullInfo` object on success. Source: https://core.telegram.org/bots/api#getchat :param chat_id: Unique identifier for the target chat or username of the target supergroup or channel (in the format :code:`@channelusername`) :param request_timeout: Request timeout - :return: Returns a :class:`aiogram.types.chat.Chat` object on success. + :return: Returns a :class:`aiogram.types.chat_full_info.ChatFullInfo` object on success. """ call = GetChat( @@ -1728,7 +1729,7 @@ class Bot: Source: https://core.telegram.org/bots/api#getcustomemojistickers - :param custom_emoji_ids: List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. + :param custom_emoji_ids: A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. :param request_timeout: Request timeout :return: Returns an Array of :class:`aiogram.types.sticker.Sticker` objects. """ @@ -2071,12 +2072,12 @@ class Bot: :param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings :param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat :param can_post_stories: Pass :code:`True` if the administrator can post stories to the chat - :param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users + :param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive :param can_delete_stories: Pass :code:`True` if the administrator can delete stories posted by other users - :param can_post_messages: Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only - :param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only - :param can_pin_messages: Pass :code:`True` if the administrator can pin messages, supergroups only - :param can_manage_topics: Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only + :param can_post_messages: Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; for channels only + :param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages; for channels only + :param can_pin_messages: Pass :code:`True` if the administrator can pin messages; for supergroups only + :param can_manage_topics: Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only :param request_timeout: Request timeout :return: Returns :code:`True` on success. """ @@ -2184,6 +2185,7 @@ class Bot: self, chat_id: Union[int, str], animation: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -2192,9 +2194,13 @@ class Bot: caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2210,6 +2216,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent animation in seconds :param width: Animation width @@ -2218,11 +2225,13 @@ class Bot: :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -2232,6 +2241,7 @@ class Bot: call = SendAnimation( chat_id=chat_id, animation=animation, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -2240,9 +2250,11 @@ class Bot: caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2254,6 +2266,7 @@ class Bot: self, chat_id: Union[int, str], audio: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -2264,6 +2277,7 @@ class Bot: thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2280,6 +2294,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Audio caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the audio caption. See `formatting options `_ for more details. @@ -2290,8 +2305,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -2301,6 +2317,7 @@ class Bot: call = SendAudio( chat_id=chat_id, audio=audio, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -2311,6 +2328,7 @@ class Bot: thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2322,6 +2340,7 @@ class Bot: self, chat_id: Union[int, str], action: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> bool: @@ -2336,7 +2355,8 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param action: Type of action to broadcast. Choose one, depending on what the user is about to receive: *typing* for `text messages `_, *upload_photo* for `photos `_, *record_video* or *upload_video* for `videos `_, *record_voice* or *upload_voice* for `voice notes `_, *upload_document* for `general files `_, *choose_sticker* for `stickers `_, *find_location* for `location data `_, *record_video_note* or *upload_video_note* for `video notes `_. - :param message_thread_id: Unique identifier for the target message thread; supergroups only + :param business_connection_id: Unique identifier of the business connection on behalf of which the action will be sent + :param message_thread_id: Unique identifier for the target message thread; for supergroups only :param request_timeout: Request timeout :return: The user will see a 'sending photo' status for the bot. """ @@ -2344,6 +2364,7 @@ class Bot: call = SendChatAction( chat_id=chat_id, action=action, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, ) return await self(call, request_timeout=request_timeout) @@ -2353,11 +2374,13 @@ class Bot: chat_id: Union[int, str], phone_number: str, first_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, last_name: Optional[str] = None, vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2374,13 +2397,15 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param phone_number: Contact's phone number :param first_name: Contact's first name + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param last_name: Contact's last name :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -2391,11 +2416,13 @@ class Bot: chat_id=chat_id, phone_number=phone_number, first_name=first_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, last_name=last_name, vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2406,10 +2433,12 @@ class Bot: async def send_dice( self, chat_id: Union[int, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2424,12 +2453,14 @@ class Bot: Source: https://core.telegram.org/bots/api#senddice :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -2438,10 +2469,12 @@ class Bot: call = SendDice( chat_id=chat_id, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2453,6 +2486,7 @@ class Bot: self, chat_id: Union[int, str], document: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, thumbnail: Optional[InputFile] = None, caption: Optional[str] = None, @@ -2461,6 +2495,7 @@ class Bot: disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2476,6 +2511,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing @@ -2484,8 +2520,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -2495,6 +2532,7 @@ class Bot: call = SendDocument( chat_id=chat_id, document=document, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, thumbnail=thumbnail, caption=caption, @@ -2503,6 +2541,7 @@ class Bot: disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2514,9 +2553,11 @@ class Bot: self, chat_id: int, game_short_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -2530,9 +2571,11 @@ class Bot: :param chat_id: Unique identifier for the target chat :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2544,9 +2587,11 @@ class Bot: call = SendGame( chat_id=chat_id, game_short_name=game_short_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2560,10 +2605,10 @@ class Bot: title: str, description: str, payload: str, - provider_token: str, currency: str, 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, start_parameter: Optional[str] = None, @@ -2581,6 +2626,7 @@ class Bot: is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -2596,11 +2642,11 @@ class Bot: :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: 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*. :param start_parameter: 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 :param provider_data: 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. @@ -2608,15 +2654,16 @@ class Bot: :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2630,10 +2677,10 @@ class Bot: title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -2651,6 +2698,7 @@ class Bot: is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2663,6 +2711,7 @@ class Bot: chat_id: Union[int, str], latitude: float, longitude: float, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, horizontal_accuracy: Optional[float] = None, live_period: Optional[int] = None, @@ -2670,6 +2719,7 @@ class Bot: proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2686,15 +2736,17 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param latitude: Latitude of the location :param longitude: Longitude of the location + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500 - :param live_period: Period in seconds for which the location will be updated (see `Live Locations `_, should be between 60 and 86400. + :param live_period: Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. :param heading: For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -2705,6 +2757,7 @@ class Bot: chat_id=chat_id, latitude=latitude, longitude=longitude, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, horizontal_accuracy=horizontal_accuracy, live_period=live_period, @@ -2712,6 +2765,7 @@ class Bot: proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2723,9 +2777,11 @@ class Bot: self, chat_id: Union[int, str], 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"), + 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, @@ -2738,9 +2794,11 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -2751,9 +2809,11 @@ class Bot: call = SendMediaGroup( chat_id=chat_id, media=media, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -2764,6 +2824,7 @@ class Bot: self, chat_id: Union[int, str], text: str, + 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, @@ -2772,6 +2833,7 @@ class Bot: ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2790,14 +2852,16 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param text: Text of the message to be sent, 1-4096 characters after entities parsing + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* :param 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 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 reply keyboard or to force a reply from the user. + :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 :param disable_web_page_preview: Disables link previews for links in this message :param reply_to_message_id: If the message is a reply, ID of the original message @@ -2808,12 +2872,14 @@ class Bot: call = SendMessage( chat_id=chat_id, text=text, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2826,13 +2892,18 @@ class Bot: self, chat_id: Union[int, str], photo: Union[InputFile, str], + business_connection_id: Optional[str] = None, 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, + 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"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2848,15 +2919,18 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -2866,13 +2940,16 @@ class Bot: call = SendPhoto( chat_id=chat_id, photo=photo, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2884,8 +2961,11 @@ class Bot: self, chat_id: Union[int, str], question: str, - options: List[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, is_anonymous: Optional[bool] = None, type: Optional[str] = None, allows_multiple_answers: Optional[bool] = None, @@ -2898,6 +2978,7 @@ class Bot: is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2913,22 +2994,26 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param question: Poll question, 1-300 characters - :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each + :param options: A JSON-serialized list of 2-10 answer options + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param question_parse_mode: Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed + :param question_entities: A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode* :param is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True` :param type: Poll type, 'quiz' or 'regular', defaults to 'regular' :param allows_multiple_answers: :code:`True`, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False` :param correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode :param explanation: 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 :param explanation_parse_mode: Mode for parsing entities in the explanation. See `formatting options `_ for more details. - :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode* + :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode* :param open_period: Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*. :param close_date: Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -2939,7 +3024,10 @@ class Bot: chat_id=chat_id, question=question, options=options, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, + question_parse_mode=question_parse_mode, + question_entities=question_entities, is_anonymous=is_anonymous, type=type, allows_multiple_answers=allows_multiple_answers, @@ -2952,6 +3040,7 @@ class Bot: is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2963,10 +3052,12 @@ class Bot: self, chat_id: Union[int, str], sticker: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2981,13 +3072,15 @@ class Bot: Source: https://core.telegram.org/bots/api#sendsticker :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL. + :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL. + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -2997,10 +3090,12 @@ class Bot: call = SendSticker( chat_id=chat_id, sticker=sticker, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3015,6 +3110,7 @@ class Bot: longitude: float, title: str, address: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, foursquare_id: Optional[str] = None, foursquare_type: Optional[str] = None, @@ -3022,6 +3118,7 @@ class Bot: google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3040,6 +3137,7 @@ class Bot: :param longitude: Longitude of the venue :param title: Name of the venue :param address: Address of the venue + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param foursquare_id: Foursquare identifier of the venue :param foursquare_type: Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) @@ -3047,8 +3145,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -3061,6 +3160,7 @@ class Bot: longitude=longitude, title=title, address=address, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, foursquare_id=foursquare_id, foursquare_type=foursquare_type, @@ -3068,6 +3168,7 @@ class Bot: google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3079,6 +3180,7 @@ class Bot: self, chat_id: Union[int, str], video: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -3087,10 +3189,14 @@ class Bot: caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3106,6 +3212,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent video in seconds :param width: Video width @@ -3114,12 +3221,14 @@ class Bot: :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -3129,6 +3238,7 @@ class Bot: call = SendVideo( chat_id=chat_id, video=video, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -3137,10 +3247,12 @@ class Bot: caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3152,12 +3264,14 @@ class Bot: self, chat_id: Union[int, str], video_note: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, length: Optional[int] = None, thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3173,14 +3287,16 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `. Sending video notes by a URL is currently unsupported + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent video in seconds :param length: Video width and height, i.e. diameter of the video message :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -3190,12 +3306,14 @@ class Bot: call = SendVideoNote( chat_id=chat_id, video_note=video_note, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, length=length, thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3207,6 +3325,7 @@ class Bot: self, chat_id: Union[int, str], voice: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -3214,6 +3333,7 @@ class Bot: duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3223,12 +3343,13 @@ class Bot: request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvoice :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Voice message caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the voice message caption. See `formatting options `_ for more details. @@ -3236,8 +3357,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout @@ -3247,6 +3369,7 @@ class Bot: call = SendVoice( chat_id=chat_id, voice=voice, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -3254,6 +3377,7 @@ class Bot: duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3812,7 +3936,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> File: """ - Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet` and :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success. + Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet`, :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, or :class:`aiogram.methods.replace_sticker_in_set.ReplaceStickerInSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success. Source: https://core.telegram.org/bots/api#uploadstickerfile @@ -4135,6 +4259,7 @@ class Bot: self, name: str, user_id: int, + format: str, thumbnail: Optional[Union[InputFile, str]] = None, request_timeout: Optional[int] = None, ) -> bool: @@ -4145,6 +4270,7 @@ class Bot: :param name: Sticker set name :param user_id: User identifier of the sticker set owner + :param format: Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **WEBM** video :param thumbnail: A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animated-sticker-requirements `_`https://core.telegram.org/stickers#animated-sticker-requirements `_ for animated sticker technical requirements), or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements `_`https://core.telegram.org/stickers#video-sticker-requirements `_ for video sticker technical requirements. 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, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail. :param request_timeout: Request timeout :return: Returns :code:`True` on success. @@ -4153,6 +4279,7 @@ class Bot: call = SetStickerSetThumbnail( name=name, user_id=user_id, + format=format, thumbnail=thumbnail, ) return await self(call, request_timeout=request_timeout) @@ -4261,7 +4388,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param from_chat_id: Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`) - :param message_ids: Identifiers of 1-100 messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order. + :param message_ids: A JSON-serialized list of 1-100 identifiers of messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving @@ -4293,7 +4420,7 @@ class Bot: Source: https://core.telegram.org/bots/api#deletemessages :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param message_ids: Identifiers of 1-100 messages to delete. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted + :param message_ids: 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 :param request_timeout: Request timeout :return: Returns :code:`True` on success. """ @@ -4321,7 +4448,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param from_chat_id: Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`) - :param message_ids: Identifiers of 1-100 messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order. + :param message_ids: A JSON-serialized list of 1-100 identifiers of messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the forwarded messages from forwarding and saving @@ -4377,7 +4504,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param message_id: 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. - :param reaction: New 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. + :param reaction: 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. :param is_big: Pass :code:`True` to set the reaction with a big animation :param request_timeout: Request timeout :return: Returns :code:`True` on success. @@ -4390,3 +4517,75 @@ class Bot: is_big=is_big, ) return await self(call, request_timeout=request_timeout) + + async def get_business_connection( + self, + business_connection_id: str, + request_timeout: Optional[int] = None, + ) -> BusinessConnection: + """ + Use this method to get information about the connection of the bot with a business account. Returns a :class:`aiogram.types.business_connection.BusinessConnection` object on success. + + Source: https://core.telegram.org/bots/api#getbusinessconnection + + :param business_connection_id: Unique identifier of the business connection + :param request_timeout: Request timeout + :return: Returns a :class:`aiogram.types.business_connection.BusinessConnection` object on success. + """ + + call = GetBusinessConnection( + business_connection_id=business_connection_id, + ) + return await self(call, request_timeout=request_timeout) + + async def replace_sticker_in_set( + self, + user_id: int, + name: str, + old_sticker: str, + sticker: InputSticker, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling :class:`aiogram.methods.delete_sticker_from_set.DeleteStickerFromSet`, then :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, then :class:`aiogram.methods.set_sticker_position_in_set.SetStickerPositionInSet`. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#replacestickerinset + + :param user_id: User identifier of the sticker set owner + :param name: Sticker set name + :param old_sticker: File identifier of the replaced sticker + :param sticker: A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged. + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = ReplaceStickerInSet( + user_id=user_id, + name=name, + old_sticker=old_sticker, + sticker=sticker, + ) + return await self(call, request_timeout=request_timeout) + + async def refund_star_payment( + self, + user_id: int, + telegram_payment_charge_id: str, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Refunds a successful payment in `Telegram Stars `_. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#refundstarpayment + + :param user_id: Identifier of the user whose payment will be refunded + :param telegram_payment_charge_id: Telegram payment identifier + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = RefundStarPayment( + user_id=user_id, + telegram_payment_charge_id=telegram_payment_charge_id, + ) + return await self(call, request_timeout=request_timeout) diff --git a/aiogram/client/default.py b/aiogram/client/default.py index 74954e52..6c857be0 100644 --- a/aiogram/client/default.py +++ b/aiogram/client/default.py @@ -58,6 +58,8 @@ class DefaultBotProperties: """Prefer large media in link preview.""" link_preview_show_above_text: Optional[bool] = None """Show link preview above text.""" + show_caption_above_media: Optional[bool] = None + """Show caption above media.""" def __post_init__(self) -> None: has_any_link_preview_option = any( diff --git a/aiogram/client/session/aiohttp.py b/aiogram/client/session/aiohttp.py index 0878e315..9e1d9e1b 100644 --- a/aiogram/client/session/aiohttp.py +++ b/aiogram/client/session/aiohttp.py @@ -23,11 +23,10 @@ from aiohttp.http import SERVER_SOFTWARE from aiogram.__meta__ import __version__ from aiogram.methods import TelegramMethod - +from .base import BaseSession from ...exceptions import TelegramNetworkError from ...methods.base import TelegramType from ...types import InputFile -from .base import BaseSession if TYPE_CHECKING: from ..bot import Bot @@ -86,13 +85,24 @@ def _prepare_connector(chain_or_plain: _ProxyType) -> Tuple[Type["TCPConnector"] class AiohttpSession(BaseSession): - def __init__(self, proxy: Optional[_ProxyType] = None, **kwargs: Any) -> None: + def __init__( + self, proxy: Optional[_ProxyType] = None, limit: int = 100, **kwargs: Any + ) -> None: + """ + Client session based on aiohttp. + + :param proxy: The proxy to be used for requests. Default is None. + :param limit: The total number of simultaneous connections. Default is 100. + :param kwargs: Additional keyword arguments. + """ super().__init__(**kwargs) self._session: Optional[ClientSession] = None self._connector_type: Type[TCPConnector] = TCPConnector self._connector_init: Dict[str, Any] = { "ssl": ssl.create_default_context(cafile=certifi.where()), + "limit": limit, + "ttl_dns_cache": 3600, # Workaround for https://github.com/aiogram/aiogram/issues/1500 } self._should_reset_connector = True # flag determines connector state self._proxy: Optional[_ProxyType] = None diff --git a/aiogram/client/session/middlewares/manager.py b/aiogram/client/session/middlewares/manager.py index 78015309..2346715f 100644 --- a/aiogram/client/session/middlewares/manager.py +++ b/aiogram/client/session/middlewares/manager.py @@ -27,7 +27,10 @@ class RequestMiddlewareManager(Sequence[RequestMiddlewareType]): def __call__( self, middleware: Optional[RequestMiddlewareType] = None, - ) -> Union[Callable[[RequestMiddlewareType], RequestMiddlewareType], RequestMiddlewareType,]: + ) -> Union[ + Callable[[RequestMiddlewareType], RequestMiddlewareType], + RequestMiddlewareType, + ]: if middleware is None: return self.register return self.register(middleware) diff --git a/aiogram/dispatcher/dispatcher.py b/aiogram/dispatcher/dispatcher.py index 4aa61a47..8b6987cb 100644 --- a/aiogram/dispatcher/dispatcher.py +++ b/aiogram/dispatcher/dispatcher.py @@ -186,7 +186,7 @@ class Dispatcher(Router): :param kwargs: """ parsed_update = Update.model_validate(update, context={"bot": bot}) - return await self.feed_update(bot=bot, update=parsed_update, **kwargs) + return await self._feed_webhook_update(bot=bot, update=parsed_update, **kwargs) @classmethod async def _listen_updates( diff --git a/aiogram/dispatcher/middlewares/manager.py b/aiogram/dispatcher/middlewares/manager.py index a63e1ef4..bcad4dee 100644 --- a/aiogram/dispatcher/middlewares/manager.py +++ b/aiogram/dispatcher/middlewares/manager.py @@ -61,5 +61,5 @@ class MiddlewareManager(Sequence[MiddlewareType[TelegramObject]]): middleware = handler_wrapper for m in reversed(middlewares): - middleware = functools.partial(m, middleware) + middleware = functools.partial(m, middleware) # type: ignore[assignment] return middleware diff --git a/aiogram/dispatcher/middlewares/user_context.py b/aiogram/dispatcher/middlewares/user_context.py index 87c38147..c257079f 100644 --- a/aiogram/dispatcher/middlewares/user_context.py +++ b/aiogram/dispatcher/middlewares/user_context.py @@ -1,13 +1,32 @@ -from typing import Any, Awaitable, Callable, Dict, Optional, Tuple +from dataclasses import dataclass +from typing import Any, Awaitable, Callable, Dict, Optional from aiogram.dispatcher.middlewares.base import BaseMiddleware from aiogram.types import Chat, InaccessibleMessage, TelegramObject, Update, User +EVENT_CONTEXT_KEY = "event_context" + EVENT_FROM_USER_KEY = "event_from_user" EVENT_CHAT_KEY = "event_chat" EVENT_THREAD_ID_KEY = "event_thread_id" +@dataclass(frozen=True) +class EventContext: + chat: Optional[Chat] = None + user: Optional[User] = None + thread_id: Optional[int] = None + business_connection_id: Optional[str] = None + + @property + def user_id(self) -> Optional[int]: + return self.user.id if self.user else None + + @property + def chat_id(self) -> Optional[int]: + return self.chat.id if self.chat else None + + class UserContextMiddleware(BaseMiddleware): async def __call__( self, @@ -17,73 +36,122 @@ class UserContextMiddleware(BaseMiddleware): ) -> Any: if not isinstance(event, Update): raise RuntimeError("UserContextMiddleware got an unexpected event type!") - chat, user, thread_id = self.resolve_event_context(event=event) - if user is not None: - data[EVENT_FROM_USER_KEY] = user - if chat is not None: - data[EVENT_CHAT_KEY] = chat - if thread_id is not None: - data[EVENT_THREAD_ID_KEY] = thread_id + event_context = data[EVENT_CONTEXT_KEY] = self.resolve_event_context(event=event) + + # Backward compatibility + if event_context.user is not None: + data[EVENT_FROM_USER_KEY] = event_context.user + if event_context.chat is not None: + data[EVENT_CHAT_KEY] = event_context.chat + if event_context.thread_id is not None: + data[EVENT_THREAD_ID_KEY] = event_context.thread_id + return await handler(event, data) @classmethod - def resolve_event_context( - cls, event: Update - ) -> Tuple[Optional[Chat], Optional[User], Optional[int]]: + def resolve_event_context(cls, event: Update) -> EventContext: """ Resolve chat and user instance from Update object """ if event.message: - return ( - event.message.chat, - event.message.from_user, - event.message.message_thread_id if event.message.is_topic_message else None, + return EventContext( + chat=event.message.chat, + user=event.message.from_user, + thread_id=( + event.message.message_thread_id if event.message.is_topic_message else None + ), ) if event.edited_message: - return ( - event.edited_message.chat, - event.edited_message.from_user, - event.edited_message.message_thread_id - if event.edited_message.is_topic_message - else None, + return EventContext( + chat=event.edited_message.chat, + user=event.edited_message.from_user, + thread_id=( + event.edited_message.message_thread_id + if event.edited_message.is_topic_message + else None + ), ) if event.channel_post: - return event.channel_post.chat, None, None + return EventContext(chat=event.channel_post.chat) if event.edited_channel_post: - return event.edited_channel_post.chat, None, None + return EventContext(chat=event.edited_channel_post.chat) if event.inline_query: - return None, event.inline_query.from_user, None + return EventContext(user=event.inline_query.from_user) if event.chosen_inline_result: - return None, event.chosen_inline_result.from_user, None + return EventContext(user=event.chosen_inline_result.from_user) if event.callback_query: if event.callback_query.message: - return ( - event.callback_query.message.chat, - event.callback_query.from_user, - event.callback_query.message.message_thread_id - if not isinstance(event.callback_query.message, InaccessibleMessage) - and event.callback_query.message.is_topic_message - else None, + return EventContext( + chat=event.callback_query.message.chat, + user=event.callback_query.from_user, + thread_id=( + event.callback_query.message.message_thread_id + if not isinstance(event.callback_query.message, InaccessibleMessage) + and event.callback_query.message.is_topic_message + else None + ), ) - return None, event.callback_query.from_user, None + return EventContext(user=event.callback_query.from_user) if event.shipping_query: - return None, event.shipping_query.from_user, None + return EventContext(user=event.shipping_query.from_user) if event.pre_checkout_query: - return None, event.pre_checkout_query.from_user, None + return EventContext(user=event.pre_checkout_query.from_user) if event.poll_answer: - return event.poll_answer.voter_chat, event.poll_answer.user, None + return EventContext( + chat=event.poll_answer.voter_chat, + user=event.poll_answer.user, + ) if event.my_chat_member: - return event.my_chat_member.chat, event.my_chat_member.from_user, None + return EventContext( + chat=event.my_chat_member.chat, user=event.my_chat_member.from_user + ) if event.chat_member: - return event.chat_member.chat, event.chat_member.from_user, None + return EventContext(chat=event.chat_member.chat, user=event.chat_member.from_user) if event.chat_join_request: - return event.chat_join_request.chat, event.chat_join_request.from_user, None + return EventContext( + chat=event.chat_join_request.chat, user=event.chat_join_request.from_user + ) if event.message_reaction: - return event.message_reaction.chat, event.message_reaction.user, None + return EventContext( + chat=event.message_reaction.chat, + user=event.message_reaction.user, + ) if event.message_reaction_count: - return event.message_reaction_count.chat, None, None + return EventContext(chat=event.message_reaction_count.chat) if event.chat_boost: - return event.chat_boost.chat, None, None + return EventContext(chat=event.chat_boost.chat) if event.removed_chat_boost: - return event.removed_chat_boost.chat, None, None - return None, None, None + return EventContext(chat=event.removed_chat_boost.chat) + if event.deleted_business_messages: + return EventContext( + chat=event.deleted_business_messages.chat, + business_connection_id=event.deleted_business_messages.business_connection_id, + ) + if event.business_connection: + return EventContext( + user=event.business_connection.user, + business_connection_id=event.business_connection.id, + ) + if event.business_message: + return EventContext( + chat=event.business_message.chat, + user=event.business_message.from_user, + thread_id=( + event.business_message.message_thread_id + if event.business_message.is_topic_message + else None + ), + business_connection_id=event.business_message.business_connection_id, + ) + if event.edited_business_message: + return EventContext( + chat=event.edited_business_message.chat, + user=event.edited_business_message.from_user, + thread_id=( + event.edited_business_message.message_thread_id + if event.edited_business_message.is_topic_message + else None + ), + business_connection_id=event.edited_business_message.business_connection_id, + ) + return EventContext() diff --git a/aiogram/dispatcher/router.py b/aiogram/dispatcher/router.py index c8ea9788..400c1c09 100644 --- a/aiogram/dispatcher/router.py +++ b/aiogram/dispatcher/router.py @@ -60,6 +60,16 @@ class Router: self.removed_chat_boost = TelegramEventObserver( router=self, event_name="removed_chat_boost" ) + self.deleted_business_messages = TelegramEventObserver( + router=self, event_name="deleted_business_messages" + ) + self.business_connection = TelegramEventObserver( + router=self, event_name="business_connection" + ) + self.edited_business_message = TelegramEventObserver( + router=self, event_name="edited_business_message" + ) + self.business_message = TelegramEventObserver(router=self, event_name="business_message") self.errors = self.error = TelegramEventObserver(router=self, event_name="error") @@ -85,6 +95,10 @@ class Router: "message_reaction_count": self.message_reaction_count, "chat_boost": self.chat_boost, "removed_chat_boost": self.removed_chat_boost, + "deleted_business_messages": self.deleted_business_messages, + "business_connection": self.business_connection, + "edited_business_message": self.edited_business_message, + "business_message": self.business_message, "error": self.errors, } diff --git a/aiogram/enums/content_type.py b/aiogram/enums/content_type.py index dee0bc4c..4f631a62 100644 --- a/aiogram/enums/content_type.py +++ b/aiogram/enums/content_type.py @@ -18,7 +18,6 @@ class ContentType(str, Enum): VIDEO = "video" VIDEO_NOTE = "video_note" VOICE = "voice" - HAS_MEDIA_SPOILER = "has_media_spoiler" CONTACT = "contact" DICE = "dice" GAME = "game" @@ -46,6 +45,7 @@ class ContentType(str, Enum): PASSPORT_DATA = "passport_data" PROXIMITY_ALERT_TRIGGERED = "proximity_alert_triggered" BOOST_ADDED = "boost_added" + CHAT_BACKGROUND_SET = "chat_background_set" FORUM_TOPIC_CREATED = "forum_topic_created" FORUM_TOPIC_EDITED = "forum_topic_edited" FORUM_TOPIC_CLOSED = "forum_topic_closed" diff --git a/aiogram/enums/message_entity_type.py b/aiogram/enums/message_entity_type.py index 81bddd81..b67dc039 100644 --- a/aiogram/enums/message_entity_type.py +++ b/aiogram/enums/message_entity_type.py @@ -21,6 +21,7 @@ class MessageEntityType(str, Enum): STRIKETHROUGH = "strikethrough" SPOILER = "spoiler" BLOCKQUOTE = "blockquote" + EXPANDABLE_BLOCKQUOTE = "expandable_blockquote" CODE = "code" PRE = "pre" TEXT_LINK = "text_link" diff --git a/aiogram/enums/update_type.py b/aiogram/enums/update_type.py index 3571a457..16fe0e2c 100644 --- a/aiogram/enums/update_type.py +++ b/aiogram/enums/update_type.py @@ -12,6 +12,10 @@ class UpdateType(str, Enum): EDITED_MESSAGE = "edited_message" CHANNEL_POST = "channel_post" EDITED_CHANNEL_POST = "edited_channel_post" + BUSINESS_CONNECTION = "business_connection" + BUSINESS_MESSAGE = "business_message" + EDITED_BUSINESS_MESSAGE = "edited_business_message" + DELETED_BUSINESS_MESSAGES = "deleted_business_messages" MESSAGE_REACTION = "message_reaction" MESSAGE_REACTION_COUNT = "message_reaction_count" INLINE_QUERY = "inline_query" diff --git a/aiogram/filters/command.py b/aiogram/filters/command.py index 6e654531..f52ac263 100644 --- a/aiogram/filters/command.py +++ b/aiogram/filters/command.py @@ -24,7 +24,8 @@ from aiogram.utils.deep_linking import decode_payload if TYPE_CHECKING: from aiogram import Bot -CommandPatternType = Union[str, re.Pattern, BotCommand] +# TODO: rm type ignore after py3.8 support expiration or mypy bug fix +CommandPatternType = Union[str, re.Pattern, BotCommand] # type: ignore[type-arg] class CommandException(Exception): diff --git a/aiogram/filters/magic_data.py b/aiogram/filters/magic_data.py index 5b3c31d7..5c0d474f 100644 --- a/aiogram/filters/magic_data.py +++ b/aiogram/filters/magic_data.py @@ -11,7 +11,7 @@ class MagicData(Filter): This filter helps to filter event with contextual data """ - __slots__ = "magic_data" + __slots__ = ("magic_data",) def __init__(self, magic_data: MagicFilter) -> None: self.magic_data = magic_data diff --git a/aiogram/fsm/middleware.py b/aiogram/fsm/middleware.py index d1f1d973..de934574 100644 --- a/aiogram/fsm/middleware.py +++ b/aiogram/fsm/middleware.py @@ -2,6 +2,7 @@ from typing import Any, Awaitable, Callable, Dict, Optional, cast from aiogram import Bot from aiogram.dispatcher.middlewares.base import BaseMiddleware +from aiogram.dispatcher.middlewares.user_context import EVENT_CONTEXT_KEY, EventContext from aiogram.fsm.context import FSMContext from aiogram.fsm.storage.base import ( DEFAULT_DESTINY, @@ -47,16 +48,13 @@ class FSMContextMiddleware(BaseMiddleware): data: Dict[str, Any], destiny: str = DEFAULT_DESTINY, ) -> Optional[FSMContext]: - user = data.get("event_from_user") - chat = data.get("event_chat") - thread_id = data.get("event_thread_id") - chat_id = chat.id if chat else None - user_id = user.id if user else None + event_context: EventContext = cast(EventContext, data.get(EVENT_CONTEXT_KEY)) return self.resolve_context( bot=bot, - chat_id=chat_id, - user_id=user_id, - thread_id=thread_id, + chat_id=event_context.chat_id, + user_id=event_context.user_id, + thread_id=event_context.thread_id, + business_connection_id=event_context.business_connection_id, destiny=destiny, ) @@ -66,6 +64,7 @@ class FSMContextMiddleware(BaseMiddleware): chat_id: Optional[int], user_id: Optional[int], thread_id: Optional[int] = None, + business_connection_id: Optional[str] = None, destiny: str = DEFAULT_DESTINY, ) -> Optional[FSMContext]: if chat_id is None: @@ -83,6 +82,7 @@ class FSMContextMiddleware(BaseMiddleware): chat_id=chat_id, user_id=user_id, thread_id=thread_id, + business_connection_id=business_connection_id, destiny=destiny, ) return None @@ -93,6 +93,7 @@ class FSMContextMiddleware(BaseMiddleware): chat_id: int, user_id: int, thread_id: Optional[int] = None, + business_connection_id: Optional[str] = None, destiny: str = DEFAULT_DESTINY, ) -> FSMContext: return FSMContext( @@ -102,6 +103,7 @@ class FSMContextMiddleware(BaseMiddleware): chat_id=chat_id, bot_id=bot.id, thread_id=thread_id, + business_connection_id=business_connection_id, destiny=destiny, ), ) diff --git a/aiogram/fsm/storage/base.py b/aiogram/fsm/storage/base.py index 52cb62f2..8e1b206f 100644 --- a/aiogram/fsm/storage/base.py +++ b/aiogram/fsm/storage/base.py @@ -1,7 +1,7 @@ from abc import ABC, abstractmethod from contextlib import asynccontextmanager from dataclasses import dataclass -from typing import Any, AsyncGenerator, Dict, Optional, Union +from typing import Any, AsyncGenerator, Dict, Literal, Optional, Union from aiogram.fsm.state import State @@ -16,9 +16,89 @@ class StorageKey: chat_id: int user_id: int thread_id: Optional[int] = None + business_connection_id: Optional[str] = None destiny: str = DEFAULT_DESTINY +class KeyBuilder(ABC): + """Base class for key builder.""" + + @abstractmethod + def build( + self, + key: StorageKey, + part: Optional[Literal["data", "state", "lock"]] = None, + ) -> str: + """ + Build key to be used in storage's db queries + + :param key: contextual key + :param part: part of the record + :return: key to be used in storage's db queries + """ + pass + + +class DefaultKeyBuilder(KeyBuilder): + """ + Simple key builder with default prefix. + + Generates a colon-joined string with prefix, chat_id, user_id, + optional bot_id, business_connection_id, destiny and field. + + Format: + :code:`::::::` + """ + + def __init__( + self, + *, + prefix: str = "fsm", + separator: str = ":", + with_bot_id: bool = False, + with_business_connection_id: bool = False, + with_destiny: bool = False, + ) -> None: + """ + :param prefix: prefix for all records + :param separator: separator + :param with_bot_id: include Bot id in the key + :param with_business_connection_id: include business connection id + :param with_destiny: include destiny key + """ + self.prefix = prefix + self.separator = separator + self.with_bot_id = with_bot_id + self.with_business_connection_id = with_business_connection_id + self.with_destiny = with_destiny + + def build( + self, + key: StorageKey, + part: Optional[Literal["data", "state", "lock"]] = None, + ) -> str: + parts = [self.prefix] + if self.with_bot_id: + parts.append(str(key.bot_id)) + if self.with_business_connection_id and key.business_connection_id: + parts.append(str(key.business_connection_id)) + parts.append(str(key.chat_id)) + if key.thread_id: + parts.append(str(key.thread_id)) + parts.append(str(key.user_id)) + if self.with_destiny: + parts.append(key.destiny) + elif key.destiny != DEFAULT_DESTINY: + error_message = ( + "Default key builder is not configured to use key destiny other than the default." + "\n\nProbably, you should set `with_destiny=True` in for DefaultKeyBuilder." + ) + raise ValueError(error_message) + if part: + parts.append(part) + return self.separator.join(parts) + + class BaseStorage(ABC): """ Base class for all FSM storages diff --git a/aiogram/fsm/storage/mongo.py b/aiogram/fsm/storage/mongo.py new file mode 100644 index 00000000..b4b1eeaa --- /dev/null +++ b/aiogram/fsm/storage/mongo.py @@ -0,0 +1,130 @@ +from typing import Any, Dict, Optional, cast + +from motor.motor_asyncio import AsyncIOMotorClient + +from aiogram.fsm.state import State +from aiogram.fsm.storage.base import ( + BaseStorage, + DefaultKeyBuilder, + KeyBuilder, + StateType, + StorageKey, +) + + +class MongoStorage(BaseStorage): + """ + MongoDB storage required :code:`motor` package installed (:code:`pip install motor`) + """ + + def __init__( + self, + client: AsyncIOMotorClient, + key_builder: Optional[KeyBuilder] = None, + db_name: str = "aiogram_fsm", + collection_name: str = "states_and_data", + ) -> None: + """ + :param client: Instance of AsyncIOMotorClient + :param key_builder: builder that helps to convert contextual key to string + :param db_name: name of the MongoDB database for FSM + :param collection_name: name of the collection for storing FSM states and data + """ + if key_builder is None: + key_builder = DefaultKeyBuilder() + self._client = client + self._database = self._client[db_name] + self._collection = self._database[collection_name] + self._key_builder = key_builder + + @classmethod + def from_url( + cls, url: str, connection_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any + ) -> "MongoStorage": + """ + Create an instance of :class:`MongoStorage` with specifying the connection string + + :param url: for example :code:`mongodb://user:password@host:port` + :param connection_kwargs: see :code:`motor` docs + :param kwargs: arguments to be passed to :class:`MongoStorage` + :return: an instance of :class:`MongoStorage` + """ + if connection_kwargs is None: + connection_kwargs = {} + client = AsyncIOMotorClient(url, **connection_kwargs) + return cls(client=client, **kwargs) + + async def close(self) -> None: + """Cleanup client resources and disconnect from MongoDB.""" + self._client.close() + + def resolve_state(self, value: StateType) -> Optional[str]: + if value is None: + return None + if isinstance(value, State): + return value.state + return str(value) + + async def set_state(self, key: StorageKey, state: StateType = None) -> None: + document_id = self._key_builder.build(key) + if state is None: + updated = await self._collection.find_one_and_update( + filter={"_id": document_id}, + update={"$unset": {"state": 1}}, + projection={"_id": 0}, + return_document=True, + ) + if updated == {}: + await self._collection.delete_one({"_id": document_id}) + else: + await self._collection.update_one( + filter={"_id": document_id}, + update={"$set": {"state": self.resolve_state(state)}}, + upsert=True, + ) + + async def get_state(self, key: StorageKey) -> Optional[str]: + document_id = self._key_builder.build(key) + document = await self._collection.find_one({"_id": document_id}) + if document is None: + return None + return document.get("state") + + async def set_data(self, key: StorageKey, data: Dict[str, Any]) -> None: + document_id = self._key_builder.build(key) + if not data: + updated = await self._collection.find_one_and_update( + filter={"_id": document_id}, + update={"$unset": {"data": 1}}, + projection={"_id": 0}, + return_document=True, + ) + if updated == {}: + await self._collection.delete_one({"_id": document_id}) + else: + await self._collection.update_one( + filter={"_id": document_id}, + update={"$set": {"data": data}}, + upsert=True, + ) + + async def get_data(self, key: StorageKey) -> Dict[str, Any]: + document_id = self._key_builder.build(key) + document = await self._collection.find_one({"_id": document_id}) + if document is None or not document.get("data"): + return {} + return cast(Dict[str, Any], document["data"]) + + async def update_data(self, key: StorageKey, data: Dict[str, Any]) -> Dict[str, Any]: + document_id = self._key_builder.build(key) + update_with = {f"data.{key}": value for key, value in data.items()} + update_result = await self._collection.find_one_and_update( + filter={"_id": document_id}, + update={"$set": update_with}, + upsert=True, + return_document=True, + projection={"_id": 0}, + ) + if not update_result: + await self._collection.delete_one({"_id": document_id}) + return update_result.get("data", {}) diff --git a/aiogram/fsm/storage/redis.py b/aiogram/fsm/storage/redis.py index 33e44be4..edcf9d63 100644 --- a/aiogram/fsm/storage/redis.py +++ b/aiogram/fsm/storage/redis.py @@ -1,7 +1,6 @@ import json -from abc import ABC, abstractmethod from contextlib import asynccontextmanager -from typing import Any, AsyncGenerator, Callable, Dict, Literal, Optional, cast +from typing import Any, AsyncGenerator, Callable, Dict, Optional, cast from redis.asyncio.client import Redis from redis.asyncio.connection import ConnectionPool @@ -10,9 +9,10 @@ from redis.typing import ExpiryT from aiogram.fsm.state import State from aiogram.fsm.storage.base import ( - DEFAULT_DESTINY, BaseEventIsolation, BaseStorage, + DefaultKeyBuilder, + KeyBuilder, StateType, StorageKey, ) @@ -22,71 +22,6 @@ _JsonLoads = Callable[..., Any] _JsonDumps = Callable[..., str] -class KeyBuilder(ABC): - """ - Base class for Redis key builder - """ - - @abstractmethod - def build(self, key: StorageKey, part: Literal["data", "state", "lock"]) -> str: - """ - This method should be implemented in subclasses - - :param key: contextual key - :param part: part of the record - :return: key to be used in Redis queries - """ - pass - - -class DefaultKeyBuilder(KeyBuilder): - """ - Simple Redis key builder with default prefix. - - Generates a colon-joined string with prefix, chat_id, user_id, - optional bot_id and optional destiny. - """ - - def __init__( - self, - *, - prefix: str = "fsm", - separator: str = ":", - with_bot_id: bool = False, - with_destiny: bool = False, - ) -> None: - """ - :param prefix: prefix for all records - :param separator: separator - :param with_bot_id: include Bot id in the key - :param with_destiny: include destiny key - """ - self.prefix = prefix - self.separator = separator - self.with_bot_id = with_bot_id - self.with_destiny = with_destiny - - def build(self, key: StorageKey, part: Literal["data", "state", "lock"]) -> str: - parts = [self.prefix] - if self.with_bot_id: - parts.append(str(key.bot_id)) - parts.append(str(key.chat_id)) - if key.thread_id: - parts.append(str(key.thread_id)) - parts.append(str(key.user_id)) - if self.with_destiny: - parts.append(key.destiny) - elif key.destiny != DEFAULT_DESTINY: - raise ValueError( - "Redis key builder is not configured to use key destiny other the default.\n" - "\n" - "Probably, you should set `with_destiny=True` in for DefaultKeyBuilder.\n" - "E.g: `RedisStorage(redis, key_builder=DefaultKeyBuilder(with_destiny=True))`" - ) - parts.append(part) - return self.separator.join(parts) - - class RedisStorage(BaseStorage): """ Redis storage required :code:`redis` package installed (:code:`pip install redis`) diff --git a/aiogram/methods/__init__.py b/aiogram/methods/__init__.py index 370cbee1..55d86b5c 100644 --- a/aiogram/methods/__init__.py +++ b/aiogram/methods/__init__.py @@ -38,6 +38,7 @@ from .edit_message_text import EditMessageText from .export_chat_invite_link import ExportChatInviteLink from .forward_message import ForwardMessage from .forward_messages import ForwardMessages +from .get_business_connection import GetBusinessConnection from .get_chat import GetChat from .get_chat_administrators import GetChatAdministrators from .get_chat_member import GetChatMember @@ -63,8 +64,10 @@ from .leave_chat import LeaveChat from .log_out import LogOut from .pin_chat_message import PinChatMessage from .promote_chat_member import PromoteChatMember +from .refund_star_payment import RefundStarPayment from .reopen_forum_topic import ReopenForumTopic from .reopen_general_forum_topic import ReopenGeneralForumTopic +from .replace_sticker_in_set import ReplaceStickerInSet from .restrict_chat_member import RestrictChatMember from .revoke_chat_invite_link import RevokeChatInviteLink from .send_animation import SendAnimation @@ -159,6 +162,7 @@ __all__ = ( "ExportChatInviteLink", "ForwardMessage", "ForwardMessages", + "GetBusinessConnection", "GetChat", "GetChatAdministrators", "GetChatMember", @@ -184,8 +188,10 @@ __all__ = ( "LogOut", "PinChatMessage", "PromoteChatMember", + "RefundStarPayment", "ReopenForumTopic", "ReopenGeneralForumTopic", + "ReplaceStickerInSet", "Request", "Response", "RestrictChatMember", diff --git a/aiogram/methods/add_sticker_to_set.py b/aiogram/methods/add_sticker_to_set.py index b9ec036e..cc2e31d2 100644 --- a/aiogram/methods/add_sticker_to_set.py +++ b/aiogram/methods/add_sticker_to_set.py @@ -8,7 +8,7 @@ from .base import TelegramMethod class AddStickerToSet(TelegramMethod[bool]): """ - Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success. + Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#addstickertoset """ diff --git a/aiogram/methods/copy_message.py b/aiogram/methods/copy_message.py index 807b9755..2614ddbf 100644 --- a/aiogram/methods/copy_message.py +++ b/aiogram/methods/copy_message.py @@ -41,6 +41,8 @@ class CopyMessage(TelegramMethod[MessageId]): """Mode for parsing entities in the new caption. See `formatting options `_ for more details.""" 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.""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") @@ -50,7 +52,7 @@ class CopyMessage(TelegramMethod[MessageId]): reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -78,6 +80,9 @@ class CopyMessage(TelegramMethod[MessageId]): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), reply_parameters: Optional[ReplyParameters] = None, @@ -100,6 +105,7 @@ class CopyMessage(TelegramMethod[MessageId]): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, protect_content=protect_content, reply_parameters=reply_parameters, diff --git a/aiogram/methods/copy_messages.py b/aiogram/methods/copy_messages.py index a7d88124..d85e3105 100644 --- a/aiogram/methods/copy_messages.py +++ b/aiogram/methods/copy_messages.py @@ -19,7 +19,7 @@ class CopyMessages(TelegramMethod[List[MessageId]]): 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] - """Identifiers of 1-100 messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order.""" + """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""" disable_notification: Optional[bool] = None diff --git a/aiogram/methods/create_invoice_link.py b/aiogram/methods/create_invoice_link.py index 361ea31a..2068f759 100644 --- a/aiogram/methods/create_invoice_link.py +++ b/aiogram/methods/create_invoice_link.py @@ -22,14 +22,14 @@ class CreateInvoiceLink(TelegramMethod[str]): """Product description, 1-255 characters""" payload: str """Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.""" - provider_token: str - """Payment provider token, obtained via `BotFather `_""" currency: str - """Three-letter ISO 4217 currency code, see `more on currencies `_""" + """Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.""" prices: List[LabeledPrice] - """Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)""" + """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""" + """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 """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 @@ -43,19 +43,19 @@ class CreateInvoiceLink(TelegramMethod[str]): photo_height: Optional[int] = None """Photo height""" need_name: Optional[bool] = None - """Pass :code:`True` if you require the user's full name to complete the order""" + """Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.""" need_phone_number: Optional[bool] = None - """Pass :code:`True` if you require the user's phone number to complete the order""" + """Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.""" need_email: Optional[bool] = None - """Pass :code:`True` if you require the user's email address to complete the order""" + """Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.""" need_shipping_address: Optional[bool] = None - """Pass :code:`True` if you require the user's shipping address to complete the order""" + """Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.""" send_phone_number_to_provider: Optional[bool] = None - """Pass :code:`True` if the user's phone number should be sent to the provider""" + """Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" send_email_to_provider: Optional[bool] = None - """Pass :code:`True` if the user's email address should be sent to the provider""" + """Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" is_flexible: Optional[bool] = None - """Pass :code:`True` if the final price depends on the shipping method""" + """Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -67,9 +67,9 @@ class CreateInvoiceLink(TelegramMethod[str]): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, provider_data: Optional[str] = None, @@ -94,9 +94,9 @@ class CreateInvoiceLink(TelegramMethod[str]): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, provider_data=provider_data, diff --git a/aiogram/methods/create_new_sticker_set.py b/aiogram/methods/create_new_sticker_set.py index 92388bd5..c304d854 100644 --- a/aiogram/methods/create_new_sticker_set.py +++ b/aiogram/methods/create_new_sticker_set.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional +from pydantic import Field + from ..types import InputSticker from .base import TelegramMethod @@ -24,12 +26,15 @@ class CreateNewStickerSet(TelegramMethod[bool]): """Sticker set title, 1-64 characters""" stickers: List[InputSticker] """A JSON-serialized list of 1-50 initial stickers to be added to the sticker set""" - sticker_format: str - """Format of stickers in the set, must be one of 'static', 'animated', 'video'""" 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.""" needs_repainting: Optional[bool] = None """Pass :code:`True` if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only""" + sticker_format: Optional[str] = Field(None, json_schema_extra={"deprecated": True}) + """Format of stickers in the set, must be one of 'static', 'animated', 'video' + +.. deprecated:: API:7.2 + https://core.telegram.org/bots/api-changelog#march-31-2024""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -42,9 +47,9 @@ class CreateNewStickerSet(TelegramMethod[bool]): name: str, title: str, stickers: List[InputSticker], - sticker_format: str, sticker_type: Optional[str] = None, needs_repainting: Optional[bool] = None, + sticker_format: Optional[str] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -56,8 +61,8 @@ class CreateNewStickerSet(TelegramMethod[bool]): name=name, title=title, stickers=stickers, - sticker_format=sticker_format, sticker_type=sticker_type, needs_repainting=needs_repainting, + sticker_format=sticker_format, **__pydantic_kwargs, ) diff --git a/aiogram/methods/delete_messages.py b/aiogram/methods/delete_messages.py index 6e5ad063..061d12b9 100644 --- a/aiogram/methods/delete_messages.py +++ b/aiogram/methods/delete_messages.py @@ -16,7 +16,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] - """Identifiers of 1-100 messages to delete. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted""" + """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: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/methods/edit_message_caption.py b/aiogram/methods/edit_message_caption.py index 53dff16e..e18b50a9 100644 --- a/aiogram/methods/edit_message_caption.py +++ b/aiogram/methods/edit_message_caption.py @@ -29,6 +29,8 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]): """Mode for parsing entities in the message caption. See `formatting options `_ for more details.""" 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.""" reply_markup: Optional[InlineKeyboardMarkup] = None """A JSON-serialized object for an `inline keyboard `_.""" @@ -45,6 +47,9 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, **__pydantic_kwargs: Any, ) -> None: @@ -59,6 +64,7 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, **__pydantic_kwargs, ) diff --git a/aiogram/methods/edit_message_live_location.py b/aiogram/methods/edit_message_live_location.py index 44406203..7c912196 100644 --- a/aiogram/methods/edit_message_live_location.py +++ b/aiogram/methods/edit_message_live_location.py @@ -26,6 +26,8 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]): """Required if *inline_message_id* is not specified. Identifier of the message to edit""" inline_message_id: Optional[str] = None """Required if *chat_id* and *message_id* are not specified. Identifier of the inline message""" + live_period: Optional[int] = None + """New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current *live_period* by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then *live_period* remains unchanged""" horizontal_accuracy: Optional[float] = None """The radius of uncertainty for the location, measured in meters; 0-1500""" heading: Optional[int] = None @@ -47,6 +49,7 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]): chat_id: Optional[Union[int, str]] = None, message_id: Optional[int] = None, inline_message_id: Optional[str] = None, + live_period: Optional[int] = None, horizontal_accuracy: Optional[float] = None, heading: Optional[int] = None, proximity_alert_radius: Optional[int] = None, @@ -63,6 +66,7 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]): chat_id=chat_id, message_id=message_id, inline_message_id=inline_message_id, + live_period=live_period, horizontal_accuracy=horizontal_accuracy, heading=heading, proximity_alert_radius=proximity_alert_radius, diff --git a/aiogram/methods/forward_messages.py b/aiogram/methods/forward_messages.py index 0cceff05..829545f2 100644 --- a/aiogram/methods/forward_messages.py +++ b/aiogram/methods/forward_messages.py @@ -19,7 +19,7 @@ class ForwardMessages(TelegramMethod[List[MessageId]]): 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] - """Identifiers of 1-100 messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order.""" + """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""" disable_notification: Optional[bool] = None diff --git a/aiogram/methods/get_business_connection.py b/aiogram/methods/get_business_connection.py new file mode 100644 index 00000000..97cb9ca8 --- /dev/null +++ b/aiogram/methods/get_business_connection.py @@ -0,0 +1,34 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from aiogram.types import BusinessConnection + +from .base import TelegramMethod + + +class GetBusinessConnection(TelegramMethod[BusinessConnection]): + """ + Use this method to get information about the connection of the bot with a business account. Returns a :class:`aiogram.types.business_connection.BusinessConnection` object on success. + + Source: https://core.telegram.org/bots/api#getbusinessconnection + """ + + __returning__ = BusinessConnection + __api_method__ = "getBusinessConnection" + + business_connection_id: str + """Unique identifier of the business connection""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, business_connection_id: 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__(business_connection_id=business_connection_id, **__pydantic_kwargs) diff --git a/aiogram/methods/get_chat.py b/aiogram/methods/get_chat.py index 9b80b490..6b6b9773 100644 --- a/aiogram/methods/get_chat.py +++ b/aiogram/methods/get_chat.py @@ -2,18 +2,18 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Union -from ..types import Chat +from ..types import ChatFullInfo from .base import TelegramMethod -class GetChat(TelegramMethod[Chat]): +class GetChat(TelegramMethod[ChatFullInfo]): """ - Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success. + Use this method to get up-to-date information about the chat. Returns a :class:`aiogram.types.chat_full_info.ChatFullInfo` object on success. Source: https://core.telegram.org/bots/api#getchat """ - __returning__ = Chat + __returning__ = ChatFullInfo __api_method__ = "getChat" chat_id: Union[int, str] diff --git a/aiogram/methods/get_custom_emoji_stickers.py b/aiogram/methods/get_custom_emoji_stickers.py index 5aeff72f..3235d97d 100644 --- a/aiogram/methods/get_custom_emoji_stickers.py +++ b/aiogram/methods/get_custom_emoji_stickers.py @@ -17,7 +17,7 @@ class GetCustomEmojiStickers(TelegramMethod[List[Sticker]]): __api_method__ = "getCustomEmojiStickers" custom_emoji_ids: List[str] - """List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.""" + """A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/methods/promote_chat_member.py b/aiogram/methods/promote_chat_member.py index 4e389b45..2ca410f0 100644 --- a/aiogram/methods/promote_chat_member.py +++ b/aiogram/methods/promote_chat_member.py @@ -38,17 +38,17 @@ class PromoteChatMember(TelegramMethod[bool]): can_post_stories: Optional[bool] = None """Pass :code:`True` if the administrator can post stories to the chat""" can_edit_stories: Optional[bool] = None - """Pass :code:`True` if the administrator can edit stories posted by other users""" + """Pass :code:`True` if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive""" can_delete_stories: Optional[bool] = None """Pass :code:`True` if the administrator can delete stories posted by other users""" can_post_messages: Optional[bool] = None - """Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only""" + """Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; for channels only""" can_edit_messages: Optional[bool] = None - """Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only""" + """Pass :code:`True` if the administrator can edit messages of other users and can pin messages; for channels only""" can_pin_messages: Optional[bool] = None - """Pass :code:`True` if the administrator can pin messages, supergroups only""" + """Pass :code:`True` if the administrator can pin messages; for supergroups only""" can_manage_topics: Optional[bool] = None - """Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only""" + """Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/methods/refund_star_payment.py b/aiogram/methods/refund_star_payment.py new file mode 100644 index 00000000..495cc9e0 --- /dev/null +++ b/aiogram/methods/refund_star_payment.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramMethod + + +class RefundStarPayment(TelegramMethod[bool]): + """ + Refunds a successful payment in `Telegram Stars `_. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#refundstarpayment + """ + + __returning__ = bool + __api_method__ = "refundStarPayment" + + user_id: int + """Identifier of the user whose payment will be refunded""" + telegram_payment_charge_id: str + """Telegram payment identifier""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + user_id: int, + telegram_payment_charge_id: 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__( + user_id=user_id, + telegram_payment_charge_id=telegram_payment_charge_id, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/replace_sticker_in_set.py b/aiogram/methods/replace_sticker_in_set.py new file mode 100644 index 00000000..f46eef2f --- /dev/null +++ b/aiogram/methods/replace_sticker_in_set.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from ..types import InputSticker +from .base import TelegramMethod + + +class ReplaceStickerInSet(TelegramMethod[bool]): + """ + Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling :class:`aiogram.methods.delete_sticker_from_set.DeleteStickerFromSet`, then :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, then :class:`aiogram.methods.set_sticker_position_in_set.SetStickerPositionInSet`. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#replacestickerinset + """ + + __returning__ = bool + __api_method__ = "replaceStickerInSet" + + user_id: int + """User identifier of the sticker set owner""" + name: str + """Sticker set name""" + old_sticker: str + """File identifier of the replaced sticker""" + sticker: InputSticker + """A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + user_id: int, + name: str, + old_sticker: str, + sticker: InputSticker, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + user_id=user_id, + name=name, + old_sticker=old_sticker, + sticker=sticker, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/send_animation.py b/aiogram/methods/send_animation.py index 24482c7d..0baab73a 100644 --- a/aiogram/methods/send_animation.py +++ b/aiogram/methods/send_animation.py @@ -6,7 +6,6 @@ from pydantic import Field from ..client.default import Default from ..types import ( - UNSET_PARSE_MODE, ForceReply, InlineKeyboardMarkup, InputFile, @@ -33,6 +32,8 @@ class SendAnimation(TelegramMethod[Message]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" animation: Union[InputFile, str] """Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » `""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" duration: Optional[int] = None @@ -49,18 +50,22 @@ class SendAnimation(TelegramMethod[Message]): """Mode for parsing entities in the animation caption. See `formatting options `_ for more details.""" 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""" has_spoiler: Optional[bool] = None """Pass :code:`True` if the animation needs to be covered with a spoiler animation""" disable_notification: Optional[bool] = None """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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -83,6 +88,7 @@ class SendAnimation(TelegramMethod[Message]): *, chat_id: Union[int, str], animation: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -91,9 +97,13 @@ class SendAnimation(TelegramMethod[Message]): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -109,6 +119,7 @@ class SendAnimation(TelegramMethod[Message]): super().__init__( chat_id=chat_id, animation=animation, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -117,9 +128,11 @@ class SendAnimation(TelegramMethod[Message]): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_audio.py b/aiogram/methods/send_audio.py index 43b6a781..b15824a1 100644 --- a/aiogram/methods/send_audio.py +++ b/aiogram/methods/send_audio.py @@ -33,6 +33,8 @@ class SendAudio(TelegramMethod[Message]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" audio: Union[InputFile, str] """Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" caption: Optional[str] = None @@ -53,12 +55,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -81,6 +85,7 @@ class SendAudio(TelegramMethod[Message]): *, chat_id: Union[int, str], audio: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -91,6 +96,7 @@ class SendAudio(TelegramMethod[Message]): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -106,6 +112,7 @@ class SendAudio(TelegramMethod[Message]): super().__init__( chat_id=chat_id, audio=audio, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -116,6 +123,7 @@ class SendAudio(TelegramMethod[Message]): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_chat_action.py b/aiogram/methods/send_chat_action.py index 8b936ab7..a9f452af 100644 --- a/aiogram/methods/send_chat_action.py +++ b/aiogram/methods/send_chat_action.py @@ -23,8 +23,10 @@ class SendChatAction(TelegramMethod[bool]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" action: str """Type of action to broadcast. Choose one, depending on what the user is about to receive: *typing* for `text messages `_, *upload_photo* for `photos `_, *record_video* or *upload_video* for `videos `_, *record_voice* or *upload_voice* for `voice notes `_, *upload_document* for `general files `_, *choose_sticker* for `stickers `_, *find_location* for `location data `_, *record_video_note* or *upload_video_note* for `video notes `_.""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the action will be sent""" message_thread_id: Optional[int] = None - """Unique identifier for the target message thread; supergroups only""" + """Unique identifier for the target message thread; for supergroups only""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -35,6 +37,7 @@ class SendChatAction(TelegramMethod[bool]): *, chat_id: Union[int, str], action: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: @@ -45,6 +48,7 @@ class SendChatAction(TelegramMethod[bool]): super().__init__( chat_id=chat_id, action=action, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_contact.py b/aiogram/methods/send_contact.py index 9dd040a5..6c14d56f 100644 --- a/aiogram/methods/send_contact.py +++ b/aiogram/methods/send_contact.py @@ -32,6 +32,8 @@ class SendContact(TelegramMethod[Message]): """Contact's phone number""" first_name: str """Contact's first name""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" last_name: Optional[str] = None @@ -42,12 +44,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -71,11 +75,13 @@ class SendContact(TelegramMethod[Message]): chat_id: Union[int, str], phone_number: str, first_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, last_name: Optional[str] = None, vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -92,11 +98,13 @@ class SendContact(TelegramMethod[Message]): chat_id=chat_id, phone_number=phone_number, first_name=first_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, last_name=last_name, vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_dice.py b/aiogram/methods/send_dice.py index d8a9ac8d..42d2bf57 100644 --- a/aiogram/methods/send_dice.py +++ b/aiogram/methods/send_dice.py @@ -28,6 +28,8 @@ class SendDice(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" emoji: Optional[str] = None @@ -36,12 +38,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -63,10 +67,12 @@ class SendDice(TelegramMethod[Message]): __pydantic__self__, *, chat_id: Union[int, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -81,10 +87,12 @@ class SendDice(TelegramMethod[Message]): super().__init__( chat_id=chat_id, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_document.py b/aiogram/methods/send_document.py index 718dd346..411165d3 100644 --- a/aiogram/methods/send_document.py +++ b/aiogram/methods/send_document.py @@ -6,7 +6,6 @@ from pydantic import Field from ..client.default import Default from ..types import ( - UNSET_PARSE_MODE, ForceReply, InlineKeyboardMarkup, InputFile, @@ -33,6 +32,8 @@ class SendDocument(TelegramMethod[Message]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" document: Union[InputFile, str] """File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" thumbnail: Optional[InputFile] = None @@ -49,12 +50,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -77,6 +80,7 @@ class SendDocument(TelegramMethod[Message]): *, chat_id: Union[int, str], document: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, thumbnail: Optional[InputFile] = None, caption: Optional[str] = None, @@ -85,6 +89,7 @@ class SendDocument(TelegramMethod[Message]): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -100,6 +105,7 @@ class SendDocument(TelegramMethod[Message]): super().__init__( chat_id=chat_id, document=document, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, thumbnail=thumbnail, caption=caption, @@ -108,6 +114,7 @@ class SendDocument(TelegramMethod[Message]): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_game.py b/aiogram/methods/send_game.py index 73e69795..eb963303 100644 --- a/aiogram/methods/send_game.py +++ b/aiogram/methods/send_game.py @@ -23,12 +23,16 @@ class SendGame(TelegramMethod[Message]): """Unique identifier for the target chat""" game_short_name: str """Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_.""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" disable_notification: Optional[bool] = None """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""" + 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 """Description of the message to reply to""" reply_markup: Optional[InlineKeyboardMarkup] = None @@ -55,9 +59,11 @@ class SendGame(TelegramMethod[Message]): *, chat_id: int, game_short_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -71,9 +77,11 @@ class SendGame(TelegramMethod[Message]): super().__init__( chat_id=chat_id, game_short_name=game_short_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_invoice.py b/aiogram/methods/send_invoice.py index 7e0d7955..108219ef 100644 --- a/aiogram/methods/send_invoice.py +++ b/aiogram/methods/send_invoice.py @@ -27,16 +27,16 @@ class SendInvoice(TelegramMethod[Message]): """Product description, 1-255 characters""" payload: str """Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.""" - provider_token: str - """Payment provider token, obtained via `@BotFather `_""" currency: str - """Three-letter ISO 4217 currency code, see `more on currencies `_""" + """Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.""" prices: List[LabeledPrice] - """Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)""" + """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""" + 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""" + """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 """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 @@ -52,23 +52,25 @@ class SendInvoice(TelegramMethod[Message]): photo_height: Optional[int] = None """Photo height""" need_name: Optional[bool] = None - """Pass :code:`True` if you require the user's full name to complete the order""" + """Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.""" need_phone_number: Optional[bool] = None - """Pass :code:`True` if you require the user's phone number to complete the order""" + """Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.""" need_email: Optional[bool] = None - """Pass :code:`True` if you require the user's email address to complete the order""" + """Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.""" need_shipping_address: Optional[bool] = None - """Pass :code:`True` if you require the user's shipping address to complete the order""" + """Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.""" send_phone_number_to_provider: Optional[bool] = None - """Pass :code:`True` if the user's phone number should be sent to provider""" + """Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" send_email_to_provider: Optional[bool] = None - """Pass :code:`True` if the user's email address should be sent to provider""" + """Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" is_flexible: Optional[bool] = None - """Pass :code:`True` if the final price depends on the shipping method""" + """Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.""" disable_notification: Optional[bool] = None """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""" + 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 """Description of the message to reply to""" reply_markup: Optional[InlineKeyboardMarkup] = None @@ -97,10 +99,10 @@ class SendInvoice(TelegramMethod[Message]): title: str, description: str, payload: str, - provider_token: str, currency: str, 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, start_parameter: Optional[str] = None, @@ -118,6 +120,7 @@ class SendInvoice(TelegramMethod[Message]): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -133,10 +136,10 @@ class SendInvoice(TelegramMethod[Message]): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -154,6 +157,7 @@ class SendInvoice(TelegramMethod[Message]): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_location.py b/aiogram/methods/send_location.py index 44a74300..d33f6769 100644 --- a/aiogram/methods/send_location.py +++ b/aiogram/methods/send_location.py @@ -32,12 +32,14 @@ class SendLocation(TelegramMethod[Message]): """Latitude of the location""" longitude: float """Longitude of the location""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" horizontal_accuracy: Optional[float] = None """The radius of uncertainty for the location, measured in meters; 0-1500""" live_period: Optional[int] = None - """Period in seconds for which the location will be updated (see `Live Locations `_, should be between 60 and 86400.""" + """Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.""" heading: Optional[int] = None """For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.""" proximity_alert_radius: Optional[int] = None @@ -46,12 +48,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -75,6 +79,7 @@ class SendLocation(TelegramMethod[Message]): chat_id: Union[int, str], latitude: float, longitude: float, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, horizontal_accuracy: Optional[float] = None, live_period: Optional[int] = None, @@ -82,6 +87,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"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -98,6 +104,7 @@ class SendLocation(TelegramMethod[Message]): chat_id=chat_id, latitude=latitude, longitude=longitude, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, horizontal_accuracy=horizontal_accuracy, live_period=live_period, @@ -105,6 +112,7 @@ class SendLocation(TelegramMethod[Message]): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_media_group.py b/aiogram/methods/send_media_group.py index bbf886cc..f8c081a3 100644 --- a/aiogram/methods/send_media_group.py +++ b/aiogram/methods/send_media_group.py @@ -6,11 +6,15 @@ 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 @@ -30,12 +34,16 @@ class SendMediaGroup(TelegramMethod[List[Message]]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" 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""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" disable_notification: Optional[bool] = None """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""" + 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 """Description of the message to reply to""" allow_sending_without_reply: Optional[bool] = Field( @@ -62,9 +70,11 @@ class SendMediaGroup(TelegramMethod[List[Message]]): 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"), + 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, @@ -77,9 +87,11 @@ class SendMediaGroup(TelegramMethod[List[Message]]): super().__init__( chat_id=chat_id, media=media, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, diff --git a/aiogram/methods/send_message.py b/aiogram/methods/send_message.py index fc002ec4..caf28525 100644 --- a/aiogram/methods/send_message.py +++ b/aiogram/methods/send_message.py @@ -32,6 +32,8 @@ class SendMessage(TelegramMethod[Message]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" text: str """Text of the message to be sent, 1-4096 characters after entities parsing""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") @@ -44,12 +46,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -79,6 +83,7 @@ class SendMessage(TelegramMethod[Message]): *, chat_id: Union[int, str], text: str, + 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, @@ -87,6 +92,7 @@ class SendMessage(TelegramMethod[Message]): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -105,12 +111,14 @@ class SendMessage(TelegramMethod[Message]): super().__init__( chat_id=chat_id, text=text, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_photo.py b/aiogram/methods/send_photo.py index b10ac8f0..3ba7da12 100644 --- a/aiogram/methods/send_photo.py +++ b/aiogram/methods/send_photo.py @@ -6,7 +6,6 @@ from pydantic import Field from ..client.default import Default from ..types import ( - UNSET_PARSE_MODE, ForceReply, InlineKeyboardMarkup, InputFile, @@ -33,6 +32,8 @@ class SendPhoto(TelegramMethod[Message]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" photo: Union[InputFile, str] """Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » `""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" caption: Optional[str] = None @@ -41,18 +42,22 @@ class SendPhoto(TelegramMethod[Message]): """Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" 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""" has_spoiler: Optional[bool] = None """Pass :code:`True` if the photo needs to be covered with a spoiler animation""" disable_notification: Optional[bool] = None """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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -75,13 +80,18 @@ class SendPhoto(TelegramMethod[Message]): *, chat_id: Union[int, str], photo: Union[InputFile, str], + business_connection_id: Optional[str] = None, 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, + 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"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -97,13 +107,16 @@ class SendPhoto(TelegramMethod[Message]): super().__init__( chat_id=chat_id, photo=photo, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_poll.py b/aiogram/methods/send_poll.py index eab1b656..e791b70f 100644 --- a/aiogram/methods/send_poll.py +++ b/aiogram/methods/send_poll.py @@ -7,9 +7,9 @@ from pydantic import Field from ..client.default import Default from ..types import ( - UNSET_PARSE_MODE, ForceReply, InlineKeyboardMarkup, + InputPollOption, Message, MessageEntity, ReplyKeyboardMarkup, @@ -33,10 +33,16 @@ 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[str] - """A JSON-serialized list of answer options, 2-10 strings 1-100 characters each""" + 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""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" + question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode") + """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 + """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`""" type: Optional[str] = None @@ -50,7 +56,7 @@ class SendPoll(TelegramMethod[Message]): 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 - """A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*""" + """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*.""" close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None @@ -61,12 +67,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -89,8 +97,11 @@ class SendPoll(TelegramMethod[Message]): *, chat_id: Union[int, str], question: str, - options: List[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, is_anonymous: Optional[bool] = None, type: Optional[str] = None, allows_multiple_answers: Optional[bool] = None, @@ -103,6 +114,7 @@ class SendPoll(TelegramMethod[Message]): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -119,7 +131,10 @@ class SendPoll(TelegramMethod[Message]): chat_id=chat_id, question=question, options=options, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, + question_parse_mode=question_parse_mode, + question_entities=question_entities, is_anonymous=is_anonymous, type=type, allows_multiple_answers=allows_multiple_answers, @@ -132,6 +147,7 @@ class SendPoll(TelegramMethod[Message]): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_sticker.py b/aiogram/methods/send_sticker.py index a29bc770..236792bf 100644 --- a/aiogram/methods/send_sticker.py +++ b/aiogram/methods/send_sticker.py @@ -30,7 +30,9 @@ class SendSticker(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" sticker: Union[InputFile, str] - """Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.""" + """Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL.""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" emoji: Optional[str] = None @@ -39,12 +41,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -67,10 +71,12 @@ class SendSticker(TelegramMethod[Message]): *, chat_id: Union[int, str], sticker: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -86,10 +92,12 @@ class SendSticker(TelegramMethod[Message]): super().__init__( chat_id=chat_id, sticker=sticker, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_venue.py b/aiogram/methods/send_venue.py index be9aaf44..04ebcee7 100644 --- a/aiogram/methods/send_venue.py +++ b/aiogram/methods/send_venue.py @@ -36,6 +36,8 @@ class SendVenue(TelegramMethod[Message]): """Name of the venue""" address: str """Address of the venue""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" foursquare_id: Optional[str] = None @@ -50,12 +52,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -81,6 +85,7 @@ class SendVenue(TelegramMethod[Message]): longitude: float, title: str, address: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, foursquare_id: Optional[str] = None, foursquare_type: Optional[str] = None, @@ -88,6 +93,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"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -106,6 +112,7 @@ class SendVenue(TelegramMethod[Message]): longitude=longitude, title=title, address=address, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, foursquare_id=foursquare_id, foursquare_type=foursquare_type, @@ -113,6 +120,7 @@ class SendVenue(TelegramMethod[Message]): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_video.py b/aiogram/methods/send_video.py index 89b33b4b..33fb7aa3 100644 --- a/aiogram/methods/send_video.py +++ b/aiogram/methods/send_video.py @@ -6,7 +6,6 @@ from pydantic import Field from ..client.default import Default from ..types import ( - UNSET_PARSE_MODE, ForceReply, InlineKeyboardMarkup, InputFile, @@ -33,6 +32,8 @@ class SendVideo(TelegramMethod[Message]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" video: Union[InputFile, str] """Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" duration: Optional[int] = None @@ -49,6 +50,8 @@ class SendVideo(TelegramMethod[Message]): """Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" 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""" has_spoiler: Optional[bool] = None """Pass :code:`True` if the video needs to be covered with a spoiler animation""" supports_streaming: Optional[bool] = None @@ -57,12 +60,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -85,6 +90,7 @@ class SendVideo(TelegramMethod[Message]): *, chat_id: Union[int, str], video: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -93,10 +99,14 @@ class SendVideo(TelegramMethod[Message]): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -112,6 +122,7 @@ class SendVideo(TelegramMethod[Message]): super().__init__( chat_id=chat_id, video=video, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -120,10 +131,12 @@ class SendVideo(TelegramMethod[Message]): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_video_note.py b/aiogram/methods/send_video_note.py index 0b31a348..43d685b4 100644 --- a/aiogram/methods/send_video_note.py +++ b/aiogram/methods/send_video_note.py @@ -31,6 +31,8 @@ class SendVideoNote(TelegramMethod[Message]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" video_note: Union[InputFile, str] """Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `. Sending video notes by a URL is currently unsupported""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" duration: Optional[int] = None @@ -43,12 +45,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -71,12 +75,14 @@ class SendVideoNote(TelegramMethod[Message]): *, chat_id: Union[int, str], video_note: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, length: Optional[int] = None, thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -92,12 +98,14 @@ class SendVideoNote(TelegramMethod[Message]): super().__init__( chat_id=chat_id, video_note=video_note, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, length=length, thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_voice.py b/aiogram/methods/send_voice.py index 65dccc6a..ccb27d3b 100644 --- a/aiogram/methods/send_voice.py +++ b/aiogram/methods/send_voice.py @@ -6,7 +6,6 @@ from pydantic import Field from ..client.default import Default from ..types import ( - UNSET_PARSE_MODE, ForceReply, InlineKeyboardMarkup, InputFile, @@ -21,7 +20,7 @@ from .base import TelegramMethod class SendVoice(TelegramMethod[Message]): """ - Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvoice """ @@ -33,6 +32,8 @@ class SendVoice(TelegramMethod[Message]): """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" voice: Union[InputFile, str] """Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `""" + business_connection_id: Optional[str] = None + """Unique identifier of the business connection on behalf of which the message will be sent""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" caption: Optional[str] = None @@ -47,12 +48,14 @@ 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""" + 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 """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None - """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -75,6 +78,7 @@ class SendVoice(TelegramMethod[Message]): *, chat_id: Union[int, str], voice: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -82,6 +86,7 @@ class SendVoice(TelegramMethod[Message]): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -97,6 +102,7 @@ class SendVoice(TelegramMethod[Message]): super().__init__( chat_id=chat_id, voice=voice, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -104,6 +110,7 @@ class SendVoice(TelegramMethod[Message]): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/set_message_reaction.py b/aiogram/methods/set_message_reaction.py index f345051a..3ac7cbb0 100644 --- a/aiogram/methods/set_message_reaction.py +++ b/aiogram/methods/set_message_reaction.py @@ -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]]] = None - """New 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.""" + """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.""" is_big: Optional[bool] = None """Pass :code:`True` to set the reaction with a big animation""" diff --git a/aiogram/methods/set_sticker_set_thumbnail.py b/aiogram/methods/set_sticker_set_thumbnail.py index 6536d298..38492f37 100644 --- a/aiogram/methods/set_sticker_set_thumbnail.py +++ b/aiogram/methods/set_sticker_set_thumbnail.py @@ -20,6 +20,8 @@ class SetStickerSetThumbnail(TelegramMethod[bool]): """Sticker set name""" user_id: int """User identifier of the sticker set owner""" + format: str + """Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **WEBM** video""" thumbnail: Optional[Union[InputFile, str]] = None """A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animated-sticker-requirements `_`https://core.telegram.org/stickers#animated-sticker-requirements `_ for animated sticker technical requirements), or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements `_`https://core.telegram.org/stickers#video-sticker-requirements `_ for video sticker technical requirements. 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, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.""" @@ -32,6 +34,7 @@ class SetStickerSetThumbnail(TelegramMethod[bool]): *, name: str, user_id: int, + format: str, thumbnail: Optional[Union[InputFile, str]] = None, **__pydantic_kwargs: Any, ) -> None: @@ -39,4 +42,6 @@ class SetStickerSetThumbnail(TelegramMethod[bool]): # This method was auto-generated via `butcher` # Is needed only for type checking and IDE support without any additional plugins - super().__init__(name=name, user_id=user_id, thumbnail=thumbnail, **__pydantic_kwargs) + super().__init__( + name=name, user_id=user_id, format=format, thumbnail=thumbnail, **__pydantic_kwargs + ) diff --git a/aiogram/methods/upload_sticker_file.py b/aiogram/methods/upload_sticker_file.py index 077a9822..600f83ac 100644 --- a/aiogram/methods/upload_sticker_file.py +++ b/aiogram/methods/upload_sticker_file.py @@ -8,7 +8,7 @@ from .base import TelegramMethod class UploadStickerFile(TelegramMethod[File]): """ - Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet` and :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success. + Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet`, :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet`, or :class:`aiogram.methods.replace_sticker_in_set.ReplaceStickerInSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success. Source: https://core.telegram.org/bots/api#uploadstickerfile """ diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index 1341b6e0..564e31c2 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -2,7 +2,17 @@ from typing import List, Literal, Optional, Union from .animation import Animation from .audio import Audio +from .background_fill import BackgroundFill +from .background_fill_freeform_gradient import BackgroundFillFreeformGradient +from .background_fill_gradient import BackgroundFillGradient +from .background_fill_solid import BackgroundFillSolid +from .background_type import BackgroundType +from .background_type_chat_theme import BackgroundTypeChatTheme +from .background_type_fill import BackgroundTypeFill +from .background_type_pattern import BackgroundTypePattern +from .background_type_wallpaper import BackgroundTypeWallpaper from .base import UNSET_PARSE_MODE, TelegramObject +from .birthdate import Birthdate from .bot_command import BotCommand from .bot_command_scope import BotCommandScope from .bot_command_scope_all_chat_administrators import ( @@ -17,10 +27,17 @@ from .bot_command_scope_default import BotCommandScopeDefault from .bot_description import BotDescription from .bot_name import BotName from .bot_short_description import BotShortDescription +from .business_connection import BusinessConnection +from .business_intro import BusinessIntro +from .business_location import BusinessLocation +from .business_messages_deleted import BusinessMessagesDeleted +from .business_opening_hours import BusinessOpeningHours +from .business_opening_hours_interval import BusinessOpeningHoursInterval from .callback_game import CallbackGame from .callback_query import CallbackQuery from .chat import Chat from .chat_administrator_rights import ChatAdministratorRights +from .chat_background import ChatBackground from .chat_boost import ChatBoost from .chat_boost_added import ChatBoostAdded from .chat_boost_removed import ChatBoostRemoved @@ -29,6 +46,7 @@ from .chat_boost_source_gift_code import ChatBoostSourceGiftCode from .chat_boost_source_giveaway import ChatBoostSourceGiveaway from .chat_boost_source_premium import ChatBoostSourcePremium from .chat_boost_updated import ChatBoostUpdated +from .chat_full_info import ChatFullInfo from .chat_invite_link import ChatInviteLink from .chat_join_request import ChatJoinRequest from .chat_location import ChatLocation @@ -105,6 +123,7 @@ from .input_media_document import InputMediaDocument from .input_media_photo import InputMediaPhoto from .input_media_video import InputMediaVideo from .input_message_content import InputMessageContent +from .input_poll_option import InputPollOption from .input_sticker import InputSticker from .input_text_message_content import InputTextMessageContent from .input_venue_message_content import InputVenueMessageContent @@ -165,6 +184,7 @@ from .reply_keyboard_remove import ReplyKeyboardRemove from .reply_parameters import ReplyParameters from .response_parameters import ResponseParameters from .sent_web_app_message import SentWebAppMessage +from .shared_user import SharedUser from .shipping_address import ShippingAddress from .shipping_option import ShippingOption from .shipping_query import ShippingQuery @@ -196,6 +216,16 @@ from .write_access_allowed import WriteAccessAllowed __all__ = ( "Animation", "Audio", + "BackgroundFill", + "BackgroundFillFreeformGradient", + "BackgroundFillGradient", + "BackgroundFillSolid", + "BackgroundType", + "BackgroundTypeChatTheme", + "BackgroundTypeFill", + "BackgroundTypePattern", + "BackgroundTypeWallpaper", + "Birthdate", "BotCommand", "BotCommandScope", "BotCommandScopeAllChatAdministrators", @@ -209,10 +239,17 @@ __all__ = ( "BotName", "BotShortDescription", "BufferedInputFile", + "BusinessConnection", + "BusinessIntro", + "BusinessLocation", + "BusinessMessagesDeleted", + "BusinessOpeningHours", + "BusinessOpeningHoursInterval", "CallbackGame", "CallbackQuery", "Chat", "ChatAdministratorRights", + "ChatBackground", "ChatBoost", "ChatBoostAdded", "ChatBoostRemoved", @@ -221,6 +258,7 @@ __all__ = ( "ChatBoostSourceGiveaway", "ChatBoostSourcePremium", "ChatBoostUpdated", + "ChatFullInfo", "ChatInviteLink", "ChatJoinRequest", "ChatLocation", @@ -299,6 +337,7 @@ __all__ = ( "InputMediaPhoto", "InputMediaVideo", "InputMessageContent", + "InputPollOption", "InputSticker", "InputTextMessageContent", "InputVenueMessageContent", @@ -357,6 +396,7 @@ __all__ = ( "ReplyParameters", "ResponseParameters", "SentWebAppMessage", + "SharedUser", "ShippingAddress", "ShippingOption", "ShippingQuery", diff --git a/aiogram/types/background_fill.py b/aiogram/types/background_fill.py new file mode 100644 index 00000000..dbeda468 --- /dev/null +++ b/aiogram/types/background_fill.py @@ -0,0 +1,13 @@ +from .base import TelegramObject + + +class BackgroundFill(TelegramObject): + """ + This object describes the way a background is filled based on the selected colors. Currently, it can be one of + + - :class:`aiogram.types.background_fill_solid.BackgroundFillSolid` + - :class:`aiogram.types.background_fill_gradient.BackgroundFillGradient` + - :class:`aiogram.types.background_fill_freeform_gradient.BackgroundFillFreeformGradient` + + Source: https://core.telegram.org/bots/api#backgroundfill + """ diff --git a/aiogram/types/background_fill_freeform_gradient.py b/aiogram/types/background_fill_freeform_gradient.py new file mode 100644 index 00000000..916f6a73 --- /dev/null +++ b/aiogram/types/background_fill_freeform_gradient.py @@ -0,0 +1,33 @@ +from typing import TYPE_CHECKING, Any, List, Literal + +from .background_fill import BackgroundFill + + +class BackgroundFillFreeformGradient(BackgroundFill): + """ + The background is a freeform gradient that rotates after every message in the chat. + + Source: https://core.telegram.org/bots/api#backgroundfillfreeformgradient + """ + + type: Literal["freeform_gradient"] = "freeform_gradient" + """Type of the background fill, always 'freeform_gradient'""" + 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: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal["freeform_gradient"] = "freeform_gradient", + colors: List[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, colors=colors, **__pydantic_kwargs) diff --git a/aiogram/types/background_fill_gradient.py b/aiogram/types/background_fill_gradient.py new file mode 100644 index 00000000..abc485c1 --- /dev/null +++ b/aiogram/types/background_fill_gradient.py @@ -0,0 +1,45 @@ +from typing import TYPE_CHECKING, Any, Literal + +from .background_fill import BackgroundFill + + +class BackgroundFillGradient(BackgroundFill): + """ + The background is a gradient fill. + + Source: https://core.telegram.org/bots/api#backgroundfillgradient + """ + + type: Literal["gradient"] = "gradient" + """Type of the background fill, always 'gradient'""" + top_color: int + """Top color of the gradient in the RGB24 format""" + bottom_color: int + """Bottom color of the gradient in the RGB24 format""" + rotation_angle: int + """Clockwise rotation angle of the background fill in degrees; 0-359""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal["gradient"] = "gradient", + top_color: int, + bottom_color: int, + rotation_angle: 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, + top_color=top_color, + bottom_color=bottom_color, + rotation_angle=rotation_angle, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/background_fill_solid.py b/aiogram/types/background_fill_solid.py new file mode 100644 index 00000000..f9fe22f0 --- /dev/null +++ b/aiogram/types/background_fill_solid.py @@ -0,0 +1,33 @@ +from typing import TYPE_CHECKING, Any, Literal + +from .background_fill import BackgroundFill + + +class BackgroundFillSolid(BackgroundFill): + """ + The background is filled using the selected color. + + Source: https://core.telegram.org/bots/api#backgroundfillsolid + """ + + type: Literal["solid"] = "solid" + """Type of the background fill, always 'solid'""" + color: int + """The color of the background fill in the RGB24 format""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal["solid"] = "solid", + color: 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, color=color, **__pydantic_kwargs) diff --git a/aiogram/types/background_type.py b/aiogram/types/background_type.py new file mode 100644 index 00000000..6abccef3 --- /dev/null +++ b/aiogram/types/background_type.py @@ -0,0 +1,14 @@ +from .base import TelegramObject + + +class BackgroundType(TelegramObject): + """ + This object describes the type of a background. Currently, it can be one of + + - :class:`aiogram.types.background_type_fill.BackgroundTypeFill` + - :class:`aiogram.types.background_type_wallpaper.BackgroundTypeWallpaper` + - :class:`aiogram.types.background_type_pattern.BackgroundTypePattern` + - :class:`aiogram.types.background_type_chat_theme.BackgroundTypeChatTheme` + + Source: https://core.telegram.org/bots/api#backgroundtype + """ diff --git a/aiogram/types/background_type_chat_theme.py b/aiogram/types/background_type_chat_theme.py new file mode 100644 index 00000000..ac93534d --- /dev/null +++ b/aiogram/types/background_type_chat_theme.py @@ -0,0 +1,33 @@ +from typing import TYPE_CHECKING, Any, Literal + +from .background_type import BackgroundType + + +class BackgroundTypeChatTheme(BackgroundType): + """ + The background is taken directly from a built-in chat theme. + + Source: https://core.telegram.org/bots/api#backgroundtypechattheme + """ + + type: Literal["chat_theme"] = "chat_theme" + """Type of the background, always 'chat_theme'""" + theme_name: str + """Name of the chat theme, which is usually an emoji""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal["chat_theme"] = "chat_theme", + theme_name: 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__(type=type, theme_name=theme_name, **__pydantic_kwargs) diff --git a/aiogram/types/background_type_fill.py b/aiogram/types/background_type_fill.py new file mode 100644 index 00000000..c506e4ea --- /dev/null +++ b/aiogram/types/background_type_fill.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Union + +from .background_type import BackgroundType + +if TYPE_CHECKING: + from .background_fill_freeform_gradient import BackgroundFillFreeformGradient + from .background_fill_gradient import BackgroundFillGradient + from .background_fill_solid import BackgroundFillSolid + + +class BackgroundTypeFill(BackgroundType): + """ + The background is automatically filled based on the selected colors. + + Source: https://core.telegram.org/bots/api#backgroundtypefill + """ + + type: Literal["fill"] = "fill" + """Type of the background, always 'fill'""" + fill: Union[BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient] + """The background fill""" + dark_theme_dimming: int + """Dimming of the background in dark themes, as a percentage; 0-100""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal["fill"] = "fill", + fill: Union[ + BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient + ], + dark_theme_dimming: 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, fill=fill, dark_theme_dimming=dark_theme_dimming, **__pydantic_kwargs + ) diff --git a/aiogram/types/background_type_pattern.py b/aiogram/types/background_type_pattern.py new file mode 100644 index 00000000..29c383c2 --- /dev/null +++ b/aiogram/types/background_type_pattern.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional, Union + +from .background_type import BackgroundType + +if TYPE_CHECKING: + from .background_fill_freeform_gradient import BackgroundFillFreeformGradient + from .background_fill_gradient import BackgroundFillGradient + from .background_fill_solid import BackgroundFillSolid + from .document import Document + + +class BackgroundTypePattern(BackgroundType): + """ + The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user. + + Source: https://core.telegram.org/bots/api#backgroundtypepattern + """ + + type: Literal["pattern"] = "pattern" + """Type of the background, always 'pattern'""" + document: Document + """Document with the pattern""" + fill: Union[BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient] + """The background fill that is combined with the pattern""" + intensity: int + """Intensity of the pattern when it is shown above the filled background; 0-100""" + is_inverted: Optional[bool] = None + """*Optional*. :code:`True`, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only""" + is_moving: Optional[bool] = None + """*Optional*. :code:`True`, if the background moves slightly when the device is tilted""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal["pattern"] = "pattern", + document: Document, + fill: Union[ + BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient + ], + intensity: int, + is_inverted: Optional[bool] = None, + is_moving: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + type=type, + document=document, + fill=fill, + intensity=intensity, + is_inverted=is_inverted, + is_moving=is_moving, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/background_type_wallpaper.py b/aiogram/types/background_type_wallpaper.py new file mode 100644 index 00000000..4ad29050 --- /dev/null +++ b/aiogram/types/background_type_wallpaper.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from .background_type import BackgroundType + +if TYPE_CHECKING: + from .document import Document + + +class BackgroundTypeWallpaper(BackgroundType): + """ + The background is a wallpaper in the JPEG format. + + Source: https://core.telegram.org/bots/api#backgroundtypewallpaper + """ + + type: Literal["wallpaper"] = "wallpaper" + """Type of the background, always 'wallpaper'""" + document: Document + """Document with the wallpaper""" + dark_theme_dimming: int + """Dimming of the background in dark themes, as a percentage; 0-100""" + is_blurred: Optional[bool] = None + """*Optional*. :code:`True`, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12""" + is_moving: Optional[bool] = None + """*Optional*. :code:`True`, if the background moves slightly when the device is tilted""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal["wallpaper"] = "wallpaper", + document: Document, + dark_theme_dimming: int, + is_blurred: Optional[bool] = None, + is_moving: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + type=type, + document=document, + dark_theme_dimming=dark_theme_dimming, + is_blurred=is_blurred, + is_moving=is_moving, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/birthdate.py b/aiogram/types/birthdate.py new file mode 100644 index 00000000..69555540 --- /dev/null +++ b/aiogram/types/birthdate.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + + +class Birthdate(TelegramObject): + """ + Describes the birthdate of a user. + + Source: https://core.telegram.org/bots/api#birthdate + """ + + day: int + """Day of the user's birth; 1-31""" + month: int + """Month of the user's birth; 1-12""" + year: Optional[int] = None + """*Optional*. Year of the user's birth""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + day: int, + month: int, + year: Optional[int] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(day=day, month=month, year=year, **__pydantic_kwargs) diff --git a/aiogram/types/bot_command_scope_all_chat_administrators.py b/aiogram/types/bot_command_scope_all_chat_administrators.py index 061945f7..44173636 100644 --- a/aiogram/types/bot_command_scope_all_chat_administrators.py +++ b/aiogram/types/bot_command_scope_all_chat_administrators.py @@ -13,9 +13,9 @@ class BotCommandScopeAllChatAdministrators(BotCommandScope): Source: https://core.telegram.org/bots/api#botcommandscopeallchatadministrators """ - type: Literal[ + type: Literal[BotCommandScopeType.ALL_CHAT_ADMINISTRATORS] = ( BotCommandScopeType.ALL_CHAT_ADMINISTRATORS - ] = BotCommandScopeType.ALL_CHAT_ADMINISTRATORS + ) """Scope type, must be *all_chat_administrators*""" if TYPE_CHECKING: diff --git a/aiogram/types/bot_command_scope_chat_administrators.py b/aiogram/types/bot_command_scope_chat_administrators.py index 8757e98c..f90623ef 100644 --- a/aiogram/types/bot_command_scope_chat_administrators.py +++ b/aiogram/types/bot_command_scope_chat_administrators.py @@ -13,9 +13,9 @@ class BotCommandScopeChatAdministrators(BotCommandScope): Source: https://core.telegram.org/bots/api#botcommandscopechatadministrators """ - type: Literal[ + type: Literal[BotCommandScopeType.CHAT_ADMINISTRATORS] = ( BotCommandScopeType.CHAT_ADMINISTRATORS - ] = BotCommandScopeType.CHAT_ADMINISTRATORS + ) """Scope type, must be *chat_administrators*""" chat_id: Union[int, str] """Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)""" diff --git a/aiogram/types/business_connection.py b/aiogram/types/business_connection.py new file mode 100644 index 00000000..80c472a2 --- /dev/null +++ b/aiogram/types/business_connection.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject +from .custom import DateTime + +if TYPE_CHECKING: + from .user import User + + +class BusinessConnection(TelegramObject): + """ + Describes the connection of the bot with a business account. + + Source: https://core.telegram.org/bots/api#businessconnection + """ + + id: str + """Unique identifier of the business connection""" + user: User + """Business account user that created the business connection""" + user_chat_id: int + """Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.""" + date: DateTime + """Date the connection was established in Unix time""" + can_reply: bool + """True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours""" + is_enabled: bool + """True, if the connection is active""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + id: str, + user: User, + user_chat_id: int, + date: DateTime, + can_reply: bool, + is_enabled: bool, + **__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__( + id=id, + user=user, + user_chat_id=user_chat_id, + date=date, + can_reply=can_reply, + is_enabled=is_enabled, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/business_intro.py b/aiogram/types/business_intro.py new file mode 100644 index 00000000..c360fbe9 --- /dev/null +++ b/aiogram/types/business_intro.py @@ -0,0 +1,41 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .sticker import Sticker + + +class BusinessIntro(TelegramObject): + """ + Contains information about the start page settings of a Telegram Business account. + + Source: https://core.telegram.org/bots/api#businessintro + """ + + title: Optional[str] = None + """*Optional*. Title text of the business intro""" + message: Optional[str] = None + """*Optional*. Message text of the business intro""" + sticker: Optional[Sticker] = None + """*Optional*. Sticker of the business intro""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + title: Optional[str] = None, + message: Optional[str] = None, + sticker: Optional[Sticker] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(title=title, message=message, sticker=sticker, **__pydantic_kwargs) diff --git a/aiogram/types/business_location.py b/aiogram/types/business_location.py new file mode 100644 index 00000000..af7989a0 --- /dev/null +++ b/aiogram/types/business_location.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .location import Location + + +class BusinessLocation(TelegramObject): + """ + Contains information about the location of a Telegram Business account. + + Source: https://core.telegram.org/bots/api#businesslocation + """ + + address: str + """Address of the business""" + location: Optional[Location] = None + """*Optional*. Location of the business""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + address: str, + location: Optional[Location] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(address=address, location=location, **__pydantic_kwargs) diff --git a/aiogram/types/business_messages_deleted.py b/aiogram/types/business_messages_deleted.py new file mode 100644 index 00000000..44bc45fa --- /dev/null +++ b/aiogram/types/business_messages_deleted.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List + +from .base import TelegramObject + +if TYPE_CHECKING: + from .chat import Chat + + +class BusinessMessagesDeleted(TelegramObject): + """ + This object is received when messages are deleted from a connected business account. + + Source: https://core.telegram.org/bots/api#businessmessagesdeleted + """ + + business_connection_id: str + """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] + """The list of identifiers of deleted messages in the chat of the business account""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + chat: Chat, + message_ids: List[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__( + business_connection_id=business_connection_id, + chat=chat, + message_ids=message_ids, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/business_opening_hours.py b/aiogram/types/business_opening_hours.py new file mode 100644 index 00000000..7fd5c754 --- /dev/null +++ b/aiogram/types/business_opening_hours.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List + +from .base import TelegramObject + +if TYPE_CHECKING: + from .business_opening_hours_interval import BusinessOpeningHoursInterval + + +class BusinessOpeningHours(TelegramObject): + """ + Describes the opening hours of a business. + + Source: https://core.telegram.org/bots/api#businessopeninghours + """ + + time_zone_name: str + """Unique name of the time zone for which the opening hours are defined""" + opening_hours: List[BusinessOpeningHoursInterval] + """List of time intervals describing business opening hours""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + time_zone_name: str, + opening_hours: List[BusinessOpeningHoursInterval], + **__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__( + time_zone_name=time_zone_name, opening_hours=opening_hours, **__pydantic_kwargs + ) diff --git a/aiogram/types/business_opening_hours_interval.py b/aiogram/types/business_opening_hours_interval.py new file mode 100644 index 00000000..52efd2c2 --- /dev/null +++ b/aiogram/types/business_opening_hours_interval.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + + +class BusinessOpeningHoursInterval(TelegramObject): + """ + Describes an interval of time during which a business is open. + + Source: https://core.telegram.org/bots/api#businessopeninghoursinterval + """ + + opening_minute: int + """The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60""" + closing_minute: int + """The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + opening_minute: int, + closing_minute: 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__( + opening_minute=opening_minute, closing_minute=closing_minute, **__pydantic_kwargs + ) diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index c747064e..f44b01bf 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -3,6 +3,8 @@ from __future__ import annotations import datetime from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from .base import TelegramObject from .custom import DateTime @@ -37,6 +39,10 @@ if TYPE_CHECKING: UnpinAllGeneralForumTopicMessages, UnpinChatMessage, ) + from .birthdate import Birthdate + from .business_intro import BusinessIntro + from .business_location import BusinessLocation + from .business_opening_hours import BusinessOpeningHours from .chat_location import ChatLocation from .chat_permissions import ChatPermissions from .chat_photo import ChatPhoto @@ -56,7 +62,7 @@ class Chat(TelegramObject): id: int """Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.""" type: str - """Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'""" + """Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'""" title: Optional[str] = None """*Optional*. Title, for supergroups, channels and group chats""" username: Optional[str] = None @@ -67,66 +73,199 @@ class Chat(TelegramObject): """*Optional*. Last name of the other party in a private chat""" is_forum: Optional[bool] = None """*Optional*. :code:`True`, if the supergroup chat is a forum (has `topics `_ enabled)""" - photo: Optional[ChatPhoto] = None - """*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - active_usernames: Optional[List[str]] = None - """*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`.""" - available_reactions: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None - """*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`.""" - accent_color_id: Optional[int] = None - """*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`.""" - background_custom_emoji_id: Optional[str] = None - """*Optional*. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - profile_accent_color_id: Optional[int] = None - """*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - profile_background_custom_emoji_id: Optional[str] = None - """*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - emoji_status_custom_emoji_id: Optional[str] = None - """*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - emoji_status_expiration_date: Optional[DateTime] = None - """*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - bio: Optional[str] = None - """*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - has_private_forwards: Optional[bool] = None - """*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - has_restricted_voice_and_video_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - join_to_send_messages: Optional[bool] = None - """*Optional*. :code:`True`, if users need to join the supergroup before they can send messages. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - join_by_request: Optional[bool] = None - """*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - description: Optional[str] = None - """*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - invite_link: Optional[str] = None - """*Optional*. Primary invite link, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - pinned_message: Optional[Message] = None - """*Optional*. The most recent pinned message (by sending date). Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - permissions: Optional[ChatPermissions] = None - """*Optional*. Default chat member permissions, for groups and supergroups. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - slow_mode_delay: Optional[int] = None - """*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - unrestrict_boost_count: Optional[int] = None - """*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - message_auto_delete_time: Optional[int] = None - """*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - has_aggressive_anti_spam_enabled: Optional[bool] = None - """*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - has_hidden_members: Optional[bool] = None - """*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - has_protected_content: Optional[bool] = None - """*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - has_visible_history: Optional[bool] = None - """*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - sticker_set_name: Optional[str] = None - """*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - can_set_sticker_set: Optional[bool] = None - """*Optional*. :code:`True`, if the bot can change the group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - custom_emoji_sticker_set_name: Optional[str] = None - """*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - linked_chat_id: Optional[int] = None - """*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - location: Optional[ChatLocation] = None - """*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + accent_color_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`. + +.. 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}) + """*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]]] = 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`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + background_custom_emoji_id: Optional[str] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + bio: Optional[str] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + birthdate: Optional[Birthdate] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For private chats, the date of birth of the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + business_intro: Optional[BusinessIntro] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For private chats with business accounts, the intro of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + business_location: Optional[BusinessLocation] = Field( + None, json_schema_extra={"deprecated": True} + ) + """*Optional*. For private chats with business accounts, the location of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + business_opening_hours: Optional[BusinessOpeningHours] = Field( + None, json_schema_extra={"deprecated": True} + ) + """*Optional*. For private chats with business accounts, the opening hours of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + can_set_sticker_set: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. :code:`True`, if the bot can change the group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + custom_emoji_sticker_set_name: Optional[str] = Field( + None, json_schema_extra={"deprecated": True} + ) + """*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + description: Optional[str] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + emoji_status_custom_emoji_id: Optional[str] = Field( + None, json_schema_extra={"deprecated": True} + ) + """*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + emoji_status_expiration_date: Optional[DateTime] = Field( + None, json_schema_extra={"deprecated": True} + ) + """*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + has_aggressive_anti_spam_enabled: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + has_hidden_members: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + has_private_forwards: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + has_protected_content: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + has_restricted_voice_and_video_messages: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + has_visible_history: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + invite_link: Optional[str] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Primary invite link, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + join_by_request: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + join_to_send_messages: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. :code:`True`, if users need to join the supergroup before they can send messages. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + linked_chat_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + location: Optional[ChatLocation] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + message_auto_delete_time: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + permissions: Optional[ChatPermissions] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Default chat member permissions, for groups and supergroups. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + personal_chat: Optional[Chat] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For private chats, the personal channel of the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + photo: Optional[ChatPhoto] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + pinned_message: Optional[Message] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. The most recent pinned message (by sending date). Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + profile_accent_color_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + profile_background_custom_emoji_id: Optional[str] = Field( + None, json_schema_extra={"deprecated": True} + ) + """*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + slow_mode_delay: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + sticker_set_name: Optional[str] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" + unrestrict_boost_count: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in :class:`aiogram.methods.get_chat.GetChat`. + +.. deprecated:: API:7.3 + https://core.telegram.org/bots/api-changelog#may-6-2024""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -142,38 +281,43 @@ class Chat(TelegramObject): first_name: Optional[str] = None, last_name: Optional[str] = None, is_forum: Optional[bool] = None, - photo: Optional[ChatPhoto] = None, + accent_color_id: Optional[int] = None, active_usernames: Optional[List[str]] = None, available_reactions: Optional[ List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]] ] = None, - accent_color_id: Optional[int] = None, background_custom_emoji_id: Optional[str] = None, - profile_accent_color_id: Optional[int] = None, - profile_background_custom_emoji_id: Optional[str] = None, - emoji_status_custom_emoji_id: Optional[str] = None, - emoji_status_expiration_date: Optional[DateTime] = None, bio: Optional[str] = None, - has_private_forwards: Optional[bool] = None, - has_restricted_voice_and_video_messages: Optional[bool] = None, - join_to_send_messages: Optional[bool] = None, - join_by_request: Optional[bool] = None, - description: Optional[str] = None, - invite_link: Optional[str] = None, - pinned_message: Optional[Message] = None, - permissions: Optional[ChatPermissions] = None, - slow_mode_delay: Optional[int] = None, - unrestrict_boost_count: Optional[int] = None, - message_auto_delete_time: Optional[int] = None, - has_aggressive_anti_spam_enabled: Optional[bool] = None, - has_hidden_members: Optional[bool] = None, - has_protected_content: Optional[bool] = None, - has_visible_history: Optional[bool] = None, - sticker_set_name: Optional[str] = None, + birthdate: Optional[Birthdate] = None, + business_intro: Optional[BusinessIntro] = None, + business_location: Optional[BusinessLocation] = None, + business_opening_hours: Optional[BusinessOpeningHours] = None, can_set_sticker_set: Optional[bool] = None, custom_emoji_sticker_set_name: Optional[str] = None, + description: Optional[str] = None, + emoji_status_custom_emoji_id: Optional[str] = None, + emoji_status_expiration_date: Optional[DateTime] = None, + has_aggressive_anti_spam_enabled: Optional[bool] = None, + has_hidden_members: Optional[bool] = None, + has_private_forwards: Optional[bool] = None, + has_protected_content: Optional[bool] = None, + has_restricted_voice_and_video_messages: Optional[bool] = None, + has_visible_history: Optional[bool] = None, + invite_link: Optional[str] = None, + join_by_request: Optional[bool] = None, + join_to_send_messages: Optional[bool] = None, linked_chat_id: Optional[int] = None, location: Optional[ChatLocation] = None, + message_auto_delete_time: Optional[int] = None, + permissions: Optional[ChatPermissions] = None, + personal_chat: Optional[Chat] = None, + photo: Optional[ChatPhoto] = None, + pinned_message: Optional[Message] = None, + profile_accent_color_id: Optional[int] = None, + profile_background_custom_emoji_id: Optional[str] = None, + slow_mode_delay: Optional[int] = None, + sticker_set_name: Optional[str] = None, + unrestrict_boost_count: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -188,36 +332,41 @@ class Chat(TelegramObject): first_name=first_name, last_name=last_name, is_forum=is_forum, - photo=photo, + accent_color_id=accent_color_id, active_usernames=active_usernames, available_reactions=available_reactions, - accent_color_id=accent_color_id, background_custom_emoji_id=background_custom_emoji_id, - profile_accent_color_id=profile_accent_color_id, - profile_background_custom_emoji_id=profile_background_custom_emoji_id, - emoji_status_custom_emoji_id=emoji_status_custom_emoji_id, - emoji_status_expiration_date=emoji_status_expiration_date, bio=bio, - has_private_forwards=has_private_forwards, - has_restricted_voice_and_video_messages=has_restricted_voice_and_video_messages, - join_to_send_messages=join_to_send_messages, - join_by_request=join_by_request, - description=description, - invite_link=invite_link, - pinned_message=pinned_message, - permissions=permissions, - slow_mode_delay=slow_mode_delay, - unrestrict_boost_count=unrestrict_boost_count, - message_auto_delete_time=message_auto_delete_time, - has_aggressive_anti_spam_enabled=has_aggressive_anti_spam_enabled, - has_hidden_members=has_hidden_members, - has_protected_content=has_protected_content, - has_visible_history=has_visible_history, - sticker_set_name=sticker_set_name, + birthdate=birthdate, + business_intro=business_intro, + business_location=business_location, + business_opening_hours=business_opening_hours, can_set_sticker_set=can_set_sticker_set, custom_emoji_sticker_set_name=custom_emoji_sticker_set_name, + description=description, + emoji_status_custom_emoji_id=emoji_status_custom_emoji_id, + emoji_status_expiration_date=emoji_status_expiration_date, + has_aggressive_anti_spam_enabled=has_aggressive_anti_spam_enabled, + has_hidden_members=has_hidden_members, + has_private_forwards=has_private_forwards, + has_protected_content=has_protected_content, + has_restricted_voice_and_video_messages=has_restricted_voice_and_video_messages, + has_visible_history=has_visible_history, + invite_link=invite_link, + join_by_request=join_by_request, + join_to_send_messages=join_to_send_messages, linked_chat_id=linked_chat_id, location=location, + message_auto_delete_time=message_auto_delete_time, + permissions=permissions, + personal_chat=personal_chat, + photo=photo, + pinned_message=pinned_message, + profile_accent_color_id=profile_accent_color_id, + profile_background_custom_emoji_id=profile_background_custom_emoji_id, + slow_mode_delay=slow_mode_delay, + sticker_set_name=sticker_set_name, + unrestrict_boost_count=unrestrict_boost_count, **__pydantic_kwargs, ) @@ -522,6 +671,7 @@ class Chat(TelegramObject): def do( self, action: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, **kwargs: Any, ) -> SendChatAction: @@ -540,7 +690,8 @@ class Chat(TelegramObject): Source: https://core.telegram.org/bots/api#sendchataction :param action: Type of action to broadcast. Choose one, depending on what the user is about to receive: *typing* for `text messages `_, *upload_photo* for `photos `_, *record_video* or *upload_video* for `videos `_, *record_voice* or *upload_voice* for `voice notes `_, *upload_document* for `general files `_, *choose_sticker* for `stickers `_, *find_location* for `location data `_, *record_video_note* or *upload_video_note* for `video notes `_. - :param message_thread_id: Unique identifier for the target message thread; supergroups only + :param business_connection_id: Unique identifier of the business connection on behalf of which the action will be sent + :param message_thread_id: Unique identifier for the target message thread; for supergroups only :return: instance of method :class:`aiogram.methods.send_chat_action.SendChatAction` """ # DO NOT EDIT MANUALLY!!! @@ -551,6 +702,7 @@ class Chat(TelegramObject): return SendChatAction( chat_id=self.id, action=action, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, **kwargs, ).as_(self._bot) @@ -882,12 +1034,12 @@ class Chat(TelegramObject): :param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings :param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat :param can_post_stories: Pass :code:`True` if the administrator can post stories to the chat - :param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users + :param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive :param can_delete_stories: Pass :code:`True` if the administrator can delete stories posted by other users - :param can_post_messages: Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only - :param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only - :param can_pin_messages: Pass :code:`True` if the administrator can pin messages, supergroups only - :param can_manage_topics: Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only + :param can_post_messages: Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; for channels only + :param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages; for channels only + :param can_pin_messages: Pass :code:`True` if the administrator can pin messages; for supergroups only + :param can_manage_topics: Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only :return: instance of method :class:`aiogram.methods.promote_chat_member.PromoteChatMember` """ # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/chat_administrator_rights.py b/aiogram/types/chat_administrator_rights.py index 723add7d..0b205780 100644 --- a/aiogram/types/chat_administrator_rights.py +++ b/aiogram/types/chat_administrator_rights.py @@ -34,17 +34,17 @@ class ChatAdministratorRights(TelegramObject): can_post_stories: bool """:code:`True`, if the administrator can post stories to the chat""" can_edit_stories: bool - """:code:`True`, if the administrator can edit stories posted by other users""" + """:code:`True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive""" can_delete_stories: bool """:code:`True`, if the administrator can delete stories posted by other users""" can_post_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only""" + """*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; for channels only""" can_edit_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only""" + """*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; for channels only""" can_pin_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only""" + """*Optional*. :code:`True`, if the user is allowed to pin messages; for groups and supergroups only""" can_manage_topics: Optional[bool] = None - """*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only""" + """*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/chat_background.py b/aiogram/types/chat_background.py new file mode 100644 index 00000000..937b4366 --- /dev/null +++ b/aiogram/types/chat_background.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Union + +if TYPE_CHECKING: + from .background_type_chat_theme import BackgroundTypeChatTheme + from .background_type_fill import BackgroundTypeFill + from .background_type_pattern import BackgroundTypePattern + from .background_type_wallpaper import BackgroundTypeWallpaper +from .base import TelegramObject + + +class ChatBackground(TelegramObject): + """ + This object represents a chat background. + + Source: https://core.telegram.org/bots/api#chatbackground + """ + + type: Union[ + BackgroundTypeFill, BackgroundTypeWallpaper, BackgroundTypePattern, BackgroundTypeChatTheme + ] + """Type of the background""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Union[ + BackgroundTypeFill, + BackgroundTypeWallpaper, + BackgroundTypePattern, + BackgroundTypeChatTheme, + ], + **__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, **__pydantic_kwargs) diff --git a/aiogram/types/chat_full_info.py b/aiogram/types/chat_full_info.py new file mode 100644 index 00000000..4c5e446f --- /dev/null +++ b/aiogram/types/chat_full_info.py @@ -0,0 +1,218 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional, Union + +from .chat import Chat +from .custom import DateTime + +if TYPE_CHECKING: + from .birthdate import Birthdate + from .business_intro import BusinessIntro + from .business_location import BusinessLocation + from .business_opening_hours import BusinessOpeningHours + from .chat_location import ChatLocation + from .chat_permissions import ChatPermissions + from .chat_photo import ChatPhoto + from .message import Message + from .reaction_type_custom_emoji import ReactionTypeCustomEmoji + from .reaction_type_emoji import ReactionTypeEmoji + + +class ChatFullInfo(Chat): + """ + This object contains full information about a chat. + + Source: https://core.telegram.org/bots/api#chatfullinfo + """ + + id: int + """Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.""" + type: str + """Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'""" + accent_color_id: int + """Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details.""" + max_reaction_count: int + """The maximum number of reactions that can be set on a message in the chat""" + title: Optional[str] = None + """*Optional*. Title, for supergroups, channels and group chats""" + username: Optional[str] = None + """*Optional*. Username, for private chats, supergroups and channels if available""" + first_name: Optional[str] = None + """*Optional*. First name of the other party in a private chat""" + last_name: Optional[str] = None + """*Optional*. Last name of the other party in a private chat""" + is_forum: Optional[bool] = None + """*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 + """*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""" + business_intro: Optional[BusinessIntro] = None + """*Optional*. For private chats with business accounts, the intro of the business""" + business_location: Optional[BusinessLocation] = None + """*Optional*. For private chats with business accounts, the location of the business""" + business_opening_hours: Optional[BusinessOpeningHours] = None + """*Optional*. For private chats with business accounts, the opening hours of the business""" + personal_chat: Optional[Chat] = None + """*Optional*. For private chats, the personal channel of the user""" + available_reactions: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = 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 + """*Optional*. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background""" + profile_accent_color_id: Optional[int] = None + """*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details.""" + profile_background_custom_emoji_id: Optional[str] = None + """*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background""" + emoji_status_custom_emoji_id: Optional[str] = None + """*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat""" + emoji_status_expiration_date: Optional[DateTime] = None + """*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any""" + bio: Optional[str] = None + """*Optional*. Bio of the other party in a private chat""" + has_private_forwards: Optional[bool] = None + """*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=` links only in chats with the user""" + has_restricted_voice_and_video_messages: Optional[bool] = None + """*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat""" + join_to_send_messages: Optional[bool] = None + """*Optional*. :code:`True`, if users need to join the supergroup before they can send messages""" + join_by_request: Optional[bool] = None + """*Optional*. :code:`True`, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators""" + description: Optional[str] = None + """*Optional*. Description, for groups, supergroups and channel chats""" + invite_link: Optional[str] = None + """*Optional*. Primary invite link, for groups, supergroups and channel chats""" + pinned_message: Optional[Message] = None + """*Optional*. The most recent pinned message (by sending date)""" + permissions: Optional[ChatPermissions] = None + """*Optional*. Default chat member permissions, for groups and supergroups""" + slow_mode_delay: Optional[int] = None + """*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds""" + unrestrict_boost_count: Optional[int] = None + """*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions""" + message_auto_delete_time: Optional[int] = None + """*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds""" + has_aggressive_anti_spam_enabled: Optional[bool] = None + """*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.""" + has_hidden_members: Optional[bool] = None + """*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat""" + has_protected_content: Optional[bool] = None + """*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats""" + has_visible_history: Optional[bool] = None + """*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators""" + sticker_set_name: Optional[str] = None + """*Optional*. For supergroups, name of the group sticker set""" + can_set_sticker_set: Optional[bool] = None + """*Optional*. :code:`True`, if the bot can change the group sticker set""" + custom_emoji_sticker_set_name: Optional[str] = None + """*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.""" + linked_chat_id: Optional[int] = None + """*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.""" + location: Optional[ChatLocation] = None + """*Optional*. For supergroups, the location to which the supergroup is connected""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + id: int, + type: str, + accent_color_id: int, + max_reaction_count: int, + title: Optional[str] = None, + username: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + is_forum: Optional[bool] = None, + photo: Optional[ChatPhoto] = 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]] + ] = None, + background_custom_emoji_id: Optional[str] = None, + profile_accent_color_id: Optional[int] = None, + profile_background_custom_emoji_id: Optional[str] = None, + emoji_status_custom_emoji_id: Optional[str] = None, + emoji_status_expiration_date: Optional[DateTime] = None, + bio: Optional[str] = None, + has_private_forwards: Optional[bool] = None, + has_restricted_voice_and_video_messages: Optional[bool] = None, + join_to_send_messages: Optional[bool] = None, + join_by_request: Optional[bool] = None, + description: Optional[str] = None, + invite_link: Optional[str] = None, + pinned_message: Optional[Message] = None, + permissions: Optional[ChatPermissions] = None, + slow_mode_delay: Optional[int] = None, + unrestrict_boost_count: Optional[int] = None, + message_auto_delete_time: Optional[int] = None, + has_aggressive_anti_spam_enabled: Optional[bool] = None, + has_hidden_members: Optional[bool] = None, + has_protected_content: Optional[bool] = None, + has_visible_history: Optional[bool] = None, + sticker_set_name: Optional[str] = None, + can_set_sticker_set: Optional[bool] = None, + custom_emoji_sticker_set_name: Optional[str] = None, + linked_chat_id: Optional[int] = None, + location: Optional[ChatLocation] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + id=id, + type=type, + accent_color_id=accent_color_id, + max_reaction_count=max_reaction_count, + title=title, + username=username, + first_name=first_name, + last_name=last_name, + is_forum=is_forum, + photo=photo, + active_usernames=active_usernames, + birthdate=birthdate, + business_intro=business_intro, + business_location=business_location, + business_opening_hours=business_opening_hours, + personal_chat=personal_chat, + available_reactions=available_reactions, + background_custom_emoji_id=background_custom_emoji_id, + profile_accent_color_id=profile_accent_color_id, + profile_background_custom_emoji_id=profile_background_custom_emoji_id, + emoji_status_custom_emoji_id=emoji_status_custom_emoji_id, + emoji_status_expiration_date=emoji_status_expiration_date, + bio=bio, + has_private_forwards=has_private_forwards, + has_restricted_voice_and_video_messages=has_restricted_voice_and_video_messages, + join_to_send_messages=join_to_send_messages, + join_by_request=join_by_request, + description=description, + invite_link=invite_link, + pinned_message=pinned_message, + permissions=permissions, + slow_mode_delay=slow_mode_delay, + unrestrict_boost_count=unrestrict_boost_count, + message_auto_delete_time=message_auto_delete_time, + has_aggressive_anti_spam_enabled=has_aggressive_anti_spam_enabled, + has_hidden_members=has_hidden_members, + has_protected_content=has_protected_content, + has_visible_history=has_visible_history, + sticker_set_name=sticker_set_name, + can_set_sticker_set=can_set_sticker_set, + custom_emoji_sticker_set_name=custom_emoji_sticker_set_name, + linked_chat_id=linked_chat_id, + location=location, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/chat_join_request.py b/aiogram/types/chat_join_request.py index 074bcc45..4a128f17 100644 --- a/aiogram/types/chat_join_request.py +++ b/aiogram/types/chat_join_request.py @@ -40,6 +40,7 @@ if TYPE_CHECKING: from .input_media_document import InputMediaDocument from .input_media_photo import InputMediaPhoto from .input_media_video import InputMediaVideo + from .input_poll_option import InputPollOption from .labeled_price import LabeledPrice from .link_preview_options import LinkPreviewOptions from .message_entity import MessageEntity @@ -157,6 +158,7 @@ class ChatJoinRequest(TelegramObject): def answer( self, text: str, + 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, @@ -165,6 +167,7 @@ class ChatJoinRequest(TelegramObject): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -187,14 +190,16 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendmessage :param text: Text of the message to be sent, 1-4096 characters after entities parsing + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* :param 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 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 reply keyboard or to force a reply from the user. + :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 :param disable_web_page_preview: Disables link previews for links in this message :param reply_to_message_id: If the message is a reply, ID of the original message @@ -208,12 +213,14 @@ class ChatJoinRequest(TelegramObject): return SendMessage( chat_id=self.chat.id, text=text, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -225,6 +232,7 @@ class ChatJoinRequest(TelegramObject): def answer_pm( self, text: str, + 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, @@ -233,6 +241,7 @@ class ChatJoinRequest(TelegramObject): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -255,14 +264,16 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendmessage :param text: Text of the message to be sent, 1-4096 characters after entities parsing + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* :param 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 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 reply keyboard or to force a reply from the user. + :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 :param disable_web_page_preview: Disables link previews for links in this message :param reply_to_message_id: If the message is a reply, ID of the original message @@ -276,12 +287,14 @@ class ChatJoinRequest(TelegramObject): return SendMessage( chat_id=self.user_chat_id, text=text, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -293,6 +306,7 @@ class ChatJoinRequest(TelegramObject): def answer_animation( self, animation: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -301,9 +315,13 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -323,6 +341,7 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendanimation :param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent animation in seconds :param width: Animation width @@ -331,11 +350,13 @@ class ChatJoinRequest(TelegramObject): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` @@ -348,6 +369,7 @@ class ChatJoinRequest(TelegramObject): return SendAnimation( chat_id=self.chat.id, animation=animation, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -356,9 +378,11 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -369,6 +393,7 @@ class ChatJoinRequest(TelegramObject): def answer_animation_pm( self, animation: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -377,9 +402,13 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -399,6 +428,7 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendanimation :param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent animation in seconds :param width: Animation width @@ -407,11 +437,13 @@ class ChatJoinRequest(TelegramObject): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` @@ -424,6 +456,7 @@ class ChatJoinRequest(TelegramObject): return SendAnimation( chat_id=self.user_chat_id, animation=animation, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -432,9 +465,11 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -445,6 +480,7 @@ class ChatJoinRequest(TelegramObject): def answer_audio( self, audio: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -455,6 +491,7 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -475,6 +512,7 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendaudio :param audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Audio caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the audio caption. See `formatting options `_ for more details. @@ -485,8 +523,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` @@ -499,6 +538,7 @@ class ChatJoinRequest(TelegramObject): return SendAudio( chat_id=self.chat.id, audio=audio, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -509,6 +549,7 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -519,6 +560,7 @@ class ChatJoinRequest(TelegramObject): def answer_audio_pm( self, audio: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -529,6 +571,7 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -549,6 +592,7 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendaudio :param audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Audio caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the audio caption. See `formatting options `_ for more details. @@ -559,8 +603,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` @@ -573,6 +618,7 @@ class ChatJoinRequest(TelegramObject): return SendAudio( chat_id=self.user_chat_id, audio=audio, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -583,6 +629,7 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -594,11 +641,13 @@ class ChatJoinRequest(TelegramObject): self, phone_number: str, first_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, last_name: Optional[str] = None, vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -619,13 +668,15 @@ class ChatJoinRequest(TelegramObject): :param phone_number: Contact's phone number :param first_name: Contact's first name + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param last_name: Contact's last name :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_contact.SendContact` @@ -639,11 +690,13 @@ class ChatJoinRequest(TelegramObject): chat_id=self.chat.id, phone_number=phone_number, first_name=first_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, last_name=last_name, vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -655,11 +708,13 @@ class ChatJoinRequest(TelegramObject): self, phone_number: str, first_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, last_name: Optional[str] = None, vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -680,13 +735,15 @@ class ChatJoinRequest(TelegramObject): :param phone_number: Contact's phone number :param first_name: Contact's first name + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param last_name: Contact's last name :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_contact.SendContact` @@ -700,11 +757,13 @@ class ChatJoinRequest(TelegramObject): chat_id=self.user_chat_id, phone_number=phone_number, first_name=first_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, last_name=last_name, vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -715,6 +774,7 @@ class ChatJoinRequest(TelegramObject): def answer_document( self, document: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, thumbnail: Optional[InputFile] = None, caption: Optional[str] = None, @@ -723,6 +783,7 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -742,6 +803,7 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#senddocument :param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing @@ -750,8 +812,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_document.SendDocument` @@ -764,6 +827,7 @@ class ChatJoinRequest(TelegramObject): return SendDocument( chat_id=self.chat.id, document=document, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, thumbnail=thumbnail, caption=caption, @@ -772,6 +836,7 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -782,6 +847,7 @@ class ChatJoinRequest(TelegramObject): def answer_document_pm( self, document: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, thumbnail: Optional[InputFile] = None, caption: Optional[str] = None, @@ -790,6 +856,7 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -809,6 +876,7 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#senddocument :param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing @@ -817,8 +885,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_document.SendDocument` @@ -831,6 +900,7 @@ class ChatJoinRequest(TelegramObject): return SendDocument( chat_id=self.user_chat_id, document=document, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, thumbnail=thumbnail, caption=caption, @@ -839,6 +909,7 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -849,9 +920,11 @@ class ChatJoinRequest(TelegramObject): def answer_game( self, game_short_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -869,9 +942,11 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendgame :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -886,9 +961,11 @@ class ChatJoinRequest(TelegramObject): return SendGame( chat_id=self.chat.id, game_short_name=game_short_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -899,9 +976,11 @@ class ChatJoinRequest(TelegramObject): def answer_game_pm( self, game_short_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -919,9 +998,11 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendgame :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -936,9 +1017,11 @@ class ChatJoinRequest(TelegramObject): return SendGame( chat_id=self.user_chat_id, game_short_name=game_short_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -951,10 +1034,10 @@ class ChatJoinRequest(TelegramObject): title: str, description: str, payload: str, - provider_token: str, currency: str, 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, start_parameter: Optional[str] = None, @@ -972,6 +1055,7 @@ class ChatJoinRequest(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -991,11 +1075,11 @@ class ChatJoinRequest(TelegramObject): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: 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*. :param start_parameter: 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 :param provider_data: 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. @@ -1003,15 +1087,16 @@ class ChatJoinRequest(TelegramObject): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1028,10 +1113,10 @@ class ChatJoinRequest(TelegramObject): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -1049,6 +1134,7 @@ class ChatJoinRequest(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1061,10 +1147,10 @@ class ChatJoinRequest(TelegramObject): title: str, description: str, payload: str, - provider_token: str, currency: str, 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, start_parameter: Optional[str] = None, @@ -1082,6 +1168,7 @@ class ChatJoinRequest(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1101,11 +1188,11 @@ class ChatJoinRequest(TelegramObject): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: 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*. :param start_parameter: 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 :param provider_data: 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. @@ -1113,15 +1200,16 @@ class ChatJoinRequest(TelegramObject): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1138,10 +1226,10 @@ class ChatJoinRequest(TelegramObject): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -1159,6 +1247,7 @@ class ChatJoinRequest(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1170,6 +1259,7 @@ class ChatJoinRequest(TelegramObject): self, latitude: float, longitude: float, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, horizontal_accuracy: Optional[float] = None, live_period: Optional[int] = None, @@ -1177,6 +1267,7 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1197,15 +1288,17 @@ class ChatJoinRequest(TelegramObject): :param latitude: Latitude of the location :param longitude: Longitude of the location + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500 - :param live_period: Period in seconds for which the location will be updated (see `Live Locations `_, should be between 60 and 86400. + :param live_period: Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. :param heading: For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_location.SendLocation` @@ -1219,6 +1312,7 @@ class ChatJoinRequest(TelegramObject): chat_id=self.chat.id, latitude=latitude, longitude=longitude, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, horizontal_accuracy=horizontal_accuracy, live_period=live_period, @@ -1226,6 +1320,7 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1237,6 +1332,7 @@ class ChatJoinRequest(TelegramObject): self, latitude: float, longitude: float, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, horizontal_accuracy: Optional[float] = None, live_period: Optional[int] = None, @@ -1244,6 +1340,7 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1264,15 +1361,17 @@ class ChatJoinRequest(TelegramObject): :param latitude: Latitude of the location :param longitude: Longitude of the location + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500 - :param live_period: Period in seconds for which the location will be updated (see `Live Locations `_, should be between 60 and 86400. + :param live_period: Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. :param heading: For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_location.SendLocation` @@ -1286,6 +1385,7 @@ class ChatJoinRequest(TelegramObject): chat_id=self.user_chat_id, latitude=latitude, longitude=longitude, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, horizontal_accuracy=horizontal_accuracy, live_period=live_period, @@ -1293,6 +1393,7 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1303,9 +1404,11 @@ class ChatJoinRequest(TelegramObject): def answer_media_group( self, 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"), + 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, @@ -1322,9 +1425,11 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendmediagroup :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -1338,9 +1443,11 @@ class ChatJoinRequest(TelegramObject): return SendMediaGroup( chat_id=self.chat.id, media=media, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -1350,9 +1457,11 @@ class ChatJoinRequest(TelegramObject): def answer_media_group_pm( self, 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"), + 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, @@ -1369,9 +1478,11 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendmediagroup :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -1385,9 +1496,11 @@ class ChatJoinRequest(TelegramObject): return SendMediaGroup( chat_id=self.user_chat_id, media=media, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -1397,13 +1510,18 @@ class ChatJoinRequest(TelegramObject): def answer_photo( self, photo: Union[InputFile, str], + business_connection_id: Optional[str] = None, 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, + 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"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1423,15 +1541,18 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendphoto :param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` @@ -1444,13 +1565,16 @@ class ChatJoinRequest(TelegramObject): return SendPhoto( chat_id=self.chat.id, photo=photo, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1461,13 +1585,18 @@ class ChatJoinRequest(TelegramObject): def answer_photo_pm( self, photo: Union[InputFile, str], + business_connection_id: Optional[str] = None, 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, + 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"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1487,15 +1616,18 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendphoto :param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` @@ -1508,13 +1640,16 @@ class ChatJoinRequest(TelegramObject): return SendPhoto( chat_id=self.user_chat_id, photo=photo, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1525,8 +1660,11 @@ class ChatJoinRequest(TelegramObject): def answer_poll( self, question: str, - options: List[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, is_anonymous: Optional[bool] = None, type: Optional[str] = None, allows_multiple_answers: Optional[bool] = None, @@ -1539,6 +1677,7 @@ class ChatJoinRequest(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1558,22 +1697,26 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendpoll :param question: Poll question, 1-300 characters - :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each + :param options: A JSON-serialized list of 2-10 answer options + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param question_parse_mode: Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed + :param question_entities: A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode* :param is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True` :param type: Poll type, 'quiz' or 'regular', defaults to 'regular' :param allows_multiple_answers: :code:`True`, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False` :param correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode :param explanation: 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 :param explanation_parse_mode: Mode for parsing entities in the explanation. See `formatting options `_ for more details. - :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode* + :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode* :param open_period: Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*. :param close_date: Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` @@ -1587,7 +1730,10 @@ class ChatJoinRequest(TelegramObject): chat_id=self.chat.id, question=question, options=options, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, + question_parse_mode=question_parse_mode, + question_entities=question_entities, is_anonymous=is_anonymous, type=type, allows_multiple_answers=allows_multiple_answers, @@ -1600,6 +1746,7 @@ class ChatJoinRequest(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1610,8 +1757,11 @@ class ChatJoinRequest(TelegramObject): def answer_poll_pm( self, question: str, - options: List[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, is_anonymous: Optional[bool] = None, type: Optional[str] = None, allows_multiple_answers: Optional[bool] = None, @@ -1624,6 +1774,7 @@ class ChatJoinRequest(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1643,22 +1794,26 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendpoll :param question: Poll question, 1-300 characters - :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each + :param options: A JSON-serialized list of 2-10 answer options + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param question_parse_mode: Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed + :param question_entities: A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode* :param is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True` :param type: Poll type, 'quiz' or 'regular', defaults to 'regular' :param allows_multiple_answers: :code:`True`, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False` :param correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode :param explanation: 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 :param explanation_parse_mode: Mode for parsing entities in the explanation. See `formatting options `_ for more details. - :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode* + :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode* :param open_period: Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*. :param close_date: Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` @@ -1672,7 +1827,10 @@ class ChatJoinRequest(TelegramObject): chat_id=self.user_chat_id, question=question, options=options, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, + question_parse_mode=question_parse_mode, + question_entities=question_entities, is_anonymous=is_anonymous, type=type, allows_multiple_answers=allows_multiple_answers, @@ -1685,6 +1843,7 @@ class ChatJoinRequest(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1694,10 +1853,12 @@ class ChatJoinRequest(TelegramObject): def answer_dice( self, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1716,12 +1877,14 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#senddice + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_dice.SendDice` @@ -1733,10 +1896,12 @@ class ChatJoinRequest(TelegramObject): return SendDice( chat_id=self.chat.id, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1746,10 +1911,12 @@ class ChatJoinRequest(TelegramObject): def answer_dice_pm( self, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1768,12 +1935,14 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#senddice + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_dice.SendDice` @@ -1785,10 +1954,12 @@ class ChatJoinRequest(TelegramObject): return SendDice( chat_id=self.user_chat_id, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1799,10 +1970,12 @@ class ChatJoinRequest(TelegramObject): def answer_sticker( self, sticker: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1821,13 +1994,15 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendsticker - :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL. + :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL. + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` @@ -1840,10 +2015,12 @@ class ChatJoinRequest(TelegramObject): return SendSticker( chat_id=self.chat.id, sticker=sticker, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1854,10 +2031,12 @@ class ChatJoinRequest(TelegramObject): def answer_sticker_pm( self, sticker: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1876,13 +2055,15 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendsticker - :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL. + :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL. + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` @@ -1895,10 +2076,12 @@ class ChatJoinRequest(TelegramObject): return SendSticker( chat_id=self.user_chat_id, sticker=sticker, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1912,6 +2095,7 @@ class ChatJoinRequest(TelegramObject): longitude: float, title: str, address: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, foursquare_id: Optional[str] = None, foursquare_type: Optional[str] = None, @@ -1919,6 +2103,7 @@ class ChatJoinRequest(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1941,6 +2126,7 @@ class ChatJoinRequest(TelegramObject): :param longitude: Longitude of the venue :param title: Name of the venue :param address: Address of the venue + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param foursquare_id: Foursquare identifier of the venue :param foursquare_type: Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) @@ -1948,8 +2134,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` @@ -1965,6 +2152,7 @@ class ChatJoinRequest(TelegramObject): longitude=longitude, title=title, address=address, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, foursquare_id=foursquare_id, foursquare_type=foursquare_type, @@ -1972,6 +2160,7 @@ class ChatJoinRequest(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1985,6 +2174,7 @@ class ChatJoinRequest(TelegramObject): longitude: float, title: str, address: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, foursquare_id: Optional[str] = None, foursquare_type: Optional[str] = None, @@ -1992,6 +2182,7 @@ class ChatJoinRequest(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2014,6 +2205,7 @@ class ChatJoinRequest(TelegramObject): :param longitude: Longitude of the venue :param title: Name of the venue :param address: Address of the venue + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param foursquare_id: Foursquare identifier of the venue :param foursquare_type: Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) @@ -2021,8 +2213,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` @@ -2038,6 +2231,7 @@ class ChatJoinRequest(TelegramObject): longitude=longitude, title=title, address=address, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, foursquare_id=foursquare_id, foursquare_type=foursquare_type, @@ -2045,6 +2239,7 @@ class ChatJoinRequest(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2055,6 +2250,7 @@ class ChatJoinRequest(TelegramObject): def answer_video( self, video: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -2063,10 +2259,14 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2086,6 +2286,7 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendvideo :param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent video in seconds :param width: Video width @@ -2094,12 +2295,14 @@ class ChatJoinRequest(TelegramObject): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video.SendVideo` @@ -2112,6 +2315,7 @@ class ChatJoinRequest(TelegramObject): return SendVideo( chat_id=self.chat.id, video=video, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -2120,10 +2324,12 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2134,6 +2340,7 @@ class ChatJoinRequest(TelegramObject): def answer_video_pm( self, video: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -2142,10 +2349,14 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2165,6 +2376,7 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendvideo :param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent video in seconds :param width: Video width @@ -2173,12 +2385,14 @@ class ChatJoinRequest(TelegramObject): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video.SendVideo` @@ -2191,6 +2405,7 @@ class ChatJoinRequest(TelegramObject): return SendVideo( chat_id=self.user_chat_id, video=video, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -2199,10 +2414,12 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2213,12 +2430,14 @@ class ChatJoinRequest(TelegramObject): def answer_video_note( self, video_note: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, length: Optional[int] = None, thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2238,14 +2457,16 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendvideonote :param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `. Sending video notes by a URL is currently unsupported + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent video in seconds :param length: Video width and height, i.e. diameter of the video message :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` @@ -2258,12 +2479,14 @@ class ChatJoinRequest(TelegramObject): return SendVideoNote( chat_id=self.chat.id, video_note=video_note, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, length=length, thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2274,12 +2497,14 @@ class ChatJoinRequest(TelegramObject): def answer_video_note_pm( self, video_note: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, length: Optional[int] = None, thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2299,14 +2524,16 @@ class ChatJoinRequest(TelegramObject): Source: https://core.telegram.org/bots/api#sendvideonote :param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `. Sending video notes by a URL is currently unsupported + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent video in seconds :param length: Video width and height, i.e. diameter of the video message :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` @@ -2319,12 +2546,14 @@ class ChatJoinRequest(TelegramObject): return SendVideoNote( chat_id=self.user_chat_id, video_note=video_note, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, length=length, thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2335,6 +2564,7 @@ class ChatJoinRequest(TelegramObject): def answer_voice( self, voice: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -2342,6 +2572,7 @@ class ChatJoinRequest(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2356,11 +2587,12 @@ class ChatJoinRequest(TelegramObject): - :code:`chat_id` - Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvoice :param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Voice message caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the voice message caption. See `formatting options `_ for more details. @@ -2368,8 +2600,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` @@ -2382,6 +2615,7 @@ class ChatJoinRequest(TelegramObject): return SendVoice( chat_id=self.chat.id, voice=voice, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -2389,6 +2623,7 @@ class ChatJoinRequest(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2399,6 +2634,7 @@ class ChatJoinRequest(TelegramObject): def answer_voice_pm( self, voice: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -2406,6 +2642,7 @@ class ChatJoinRequest(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2420,11 +2657,12 @@ class ChatJoinRequest(TelegramObject): - :code:`chat_id` - Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvoice :param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Voice message caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the voice message caption. See `formatting options `_ for more details. @@ -2432,8 +2670,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` @@ -2446,6 +2685,7 @@ class ChatJoinRequest(TelegramObject): return SendVoice( chat_id=self.user_chat_id, voice=voice, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -2453,6 +2693,7 @@ class ChatJoinRequest(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/types/chat_member_administrator.py b/aiogram/types/chat_member_administrator.py index d135bc20..10552f74 100644 --- a/aiogram/types/chat_member_administrator.py +++ b/aiogram/types/chat_member_administrator.py @@ -41,17 +41,17 @@ class ChatMemberAdministrator(ChatMember): can_post_stories: bool """:code:`True`, if the administrator can post stories to the chat""" can_edit_stories: bool - """:code:`True`, if the administrator can edit stories posted by other users""" + """:code:`True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive""" can_delete_stories: bool """:code:`True`, if the administrator can delete stories posted by other users""" can_post_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only""" + """*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; for channels only""" can_edit_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only""" + """*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; for channels only""" can_pin_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only""" + """*Optional*. :code:`True`, if the user is allowed to pin messages; for groups and supergroups only""" can_manage_topics: Optional[bool] = None - """*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only""" + """*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only""" custom_title: Optional[str] = None """*Optional*. Custom title for this user""" diff --git a/aiogram/types/chat_member_updated.py b/aiogram/types/chat_member_updated.py index 8398d865..48c3e9db 100644 --- a/aiogram/types/chat_member_updated.py +++ b/aiogram/types/chat_member_updated.py @@ -44,6 +44,7 @@ if TYPE_CHECKING: from .input_media_document import InputMediaDocument from .input_media_photo import InputMediaPhoto from .input_media_video import InputMediaVideo + from .input_poll_option import InputPollOption from .labeled_price import LabeledPrice from .link_preview_options import LinkPreviewOptions from .message_entity import MessageEntity @@ -86,6 +87,8 @@ class ChatMemberUpdated(TelegramObject): """New information about the chat member""" invite_link: Optional[ChatInviteLink] = None """*Optional*. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.""" + via_join_request: Optional[bool] = None + """*Optional*. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator""" via_chat_folder_invite_link: Optional[bool] = None """*Optional*. True, if the user joined the chat via a chat folder invite link""" @@ -116,6 +119,7 @@ class ChatMemberUpdated(TelegramObject): ChatMemberBanned, ], invite_link: Optional[ChatInviteLink] = None, + via_join_request: Optional[bool] = None, via_chat_folder_invite_link: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: @@ -130,6 +134,7 @@ class ChatMemberUpdated(TelegramObject): old_chat_member=old_chat_member, new_chat_member=new_chat_member, invite_link=invite_link, + via_join_request=via_join_request, via_chat_folder_invite_link=via_chat_folder_invite_link, **__pydantic_kwargs, ) @@ -137,6 +142,7 @@ class ChatMemberUpdated(TelegramObject): def answer( self, text: str, + 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, @@ -145,6 +151,7 @@ class ChatMemberUpdated(TelegramObject): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -167,14 +174,16 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendmessage :param text: Text of the message to be sent, 1-4096 characters after entities parsing + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* :param 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 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 reply keyboard or to force a reply from the user. + :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 :param disable_web_page_preview: Disables link previews for links in this message :param reply_to_message_id: If the message is a reply, ID of the original message @@ -188,12 +197,14 @@ class ChatMemberUpdated(TelegramObject): return SendMessage( chat_id=self.chat.id, text=text, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -205,6 +216,7 @@ class ChatMemberUpdated(TelegramObject): def answer_animation( self, animation: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -213,9 +225,13 @@ class ChatMemberUpdated(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -235,6 +251,7 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendanimation :param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent animation in seconds :param width: Animation width @@ -243,11 +260,13 @@ class ChatMemberUpdated(TelegramObject): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` @@ -260,6 +279,7 @@ class ChatMemberUpdated(TelegramObject): return SendAnimation( chat_id=self.chat.id, animation=animation, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -268,9 +288,11 @@ class ChatMemberUpdated(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -281,6 +303,7 @@ class ChatMemberUpdated(TelegramObject): def answer_audio( self, audio: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -291,6 +314,7 @@ class ChatMemberUpdated(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -311,6 +335,7 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendaudio :param audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Audio caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the audio caption. See `formatting options `_ for more details. @@ -321,8 +346,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` @@ -335,6 +361,7 @@ class ChatMemberUpdated(TelegramObject): return SendAudio( chat_id=self.chat.id, audio=audio, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -345,6 +372,7 @@ class ChatMemberUpdated(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -356,11 +384,13 @@ class ChatMemberUpdated(TelegramObject): self, phone_number: str, first_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, last_name: Optional[str] = None, vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -381,13 +411,15 @@ class ChatMemberUpdated(TelegramObject): :param phone_number: Contact's phone number :param first_name: Contact's first name + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param last_name: Contact's last name :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_contact.SendContact` @@ -401,11 +433,13 @@ class ChatMemberUpdated(TelegramObject): chat_id=self.chat.id, phone_number=phone_number, first_name=first_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, last_name=last_name, vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -416,6 +450,7 @@ class ChatMemberUpdated(TelegramObject): def answer_document( self, document: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, thumbnail: Optional[InputFile] = None, caption: Optional[str] = None, @@ -424,6 +459,7 @@ class ChatMemberUpdated(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -443,6 +479,7 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#senddocument :param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing @@ -451,8 +488,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_document.SendDocument` @@ -465,6 +503,7 @@ class ChatMemberUpdated(TelegramObject): return SendDocument( chat_id=self.chat.id, document=document, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, thumbnail=thumbnail, caption=caption, @@ -473,6 +512,7 @@ class ChatMemberUpdated(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -483,9 +523,11 @@ class ChatMemberUpdated(TelegramObject): def answer_game( self, game_short_name: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -503,9 +545,11 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendgame :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -520,9 +564,11 @@ class ChatMemberUpdated(TelegramObject): return SendGame( chat_id=self.chat.id, game_short_name=game_short_name, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -535,10 +581,10 @@ class ChatMemberUpdated(TelegramObject): title: str, description: str, payload: str, - provider_token: str, currency: str, 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, start_parameter: Optional[str] = None, @@ -556,6 +602,7 @@ class ChatMemberUpdated(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -575,11 +622,11 @@ class ChatMemberUpdated(TelegramObject): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: 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*. :param start_parameter: 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 :param provider_data: 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. @@ -587,15 +634,16 @@ class ChatMemberUpdated(TelegramObject): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -612,10 +660,10 @@ class ChatMemberUpdated(TelegramObject): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -633,6 +681,7 @@ class ChatMemberUpdated(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -644,6 +693,7 @@ class ChatMemberUpdated(TelegramObject): self, latitude: float, longitude: float, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, horizontal_accuracy: Optional[float] = None, live_period: Optional[int] = None, @@ -651,6 +701,7 @@ class ChatMemberUpdated(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -671,15 +722,17 @@ class ChatMemberUpdated(TelegramObject): :param latitude: Latitude of the location :param longitude: Longitude of the location + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500 - :param live_period: Period in seconds for which the location will be updated (see `Live Locations `_, should be between 60 and 86400. + :param live_period: Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. :param heading: For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_location.SendLocation` @@ -693,6 +746,7 @@ class ChatMemberUpdated(TelegramObject): chat_id=self.chat.id, latitude=latitude, longitude=longitude, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, horizontal_accuracy=horizontal_accuracy, live_period=live_period, @@ -700,6 +754,7 @@ class ChatMemberUpdated(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -710,9 +765,11 @@ class ChatMemberUpdated(TelegramObject): def answer_media_group( self, 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"), + 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, @@ -729,9 +786,11 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendmediagroup :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -745,9 +804,11 @@ class ChatMemberUpdated(TelegramObject): return SendMediaGroup( chat_id=self.chat.id, media=media, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -757,13 +818,18 @@ class ChatMemberUpdated(TelegramObject): def answer_photo( self, photo: Union[InputFile, str], + business_connection_id: Optional[str] = None, 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, + 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"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -783,15 +849,18 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendphoto :param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` @@ -804,13 +873,16 @@ class ChatMemberUpdated(TelegramObject): return SendPhoto( chat_id=self.chat.id, photo=photo, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -821,8 +893,11 @@ class ChatMemberUpdated(TelegramObject): def answer_poll( self, question: str, - options: List[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, is_anonymous: Optional[bool] = None, type: Optional[str] = None, allows_multiple_answers: Optional[bool] = None, @@ -835,6 +910,7 @@ class ChatMemberUpdated(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -854,22 +930,26 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendpoll :param question: Poll question, 1-300 characters - :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each + :param options: A JSON-serialized list of 2-10 answer options + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param question_parse_mode: Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed + :param question_entities: A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode* :param is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True` :param type: Poll type, 'quiz' or 'regular', defaults to 'regular' :param allows_multiple_answers: :code:`True`, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False` :param correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode :param explanation: 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 :param explanation_parse_mode: Mode for parsing entities in the explanation. See `formatting options `_ for more details. - :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode* + :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode* :param open_period: Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*. :param close_date: Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` @@ -883,7 +963,10 @@ class ChatMemberUpdated(TelegramObject): chat_id=self.chat.id, question=question, options=options, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, + question_parse_mode=question_parse_mode, + question_entities=question_entities, is_anonymous=is_anonymous, type=type, allows_multiple_answers=allows_multiple_answers, @@ -896,6 +979,7 @@ class ChatMemberUpdated(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -905,10 +989,12 @@ class ChatMemberUpdated(TelegramObject): def answer_dice( self, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -927,12 +1013,14 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#senddice + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_dice.SendDice` @@ -944,10 +1032,12 @@ class ChatMemberUpdated(TelegramObject): return SendDice( chat_id=self.chat.id, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -958,10 +1048,12 @@ class ChatMemberUpdated(TelegramObject): def answer_sticker( self, sticker: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -980,13 +1072,15 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendsticker - :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL. + :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL. + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` @@ -999,10 +1093,12 @@ class ChatMemberUpdated(TelegramObject): return SendSticker( chat_id=self.chat.id, sticker=sticker, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1016,6 +1112,7 @@ class ChatMemberUpdated(TelegramObject): longitude: float, title: str, address: str, + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, foursquare_id: Optional[str] = None, foursquare_type: Optional[str] = None, @@ -1023,6 +1120,7 @@ class ChatMemberUpdated(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1045,6 +1143,7 @@ class ChatMemberUpdated(TelegramObject): :param longitude: Longitude of the venue :param title: Name of the venue :param address: Address of the venue + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param foursquare_id: Foursquare identifier of the venue :param foursquare_type: Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) @@ -1052,8 +1151,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` @@ -1069,6 +1169,7 @@ class ChatMemberUpdated(TelegramObject): longitude=longitude, title=title, address=address, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, foursquare_id=foursquare_id, foursquare_type=foursquare_type, @@ -1076,6 +1177,7 @@ class ChatMemberUpdated(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1086,6 +1188,7 @@ class ChatMemberUpdated(TelegramObject): def answer_video( self, video: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, width: Optional[int] = None, @@ -1094,10 +1197,14 @@ class ChatMemberUpdated(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1117,6 +1224,7 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendvideo :param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent video in seconds :param width: Video width @@ -1125,12 +1233,14 @@ class ChatMemberUpdated(TelegramObject): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video.SendVideo` @@ -1143,6 +1253,7 @@ class ChatMemberUpdated(TelegramObject): return SendVideo( chat_id=self.chat.id, video=video, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, width=width, @@ -1151,10 +1262,12 @@ class ChatMemberUpdated(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1165,12 +1278,14 @@ class ChatMemberUpdated(TelegramObject): def answer_video_note( self, video_note: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, duration: Optional[int] = None, length: Optional[int] = None, thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1190,14 +1305,16 @@ class ChatMemberUpdated(TelegramObject): Source: https://core.telegram.org/bots/api#sendvideonote :param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `. Sending video notes by a URL is currently unsupported + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent video in seconds :param length: Video width and height, i.e. diameter of the video message :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` @@ -1210,12 +1327,14 @@ class ChatMemberUpdated(TelegramObject): return SendVideoNote( chat_id=self.chat.id, video_note=video_note, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, length=length, thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1226,6 +1345,7 @@ class ChatMemberUpdated(TelegramObject): def answer_voice( self, voice: Union[InputFile, str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), @@ -1233,6 +1353,7 @@ class ChatMemberUpdated(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1247,11 +1368,12 @@ class ChatMemberUpdated(TelegramObject): - :code:`chat_id` - Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvoice :param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param caption: Voice message caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the voice message caption. See `formatting options `_ for more details. @@ -1259,8 +1381,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` @@ -1273,6 +1396,7 @@ class ChatMemberUpdated(TelegramObject): return SendVoice( chat_id=self.chat.id, voice=voice, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, parse_mode=parse_mode, @@ -1280,6 +1404,7 @@ class ChatMemberUpdated(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/types/chat_shared.py b/aiogram/types/chat_shared.py index eb244c0a..92d62316 100644 --- a/aiogram/types/chat_shared.py +++ b/aiogram/types/chat_shared.py @@ -1,11 +1,16 @@ -from typing import TYPE_CHECKING, Any +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional from aiogram.types import TelegramObject +if TYPE_CHECKING: + from .photo_size import PhotoSize + class ChatShared(TelegramObject): """ - This object contains information about the chat whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_chat.KeyboardButtonRequestChat` button. + This object contains information about a chat that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_chat.KeyboardButtonRequestChat` button. Source: https://core.telegram.org/bots/api#chatshared """ @@ -14,16 +19,36 @@ class ChatShared(TelegramObject): """Identifier of the request""" chat_id: int """Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.""" + title: Optional[str] = None + """*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 + """*Optional*. Available sizes of the chat photo, if the photo was requested by the bot""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! # This section was auto-generated via `butcher` def __init__( - __pydantic__self__, *, request_id: int, chat_id: int, **__pydantic_kwargs: Any + __pydantic__self__, + *, + request_id: int, + chat_id: int, + title: Optional[str] = None, + username: Optional[str] = None, + photo: Optional[List[PhotoSize]] = None, + **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! # This method was auto-generated via `butcher` # Is needed only for type checking and IDE support without any additional plugins - super().__init__(request_id=request_id, chat_id=chat_id, **__pydantic_kwargs) + super().__init__( + request_id=request_id, + chat_id=chat_id, + title=title, + username=username, + photo=photo, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/encrypted_passport_element.py b/aiogram/types/encrypted_passport_element.py index 5594e700..c1e8be11 100644 --- a/aiogram/types/encrypted_passport_element.py +++ b/aiogram/types/encrypted_passport_element.py @@ -20,21 +20,21 @@ class EncryptedPassportElement(TelegramObject): hash: str """Base64-encoded element hash for using in :class:`aiogram.types.passport_element_error_unspecified.PassportElementErrorUnspecified`""" data: Optional[str] = None - """*Optional*. Base64-encoded encrypted Telegram Passport element data provided by the user, available for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" + """*Optional*. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" phone_number: Optional[str] = None - """*Optional*. User's verified phone number, available only for 'phone_number' type""" + """*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""" + """*Optional*. User's verified email address; available only for 'email' type""" files: Optional[List[PassportFile]] = None - """*Optional*. Array of encrypted files with documents provided by the user, available 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`.""" + """*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 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`.""" + """*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`.""" reverse_side: Optional[PassportFile] = None - """*Optional*. Encrypted file with the reverse side of the document, provided by the user. Available for 'driver_license' and 'identity_card'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" + """*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 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`.""" + """*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 - """*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`.""" + """*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: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/force_reply.py b/aiogram/types/force_reply.py index 122d5db7..14b9c1c5 100644 --- a/aiogram/types/force_reply.py +++ b/aiogram/types/force_reply.py @@ -7,7 +7,7 @@ from .base import MutableTelegramObject class ForceReply(MutableTelegramObject): """ - Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode `_. + Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode `_. Not supported in channels and for messages sent on behalf of a Telegram Business account. **Example:** A `poll bot `_ for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll: diff --git a/aiogram/types/inline_keyboard_button.py b/aiogram/types/inline_keyboard_button.py index 22a55b09..96b4a745 100644 --- a/aiogram/types/inline_keyboard_button.py +++ b/aiogram/types/inline_keyboard_button.py @@ -13,7 +13,7 @@ if TYPE_CHECKING: class InlineKeyboardButton(MutableTelegramObject): """ - This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. + This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. Source: https://core.telegram.org/bots/api#inlinekeyboardbutton """ @@ -23,21 +23,21 @@ class InlineKeyboardButton(MutableTelegramObject): url: Optional[str] = None """*Optional*. HTTP or tg:// URL to be opened when the button is pressed. Links :code:`tg://user?id=` can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.""" callback_data: Optional[str] = None - """*Optional*. Data to be sent in a `callback query `_ to the bot when button is pressed, 1-64 bytes""" + """*Optional*. Data to be sent in a `callback query `_ to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account.""" web_app: Optional[WebAppInfo] = None - """*Optional*. Description of the `Web App `_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot.""" + """*Optional*. Description of the `Web App `_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.""" login_url: Optional[LoginUrl] = None """*Optional*. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the `Telegram Login Widget `_.""" switch_inline_query: Optional[str] = None - """*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.""" + """*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account.""" switch_inline_query_current_chat: Optional[str] = None """*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""" + """*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.""" callback_game: Optional[CallbackGame] = None """*Optional*. Description of the game that will be launched when the user presses the button.""" pay: Optional[bool] = None - """*Optional*. Specify :code:`True`, to send a `Pay button `_.""" + """*Optional*. Specify :code:`True`, to send a `Pay button `_. Substrings '⭐' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/inline_query_result_cached_gif.py b/aiogram/types/inline_query_result_cached_gif.py index c9d6a76e..277454c9 100644 --- a/aiogram/types/inline_query_result_cached_gif.py +++ b/aiogram/types/inline_query_result_cached_gif.py @@ -37,6 +37,8 @@ class InlineQueryResultCachedGif(InlineQueryResult): """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" 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""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -64,6 +66,9 @@ class InlineQueryResultCachedGif(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -88,6 +93,7 @@ class InlineQueryResultCachedGif(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_cached_mpeg4_gif.py b/aiogram/types/inline_query_result_cached_mpeg4_gif.py index 7c35c813..ec043864 100644 --- a/aiogram/types/inline_query_result_cached_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_cached_mpeg4_gif.py @@ -37,6 +37,8 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" 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""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -64,6 +66,9 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -88,6 +93,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_cached_photo.py b/aiogram/types/inline_query_result_cached_photo.py index aa6b68bb..f40b203a 100644 --- a/aiogram/types/inline_query_result_cached_photo.py +++ b/aiogram/types/inline_query_result_cached_photo.py @@ -39,6 +39,8 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): """*Optional*. Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" 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""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -67,6 +69,9 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -92,6 +97,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_cached_video.py b/aiogram/types/inline_query_result_cached_video.py index ea6cb0d5..4095ab99 100644 --- a/aiogram/types/inline_query_result_cached_video.py +++ b/aiogram/types/inline_query_result_cached_video.py @@ -39,6 +39,8 @@ class InlineQueryResultCachedVideo(InlineQueryResult): """*Optional*. Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" 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""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -67,6 +69,9 @@ class InlineQueryResultCachedVideo(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -92,6 +97,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_gif.py b/aiogram/types/inline_query_result_gif.py index 8c2da639..3ad0eef8 100644 --- a/aiogram/types/inline_query_result_gif.py +++ b/aiogram/types/inline_query_result_gif.py @@ -48,6 +48,8 @@ class InlineQueryResultGif(InlineQueryResult): """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" 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""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -80,6 +82,9 @@ class InlineQueryResultGif(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -109,6 +114,7 @@ class InlineQueryResultGif(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_location.py b/aiogram/types/inline_query_result_location.py index 4e384e79..50b3ed8a 100644 --- a/aiogram/types/inline_query_result_location.py +++ b/aiogram/types/inline_query_result_location.py @@ -34,7 +34,7 @@ class InlineQueryResultLocation(InlineQueryResult): horizontal_accuracy: Optional[float] = None """*Optional*. The radius of uncertainty for the location, measured in meters; 0-1500""" live_period: Optional[int] = None - """*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400.""" + """*Optional*. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.""" heading: Optional[int] = None """*Optional*. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.""" proximity_alert_radius: Optional[int] = None diff --git a/aiogram/types/inline_query_result_mpeg4_gif.py b/aiogram/types/inline_query_result_mpeg4_gif.py index 35f5d17c..6ca282e1 100644 --- a/aiogram/types/inline_query_result_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_mpeg4_gif.py @@ -47,6 +47,8 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" 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""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -79,6 +81,9 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -108,6 +113,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_photo.py b/aiogram/types/inline_query_result_photo.py index b0b9fd03..02f68415 100644 --- a/aiogram/types/inline_query_result_photo.py +++ b/aiogram/types/inline_query_result_photo.py @@ -45,6 +45,8 @@ class InlineQueryResultPhoto(InlineQueryResult): """*Optional*. Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" 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""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -76,6 +78,9 @@ class InlineQueryResultPhoto(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -104,6 +109,7 @@ class InlineQueryResultPhoto(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_video.py b/aiogram/types/inline_query_result_video.py index d7fd7eed..52332fd7 100644 --- a/aiogram/types/inline_query_result_video.py +++ b/aiogram/types/inline_query_result_video.py @@ -43,6 +43,8 @@ class InlineQueryResultVideo(InlineQueryResult): """*Optional*. Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" 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""" video_width: Optional[int] = None """*Optional*. Video width""" video_height: Optional[int] = None @@ -80,6 +82,9 @@ class InlineQueryResultVideo(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), video_width: Optional[int] = None, video_height: Optional[int] = None, video_duration: Optional[int] = None, @@ -110,6 +115,7 @@ class InlineQueryResultVideo(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, video_width=video_width, video_height=video_height, video_duration=video_duration, diff --git a/aiogram/types/inline_query_result_voice.py b/aiogram/types/inline_query_result_voice.py index b5ec063c..a781fc69 100644 --- a/aiogram/types/inline_query_result_voice.py +++ b/aiogram/types/inline_query_result_voice.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: class InlineQueryResultVoice(InlineQueryResult): """ - Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the voice message. + Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the the voice message. Source: https://core.telegram.org/bots/api#inlinequeryresultvoice """ diff --git a/aiogram/types/input_invoice_message_content.py b/aiogram/types/input_invoice_message_content.py index af298dec..0dbb6d27 100644 --- a/aiogram/types/input_invoice_message_content.py +++ b/aiogram/types/input_invoice_message_content.py @@ -21,14 +21,14 @@ class InputInvoiceMessageContent(InputMessageContent): """Product description, 1-255 characters""" payload: str """Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.""" - provider_token: str - """Payment provider token, obtained via `@BotFather `_""" currency: str - """Three-letter ISO 4217 currency code, see `more on currencies `_""" + """Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.""" prices: List[LabeledPrice] - """Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)""" + """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""" + """*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 """*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 @@ -42,19 +42,19 @@ class InputInvoiceMessageContent(InputMessageContent): photo_height: Optional[int] = None """*Optional*. Photo height""" need_name: Optional[bool] = None - """*Optional*. Pass :code:`True` if you require the user's full name to complete the order""" + """*Optional*. Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.""" need_phone_number: Optional[bool] = None - """*Optional*. Pass :code:`True` if you require the user's phone number to complete the order""" + """*Optional*. Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.""" need_email: Optional[bool] = None - """*Optional*. Pass :code:`True` if you require the user's email address to complete the order""" + """*Optional*. Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.""" need_shipping_address: Optional[bool] = None - """*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order""" + """*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.""" send_phone_number_to_provider: Optional[bool] = None - """*Optional*. Pass :code:`True` if the user's phone number should be sent to provider""" + """*Optional*. Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" send_email_to_provider: Optional[bool] = None - """*Optional*. Pass :code:`True` if the user's email address should be sent to provider""" + """*Optional*. Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" is_flexible: Optional[bool] = None - """*Optional*. Pass :code:`True` if the final price depends on the shipping method""" + """*Optional*. Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -66,9 +66,9 @@ class InputInvoiceMessageContent(InputMessageContent): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, provider_data: Optional[str] = None, @@ -93,9 +93,9 @@ class InputInvoiceMessageContent(InputMessageContent): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, provider_data=provider_data, diff --git a/aiogram/types/input_location_message_content.py b/aiogram/types/input_location_message_content.py index ee4678a6..83400c13 100644 --- a/aiogram/types/input_location_message_content.py +++ b/aiogram/types/input_location_message_content.py @@ -19,7 +19,7 @@ class InputLocationMessageContent(InputMessageContent): horizontal_accuracy: Optional[float] = None """*Optional*. The radius of uncertainty for the location, measured in meters; 0-1500""" live_period: Optional[int] = None - """*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400.""" + """*Optional*. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.""" heading: Optional[int] = None """*Optional*. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.""" proximity_alert_radius: Optional[int] = None diff --git a/aiogram/types/input_media_animation.py b/aiogram/types/input_media_animation.py index 9dcf0a9e..a0251f23 100644 --- a/aiogram/types/input_media_animation.py +++ b/aiogram/types/input_media_animation.py @@ -30,6 +30,8 @@ class InputMediaAnimation(InputMedia): """*Optional*. Mode for parsing entities in the animation caption. See `formatting options `_ for more details.""" 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""" width: Optional[int] = None """*Optional*. Animation width""" height: Optional[int] = None @@ -52,6 +54,9 @@ class InputMediaAnimation(InputMedia): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), width: Optional[int] = None, height: Optional[int] = None, duration: Optional[int] = None, @@ -69,6 +74,7 @@ class InputMediaAnimation(InputMedia): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, width=width, height=height, duration=duration, diff --git a/aiogram/types/input_media_photo.py b/aiogram/types/input_media_photo.py index ecb3c91d..19daa261 100644 --- a/aiogram/types/input_media_photo.py +++ b/aiogram/types/input_media_photo.py @@ -28,6 +28,8 @@ class InputMediaPhoto(InputMedia): """*Optional*. Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" 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""" has_spoiler: Optional[bool] = None """*Optional*. Pass :code:`True` if the photo needs to be covered with a spoiler animation""" @@ -43,6 +45,9 @@ class InputMediaPhoto(InputMedia): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: @@ -56,6 +61,7 @@ class InputMediaPhoto(InputMedia): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, **__pydantic_kwargs, ) diff --git a/aiogram/types/input_media_video.py b/aiogram/types/input_media_video.py index b44f6a76..6f1e3263 100644 --- a/aiogram/types/input_media_video.py +++ b/aiogram/types/input_media_video.py @@ -30,6 +30,8 @@ class InputMediaVideo(InputMedia): """*Optional*. Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" 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""" width: Optional[int] = None """*Optional*. Video width""" height: Optional[int] = None @@ -54,6 +56,9 @@ class InputMediaVideo(InputMedia): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), width: Optional[int] = None, height: Optional[int] = None, duration: Optional[int] = None, @@ -72,6 +77,7 @@ class InputMediaVideo(InputMedia): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, width=width, height=height, duration=duration, diff --git a/aiogram/types/input_poll_option.py b/aiogram/types/input_poll_option.py new file mode 100644 index 00000000..8cfe29ad --- /dev/null +++ b/aiogram/types/input_poll_option.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional, Union + +from ..client.default import Default +from .base import TelegramObject + +if TYPE_CHECKING: + from .message_entity import MessageEntity + + +class InputPollOption(TelegramObject): + """ + This object contains information about one answer option in a poll to send. + + Source: https://core.telegram.org/bots/api#inputpolloption + """ + + text: str + """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 + """*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: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + text: str, + text_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), + text_entities: Optional[List[MessageEntity]] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + text=text, + text_parse_mode=text_parse_mode, + text_entities=text_entities, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/input_sticker.py b/aiogram/types/input_sticker.py index eebde128..85f66868 100644 --- a/aiogram/types/input_sticker.py +++ b/aiogram/types/input_sticker.py @@ -18,6 +18,8 @@ class InputSticker(TelegramObject): sticker: Union[InputFile, str] """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] """List of 1-20 emoji associated with the sticker""" mask_position: Optional[MaskPosition] = None @@ -33,6 +35,7 @@ class InputSticker(TelegramObject): __pydantic__self__, *, sticker: Union[InputFile, str], + format: str, emoji_list: List[str], mask_position: Optional[MaskPosition] = None, keywords: Optional[List[str]] = None, @@ -44,6 +47,7 @@ class InputSticker(TelegramObject): super().__init__( sticker=sticker, + format=format, emoji_list=emoji_list, mask_position=mask_position, keywords=keywords, diff --git a/aiogram/types/invoice.py b/aiogram/types/invoice.py index f451ead0..7c70f0ba 100644 --- a/aiogram/types/invoice.py +++ b/aiogram/types/invoice.py @@ -19,7 +19,7 @@ class Invoice(TelegramObject): start_parameter: str """Unique bot deep-linking parameter that can be used to generate this invoice""" currency: str - """Three-letter ISO 4217 `currency `_ code""" + """Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_""" total_amount: int """Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`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).""" diff --git a/aiogram/types/keyboard_button.py b/aiogram/types/keyboard_button.py index a0aa2bb2..0cf7d58d 100644 --- a/aiogram/types/keyboard_button.py +++ b/aiogram/types/keyboard_button.py @@ -16,7 +16,7 @@ if TYPE_CHECKING: class KeyboardButton(MutableTelegramObject): """ - This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_users*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive. + This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text. **Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*. Source: https://core.telegram.org/bots/api#keyboardbutton diff --git a/aiogram/types/keyboard_button_request_chat.py b/aiogram/types/keyboard_button_request_chat.py index 24caf635..018edcff 100644 --- a/aiogram/types/keyboard_button_request_chat.py +++ b/aiogram/types/keyboard_button_request_chat.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: class KeyboardButtonRequestChat(TelegramObject): """ - This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. `More about requesting chats » `_ + This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. `More about requesting chats » `_. Source: https://core.telegram.org/bots/api#keyboardbuttonrequestchat """ @@ -31,6 +31,12 @@ class KeyboardButtonRequestChat(TelegramObject): """*Optional*. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of *user_administrator_rights*. If not specified, no additional restrictions are applied.""" bot_is_member: Optional[bool] = None """*Optional*. Pass :code:`True` to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.""" + request_title: Optional[bool] = None + """*Optional*. Pass :code:`True` to request the chat's title""" + request_username: Optional[bool] = None + """*Optional*. Pass :code:`True` to request the chat's username""" + request_photo: Optional[bool] = None + """*Optional*. Pass :code:`True` to request the chat's photo""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -47,6 +53,9 @@ class KeyboardButtonRequestChat(TelegramObject): user_administrator_rights: Optional[ChatAdministratorRights] = None, bot_administrator_rights: Optional[ChatAdministratorRights] = None, bot_is_member: Optional[bool] = None, + request_title: Optional[bool] = None, + request_username: Optional[bool] = None, + request_photo: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -62,5 +71,8 @@ class KeyboardButtonRequestChat(TelegramObject): user_administrator_rights=user_administrator_rights, bot_administrator_rights=bot_administrator_rights, bot_is_member=bot_is_member, + request_title=request_title, + request_username=request_username, + request_photo=request_photo, **__pydantic_kwargs, ) diff --git a/aiogram/types/keyboard_button_request_users.py b/aiogram/types/keyboard_button_request_users.py index c005d153..631f04b4 100644 --- a/aiogram/types/keyboard_button_request_users.py +++ b/aiogram/types/keyboard_button_request_users.py @@ -5,7 +5,7 @@ from aiogram.types import TelegramObject class KeyboardButtonRequestUsers(TelegramObject): """ - This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_ + This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_ Source: https://core.telegram.org/bots/api#keyboardbuttonrequestusers """ @@ -18,6 +18,12 @@ class KeyboardButtonRequestUsers(TelegramObject): """*Optional*. Pass :code:`True` to request premium users, pass :code:`False` to request non-premium users. If not specified, no additional restrictions are applied.""" max_quantity: Optional[int] = None """*Optional*. The maximum number of users to be selected; 1-10. Defaults to 1.""" + request_name: Optional[bool] = None + """*Optional*. Pass :code:`True` to request the users' first and last names""" + request_username: Optional[bool] = None + """*Optional*. Pass :code:`True` to request the users' usernames""" + request_photo: Optional[bool] = None + """*Optional*. Pass :code:`True` to request the users' photos""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -30,6 +36,9 @@ class KeyboardButtonRequestUsers(TelegramObject): user_is_bot: Optional[bool] = None, user_is_premium: Optional[bool] = None, max_quantity: Optional[int] = None, + request_name: Optional[bool] = None, + request_username: Optional[bool] = None, + request_photo: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -41,5 +50,8 @@ class KeyboardButtonRequestUsers(TelegramObject): user_is_bot=user_is_bot, user_is_premium=user_is_premium, max_quantity=max_quantity, + request_name=request_name, + request_username=request_username, + request_photo=request_photo, **__pydantic_kwargs, ) diff --git a/aiogram/types/location.py b/aiogram/types/location.py index 853e57b6..50e55021 100644 --- a/aiogram/types/location.py +++ b/aiogram/types/location.py @@ -12,10 +12,10 @@ class Location(TelegramObject): Source: https://core.telegram.org/bots/api#location """ - longitude: float - """Longitude as defined by sender""" latitude: float """Latitude as defined by sender""" + longitude: float + """Longitude as defined by sender""" horizontal_accuracy: Optional[float] = None """*Optional*. The radius of uncertainty for the location, measured in meters; 0-1500""" live_period: Optional[int] = None @@ -32,8 +32,8 @@ class Location(TelegramObject): def __init__( __pydantic__self__, *, - longitude: float, latitude: float, + longitude: float, horizontal_accuracy: Optional[float] = None, live_period: Optional[int] = None, heading: Optional[int] = None, @@ -45,8 +45,8 @@ class Location(TelegramObject): # Is needed only for type checking and IDE support without any additional plugins super().__init__( - longitude=longitude, latitude=latitude, + longitude=longitude, horizontal_accuracy=horizontal_accuracy, live_period=live_period, heading=heading, diff --git a/aiogram/types/message.py b/aiogram/types/message.py index c5b7bdbe..2b4b34ef 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -14,6 +14,7 @@ from aiogram.utils.text_decorations import ( from ..client.default import Default from ..enums import ContentType from .custom import DateTime +from .input_poll_option import InputPollOption from .maybe_inaccessible_message import MaybeInaccessibleMessage if TYPE_CHECKING: @@ -51,6 +52,7 @@ if TYPE_CHECKING: from .animation import Animation from .audio import Audio from .chat import Chat + from .chat_background import ChatBackground from .chat_boost_added import ChatBoostAdded from .chat_shared import ChatShared from .contact import Contact @@ -136,6 +138,10 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field *from* contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.""" sender_boost_count: Optional[int] = None """*Optional*. If the sender of the message boosted the chat, the number of boosts added by the user""" + sender_business_bot: Optional[User] = None + """*Optional*. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.""" + business_connection_id: Optional[str] = None + """*Optional*. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.""" forward_origin: Optional[ Union[MessageOriginUser, MessageOriginHiddenUser, MessageOriginChat, MessageOriginChannel] ] = None @@ -158,6 +164,8 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Date the message was last edited in Unix time""" has_protected_content: Optional[bool] = None """*Optional*. :code:`True`, if the message can't be forwarded""" + is_from_offline: Optional[bool] = None + """*Optional*. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message""" media_group_id: Optional[str] = None """*Optional*. The unique identifier of a media message group this message belongs to""" author_signature: Optional[str] = None @@ -168,6 +176,8 @@ class Message(MaybeInaccessibleMessage): """*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""" + effect_id: Optional[str] = None + """*Optional*. Unique identifier of the message effect added to the message""" animation: Optional[Animation] = None """*Optional*. Message is an animation, information about the animation. For backward compatibility, when this field is set, the *document* field will also be set""" audio: Optional[Audio] = None @@ -190,6 +200,8 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Caption for the animation, audio, document, photo, video or voice""" 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""" has_media_spoiler: Optional[bool] = None """*Optional*. :code:`True`, if the message media is covered by a spoiler animation""" contact: Optional[Contact] = None @@ -246,6 +258,8 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.""" boost_added: Optional[ChatBoostAdded] = None """*Optional*. Service message: user boosted the chat""" + chat_background_set: Optional[ChatBackground] = None + """*Optional*. Service message: chat background set""" forum_topic_created: Optional[ForumTopicCreated] = None """*Optional*. Service message: forum topic created""" forum_topic_edited: Optional[ForumTopicEdited] = None @@ -328,6 +342,8 @@ class Message(MaybeInaccessibleMessage): from_user: Optional[User] = None, sender_chat: Optional[Chat] = None, sender_boost_count: Optional[int] = None, + sender_business_bot: Optional[User] = None, + business_connection_id: Optional[str] = None, forward_origin: Optional[ Union[ MessageOriginUser, @@ -345,11 +361,13 @@ class Message(MaybeInaccessibleMessage): via_bot: Optional[User] = None, edit_date: Optional[int] = None, has_protected_content: Optional[bool] = None, + is_from_offline: Optional[bool] = None, media_group_id: Optional[str] = None, author_signature: Optional[str] = None, text: Optional[str] = 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, @@ -361,6 +379,7 @@ class Message(MaybeInaccessibleMessage): voice: Optional[Voice] = None, caption: Optional[str] = None, caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[bool] = None, has_media_spoiler: Optional[bool] = None, contact: Optional[Contact] = None, dice: Optional[Dice] = None, @@ -389,6 +408,7 @@ class Message(MaybeInaccessibleMessage): passport_data: Optional[PassportData] = None, proximity_alert_triggered: Optional[ProximityAlertTriggered] = None, boost_added: Optional[ChatBoostAdded] = None, + chat_background_set: Optional[ChatBackground] = None, forum_topic_created: Optional[ForumTopicCreated] = None, forum_topic_edited: Optional[ForumTopicEdited] = None, forum_topic_closed: Optional[ForumTopicClosed] = None, @@ -426,6 +446,8 @@ class Message(MaybeInaccessibleMessage): from_user=from_user, sender_chat=sender_chat, sender_boost_count=sender_boost_count, + sender_business_bot=sender_business_bot, + business_connection_id=business_connection_id, forward_origin=forward_origin, is_topic_message=is_topic_message, is_automatic_forward=is_automatic_forward, @@ -436,11 +458,13 @@ class Message(MaybeInaccessibleMessage): via_bot=via_bot, edit_date=edit_date, has_protected_content=has_protected_content, + is_from_offline=is_from_offline, media_group_id=media_group_id, author_signature=author_signature, text=text, entities=entities, link_preview_options=link_preview_options, + effect_id=effect_id, animation=animation, audio=audio, document=document, @@ -452,6 +476,7 @@ class Message(MaybeInaccessibleMessage): voice=voice, caption=caption, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_media_spoiler=has_media_spoiler, contact=contact, dice=dice, @@ -480,6 +505,7 @@ class Message(MaybeInaccessibleMessage): passport_data=passport_data, proximity_alert_triggered=proximity_alert_triggered, boost_added=boost_added, + chat_background_set=chat_background_set, forum_topic_created=forum_topic_created, forum_topic_edited=forum_topic_edited, forum_topic_closed=forum_topic_closed, @@ -610,10 +636,10 @@ class Message(MaybeInaccessibleMessage): return ContentType.CHAT_SHARED if self.story: return ContentType.STORY - if self.has_media_spoiler: - return ContentType.HAS_MEDIA_SPOILER if self.write_access_allowed: return ContentType.WRITE_ACCESS_ALLOWED + if self.chat_background_set: + return ContentType.CHAT_BACKGROUND_SET if self.boost_added: return ContentType.BOOST_ADDED @@ -642,9 +668,13 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -658,6 +688,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. @@ -672,11 +703,13 @@ class Message(MaybeInaccessibleMessage): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` """ @@ -692,6 +725,7 @@ class Message(MaybeInaccessibleMessage): return SendAnimation( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, animation=animation, duration=duration, @@ -701,9 +735,11 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -720,9 +756,13 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -737,6 +777,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. @@ -750,11 +791,13 @@ class Message(MaybeInaccessibleMessage): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` @@ -771,6 +814,7 @@ class Message(MaybeInaccessibleMessage): return SendAnimation( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, animation=animation, duration=duration, width=width, @@ -779,9 +823,11 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -801,6 +847,7 @@ class Message(MaybeInaccessibleMessage): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -814,6 +861,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. @@ -831,8 +879,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` """ @@ -848,6 +897,7 @@ class Message(MaybeInaccessibleMessage): return SendAudio( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, audio=audio, caption=caption, @@ -859,6 +909,7 @@ class Message(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -877,6 +928,7 @@ class Message(MaybeInaccessibleMessage): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -891,6 +943,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice messages, use the :class:`aiogram.methods.send_voice.SendVoice` method instead. @@ -907,8 +960,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` @@ -925,6 +979,7 @@ class Message(MaybeInaccessibleMessage): return SendAudio( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, audio=audio, caption=caption, parse_mode=parse_mode, @@ -935,6 +990,7 @@ class Message(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -950,6 +1006,7 @@ class Message(MaybeInaccessibleMessage): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -963,6 +1020,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -975,8 +1033,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_contact.SendContact` """ @@ -992,6 +1051,7 @@ class Message(MaybeInaccessibleMessage): return SendContact( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, phone_number=phone_number, first_name=first_name, @@ -999,6 +1059,7 @@ class Message(MaybeInaccessibleMessage): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1013,6 +1074,7 @@ class Message(MaybeInaccessibleMessage): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1027,6 +1089,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1038,8 +1101,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_contact.SendContact` @@ -1056,12 +1120,14 @@ class Message(MaybeInaccessibleMessage): return SendContact( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, phone_number=phone_number, first_name=first_name, last_name=last_name, vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1079,6 +1145,7 @@ class Message(MaybeInaccessibleMessage): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1092,6 +1159,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send general files. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. @@ -1106,8 +1174,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_document.SendDocument` """ @@ -1123,6 +1192,7 @@ class Message(MaybeInaccessibleMessage): return SendDocument( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, document=document, thumbnail=thumbnail, @@ -1132,6 +1202,7 @@ class Message(MaybeInaccessibleMessage): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1148,6 +1219,7 @@ class Message(MaybeInaccessibleMessage): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1162,6 +1234,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send general files. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. @@ -1175,8 +1248,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_document.SendDocument` @@ -1193,6 +1267,7 @@ class Message(MaybeInaccessibleMessage): return SendDocument( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, document=document, thumbnail=thumbnail, caption=caption, @@ -1201,6 +1276,7 @@ class Message(MaybeInaccessibleMessage): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1213,6 +1289,7 @@ class Message(MaybeInaccessibleMessage): game_short_name: str, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1224,6 +1301,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1233,6 +1311,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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1250,10 +1329,12 @@ class Message(MaybeInaccessibleMessage): return SendGame( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, game_short_name=game_short_name, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1265,6 +1346,7 @@ class Message(MaybeInaccessibleMessage): game_short_name: str, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1277,6 +1359,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1285,6 +1368,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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1303,9 +1387,11 @@ class Message(MaybeInaccessibleMessage): return SendGame( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, game_short_name=game_short_name, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1318,9 +1404,9 @@ class Message(MaybeInaccessibleMessage): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, @@ -1338,6 +1424,7 @@ class Message(MaybeInaccessibleMessage): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1349,6 +1436,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send invoices. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1358,10 +1446,10 @@ class Message(MaybeInaccessibleMessage): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: 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*. :param start_parameter: 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 :param provider_data: 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. @@ -1369,15 +1457,16 @@ class Message(MaybeInaccessibleMessage): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1395,13 +1484,14 @@ class Message(MaybeInaccessibleMessage): return SendInvoice( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -1419,6 +1509,7 @@ class Message(MaybeInaccessibleMessage): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1430,9 +1521,9 @@ class Message(MaybeInaccessibleMessage): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, @@ -1450,6 +1541,7 @@ class Message(MaybeInaccessibleMessage): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1462,6 +1554,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send invoices. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1470,10 +1563,10 @@ class Message(MaybeInaccessibleMessage): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: 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*. :param start_parameter: 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 :param provider_data: 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. @@ -1481,15 +1574,16 @@ class Message(MaybeInaccessibleMessage): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :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 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. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1508,12 +1602,13 @@ class Message(MaybeInaccessibleMessage): return SendInvoice( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -1531,6 +1626,7 @@ class Message(MaybeInaccessibleMessage): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1548,6 +1644,7 @@ class Message(MaybeInaccessibleMessage): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1561,6 +1658,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send point on the map. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1570,13 +1668,14 @@ class Message(MaybeInaccessibleMessage): :param latitude: Latitude of the location :param longitude: Longitude of the location :param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500 - :param live_period: Period in seconds for which the location will be updated (see `Live Locations `_, should be between 60 and 86400. + :param live_period: Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. :param heading: For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. :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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_location.SendLocation` """ @@ -1592,6 +1691,7 @@ class Message(MaybeInaccessibleMessage): return SendLocation( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, latitude=latitude, longitude=longitude, @@ -1601,6 +1701,7 @@ class Message(MaybeInaccessibleMessage): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1617,6 +1718,7 @@ class Message(MaybeInaccessibleMessage): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1631,6 +1733,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send point on the map. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1639,13 +1742,14 @@ class Message(MaybeInaccessibleMessage): :param latitude: Latitude of the location :param longitude: Longitude of the location :param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500 - :param live_period: Period in seconds for which the location will be updated (see `Live Locations `_, should be between 60 and 86400. + :param live_period: Period in seconds during which the location will be updated (see `Live Locations `_, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. :param heading: For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_location.SendLocation` @@ -1662,6 +1766,7 @@ class Message(MaybeInaccessibleMessage): return SendLocation( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, latitude=latitude, longitude=longitude, horizontal_accuracy=horizontal_accuracy, @@ -1670,6 +1775,7 @@ class Message(MaybeInaccessibleMessage): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1682,6 +1788,7 @@ class Message(MaybeInaccessibleMessage): media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, @@ -1692,6 +1799,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` 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. @@ -1701,6 +1809,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 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 :return: instance of method :class:`aiogram.methods.send_media_group.SendMediaGroup` @@ -1717,10 +1826,12 @@ class Message(MaybeInaccessibleMessage): return SendMediaGroup( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, media=media, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, **kwargs, @@ -1731,6 +1842,7 @@ class Message(MaybeInaccessibleMessage): media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + 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, @@ -1742,6 +1854,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` 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. @@ -1750,6 +1863,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 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 :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -1767,9 +1881,11 @@ class Message(MaybeInaccessibleMessage): return SendMediaGroup( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, media=media, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -1786,6 +1902,7 @@ class Message(MaybeInaccessibleMessage): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1802,6 +1919,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1814,8 +1932,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param disable_web_page_preview: Disables link previews for links in this message :return: instance of method :class:`aiogram.methods.send_message.SendMessage` @@ -1832,6 +1951,7 @@ class Message(MaybeInaccessibleMessage): return SendMessage( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, text=text, parse_mode=parse_mode, @@ -1839,6 +1959,7 @@ class Message(MaybeInaccessibleMessage): link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1856,6 +1977,7 @@ class Message(MaybeInaccessibleMessage): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1873,6 +1995,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1884,8 +2007,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param disable_web_page_preview: Disables link previews for links in this message :param reply_to_message_id: If the message is a reply, ID of the original message @@ -1903,12 +2027,14 @@ class Message(MaybeInaccessibleMessage): return SendMessage( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, text=text, parse_mode=parse_mode, entities=entities, link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1923,9 +2049,13 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1939,6 +2069,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -1949,11 +2080,13 @@ class Message(MaybeInaccessibleMessage): :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` """ @@ -1969,14 +2102,17 @@ class Message(MaybeInaccessibleMessage): return SendPhoto( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, photo=photo, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1989,9 +2125,13 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2006,6 +2146,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -2015,11 +2156,13 @@ class Message(MaybeInaccessibleMessage): :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` @@ -2036,13 +2179,16 @@ class Message(MaybeInaccessibleMessage): return SendPhoto( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, photo=photo, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2053,7 +2199,9 @@ class Message(MaybeInaccessibleMessage): def reply_poll( self, question: str, - options: List[str], + options: List[Union[InputPollOption, str]], + question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), + question_entities: Optional[List[MessageEntity]] = None, is_anonymous: Optional[bool] = None, type: Optional[str] = None, allows_multiple_answers: Optional[bool] = None, @@ -2066,6 +2214,7 @@ class Message(MaybeInaccessibleMessage): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2079,6 +2228,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send a native poll. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -2086,21 +2236,24 @@ class Message(MaybeInaccessibleMessage): Source: https://core.telegram.org/bots/api#sendpoll :param question: Poll question, 1-300 characters - :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each + :param options: A JSON-serialized list of 2-10 answer options + :param question_parse_mode: Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed + :param question_entities: A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode* :param is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True` :param type: Poll type, 'quiz' or 'regular', defaults to 'regular' :param allows_multiple_answers: :code:`True`, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False` :param correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode :param explanation: 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 :param explanation_parse_mode: Mode for parsing entities in the explanation. See `formatting options `_ for more details. - :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode* + :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode* :param open_period: Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*. :param close_date: Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*. :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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` """ @@ -2116,9 +2269,12 @@ class Message(MaybeInaccessibleMessage): return SendPoll( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, question=question, options=options, + question_parse_mode=question_parse_mode, + question_entities=question_entities, is_anonymous=is_anonymous, type=type, allows_multiple_answers=allows_multiple_answers, @@ -2131,6 +2287,7 @@ class Message(MaybeInaccessibleMessage): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2140,7 +2297,9 @@ class Message(MaybeInaccessibleMessage): def answer_poll( self, question: str, - options: List[str], + options: List[Union[InputPollOption, str]], + question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), + question_entities: Optional[List[MessageEntity]] = None, is_anonymous: Optional[bool] = None, type: Optional[str] = None, allows_multiple_answers: Optional[bool] = None, @@ -2153,6 +2312,7 @@ class Message(MaybeInaccessibleMessage): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2167,27 +2327,31 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send a native poll. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendpoll :param question: Poll question, 1-300 characters - :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each + :param options: A JSON-serialized list of 2-10 answer options + :param question_parse_mode: Mode for parsing entities in the question. See `formatting options `_ for more details. Currently, only custom emoji entities are allowed + :param question_entities: A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode* :param is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True` :param type: Poll type, 'quiz' or 'regular', defaults to 'regular' :param allows_multiple_answers: :code:`True`, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False` :param correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode :param explanation: 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 :param explanation_parse_mode: Mode for parsing entities in the explanation. See `formatting options `_ for more details. - :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode* + :param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode* :param open_period: Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*. :param close_date: Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*. :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` @@ -2204,8 +2368,11 @@ class Message(MaybeInaccessibleMessage): return SendPoll( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, question=question, options=options, + question_parse_mode=question_parse_mode, + question_entities=question_entities, is_anonymous=is_anonymous, type=type, allows_multiple_answers=allows_multiple_answers, @@ -2218,6 +2385,7 @@ class Message(MaybeInaccessibleMessage): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2230,6 +2398,7 @@ class Message(MaybeInaccessibleMessage): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2243,6 +2412,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send an animated emoji that will display a random value. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -2252,8 +2422,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_dice.SendDice` """ @@ -2269,10 +2440,12 @@ class Message(MaybeInaccessibleMessage): return SendDice( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2284,6 +2457,7 @@ class Message(MaybeInaccessibleMessage): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2298,6 +2472,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send an animated emoji that will display a random value. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -2306,8 +2481,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_dice.SendDice` @@ -2324,9 +2500,11 @@ class Message(MaybeInaccessibleMessage): return SendDice( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2340,6 +2518,7 @@ class Message(MaybeInaccessibleMessage): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2353,18 +2532,20 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send static .WEBP, `animated `_ .TGS, or `video `_ .WEBM stickers. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendsticker - :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL. + :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL. :param 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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` """ @@ -2380,11 +2561,13 @@ class Message(MaybeInaccessibleMessage): return SendSticker( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, sticker=sticker, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2397,6 +2580,7 @@ class Message(MaybeInaccessibleMessage): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2411,17 +2595,19 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send static .WEBP, `animated `_ .TGS, or `video `_ .WEBM stickers. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendsticker - :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL. + :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video and animated stickers can't be sent via an HTTP URL. :param 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` @@ -2438,10 +2624,12 @@ class Message(MaybeInaccessibleMessage): return SendSticker( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, sticker=sticker, emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2461,6 +2649,7 @@ class Message(MaybeInaccessibleMessage): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2474,6 +2663,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send information about a venue. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -2490,8 +2680,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` """ @@ -2507,6 +2698,7 @@ class Message(MaybeInaccessibleMessage): return SendVenue( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, latitude=latitude, longitude=longitude, @@ -2518,6 +2710,7 @@ class Message(MaybeInaccessibleMessage): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2536,6 +2729,7 @@ class Message(MaybeInaccessibleMessage): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2550,6 +2744,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send information about a venue. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -2565,8 +2760,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` @@ -2583,6 +2779,7 @@ class Message(MaybeInaccessibleMessage): return SendVenue( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, latitude=latitude, longitude=longitude, title=title, @@ -2593,6 +2790,7 @@ class Message(MaybeInaccessibleMessage): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2610,10 +2808,14 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2627,6 +2829,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. @@ -2641,12 +2844,14 @@ class Message(MaybeInaccessibleMessage): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_video.SendVideo` """ @@ -2662,6 +2867,7 @@ class Message(MaybeInaccessibleMessage): return SendVideo( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, video=video, duration=duration, @@ -2671,10 +2877,12 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2691,10 +2899,14 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2709,6 +2921,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. @@ -2722,12 +2935,14 @@ class Message(MaybeInaccessibleMessage): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video.SendVideo` @@ -2744,6 +2959,7 @@ class Message(MaybeInaccessibleMessage): return SendVideo( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, video=video, duration=duration, width=width, @@ -2752,10 +2968,12 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2771,6 +2989,7 @@ class Message(MaybeInaccessibleMessage): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2784,6 +3003,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` As of `v.4.0 `_, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -2796,8 +3016,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` """ @@ -2813,6 +3034,7 @@ class Message(MaybeInaccessibleMessage): return SendVideoNote( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, video_note=video_note, duration=duration, @@ -2820,6 +3042,7 @@ class Message(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2834,6 +3057,7 @@ class Message(MaybeInaccessibleMessage): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2848,6 +3072,7 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` As of `v.4.0 `_, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent :class:`aiogram.types.message.Message` is returned. @@ -2859,8 +3084,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` @@ -2877,12 +3103,14 @@ class Message(MaybeInaccessibleMessage): return SendVideoNote( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, video_note=video_note, duration=duration, length=length, thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2899,6 +3127,7 @@ class Message(MaybeInaccessibleMessage): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2912,9 +3141,10 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - :code:`reply_to_message_id` - Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvoice @@ -2925,8 +3155,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` """ @@ -2942,6 +3173,7 @@ class Message(MaybeInaccessibleMessage): return SendVoice( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, reply_to_message_id=self.message_id, voice=voice, caption=caption, @@ -2950,6 +3182,7 @@ class Message(MaybeInaccessibleMessage): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2965,6 +3198,7 @@ class Message(MaybeInaccessibleMessage): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2979,8 +3213,9 @@ class Message(MaybeInaccessibleMessage): - :code:`chat_id` - :code:`message_thread_id` + - :code:`business_connection_id` - Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvoice @@ -2991,8 +3226,9 @@ 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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` @@ -3009,6 +3245,7 @@ class Message(MaybeInaccessibleMessage): return SendVoice( chat_id=self.chat.id, message_thread_id=self.message_thread_id if self.is_topic_message else None, + business_connection_id=self.business_connection_id, voice=voice, caption=caption, parse_mode=parse_mode, @@ -3016,6 +3253,7 @@ class Message(MaybeInaccessibleMessage): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3032,7 +3270,9 @@ class Message(MaybeInaccessibleMessage): reply_markup: Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, None] = None, allow_sending_without_reply: Optional[bool] = None, message_thread_id: Optional[int] = None, + business_connection_id: Optional[str] = None, parse_mode: Optional[str] = None, + message_effect_id: Optional[str] = None, ) -> Union[ ForwardMessage, SendAnimation, @@ -3068,7 +3308,9 @@ class Message(MaybeInaccessibleMessage): :param reply_markup: :param allow_sending_without_reply: :param message_thread_id: + :param business_connection_id: :param parse_mode: + :param message_effect_id: :return: """ from ..methods import ( @@ -3096,10 +3338,12 @@ class Message(MaybeInaccessibleMessage): "reply_to_message_id": reply_to_message_id, "reply_parameters": reply_parameters, "message_thread_id": message_thread_id, + "business_connection_id": business_connection_id, "allow_sending_without_reply": allow_sending_without_reply, # when sending a copy, we don't need any parse mode # because all entities are already prepared "parse_mode": parse_mode, + "message_effect_id": message_effect_id or self.effect_id, } if self.text: @@ -3188,7 +3432,15 @@ class Message(MaybeInaccessibleMessage): if self.poll: return SendPoll( question=self.poll.question, - options=[option.text for option in self.poll.options], + options=[ + InputPollOption( + text=option.text, + voter_count=option.voter_count, + text_entities=option.text_entities, + text_parse_mode=None, + ) + for option in self.poll.options + ], **kwargs, ).as_(self._bot) if self.dice: # Dice value can't be controlled @@ -3211,6 +3463,9 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), reply_parameters: Optional[ReplyParameters] = None, @@ -3237,10 +3492,11 @@ class Message(MaybeInaccessibleMessage): :param caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept :param parse_mode: Mode for parsing entities in the new caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode* + :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 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 reply keyboard or to force a reply from the user. + :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 :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.copy_message.CopyMessage` @@ -3262,6 +3518,7 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, protect_content=protect_content, reply_parameters=reply_parameters, @@ -3497,6 +3754,7 @@ class Message(MaybeInaccessibleMessage): latitude: float, longitude: float, inline_message_id: Optional[str] = None, + live_period: Optional[int] = None, horizontal_accuracy: Optional[float] = None, heading: Optional[int] = None, proximity_alert_radius: Optional[int] = None, @@ -3517,6 +3775,7 @@ class Message(MaybeInaccessibleMessage): :param latitude: Latitude of new location :param longitude: Longitude of new location :param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message + :param live_period: New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current *live_period* by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then *live_period* remains unchanged :param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500 :param heading: Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. :param proximity_alert_radius: The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. @@ -3538,6 +3797,7 @@ class Message(MaybeInaccessibleMessage): latitude=latitude, longitude=longitude, inline_message_id=inline_message_id, + live_period=live_period, horizontal_accuracy=horizontal_accuracy, heading=heading, proximity_alert_radius=proximity_alert_radius, @@ -3589,6 +3849,9 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any, ) -> EditMessageCaption: @@ -3607,6 +3870,7 @@ class Message(MaybeInaccessibleMessage): :param caption: New caption of the message, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the message caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param 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. :param reply_markup: A JSON-serialized object for an `inline keyboard `_. :return: instance of method :class:`aiogram.methods.edit_message_caption.EditMessageCaption` """ @@ -3626,6 +3890,7 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, **kwargs, ).as_(self._bot) @@ -3784,7 +4049,7 @@ class Message(MaybeInaccessibleMessage): Source: https://core.telegram.org/bots/api#setmessagereaction - :param reaction: New 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. + :param reaction: 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. :param is_big: Pass :code:`True` to set the reaction with a big animation :return: instance of method :class:`aiogram.methods.set_message_reaction.SetMessageReaction` """ diff --git a/aiogram/types/message_entity.py b/aiogram/types/message_entity.py index b1c08ffc..ee774b09 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), '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`), '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)""" offset: int """Offset in `UTF-16 code units `_ to the start of the entity""" length: int diff --git a/aiogram/types/passport_element_error_translation_file.py b/aiogram/types/passport_element_error_translation_file.py index a8a207c4..29689ca8 100644 --- a/aiogram/types/passport_element_error_translation_file.py +++ b/aiogram/types/passport_element_error_translation_file.py @@ -13,9 +13,9 @@ class PassportElementErrorTranslationFile(PassportElementError): Source: https://core.telegram.org/bots/api#passportelementerrortranslationfile """ - source: Literal[ + source: Literal[PassportElementErrorType.TRANSLATION_FILE] = ( PassportElementErrorType.TRANSLATION_FILE - ] = PassportElementErrorType.TRANSLATION_FILE + ) """Error source, must be *translation_file*""" 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'""" diff --git a/aiogram/types/passport_element_error_translation_files.py b/aiogram/types/passport_element_error_translation_files.py index 0d8ff504..65e9940e 100644 --- a/aiogram/types/passport_element_error_translation_files.py +++ b/aiogram/types/passport_element_error_translation_files.py @@ -13,9 +13,9 @@ class PassportElementErrorTranslationFiles(PassportElementError): Source: https://core.telegram.org/bots/api#passportelementerrortranslationfiles """ - source: Literal[ + source: Literal[PassportElementErrorType.TRANSLATION_FILES] = ( PassportElementErrorType.TRANSLATION_FILES - ] = PassportElementErrorType.TRANSLATION_FILES + ) """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'""" diff --git a/aiogram/types/poll.py b/aiogram/types/poll.py index ecf39f73..58052241 100644 --- a/aiogram/types/poll.py +++ b/aiogram/types/poll.py @@ -33,6 +33,8 @@ 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 + """*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 @@ -59,6 +61,7 @@ class Poll(TelegramObject): is_anonymous: bool, type: str, allows_multiple_answers: bool, + question_entities: Optional[List[MessageEntity]] = None, correct_option_id: Optional[int] = None, explanation: Optional[str] = None, explanation_entities: Optional[List[MessageEntity]] = None, @@ -79,6 +82,7 @@ class Poll(TelegramObject): is_anonymous=is_anonymous, type=type, allows_multiple_answers=allows_multiple_answers, + question_entities=question_entities, correct_option_id=correct_option_id, explanation=explanation, explanation_entities=explanation_entities, diff --git a/aiogram/types/poll_option.py b/aiogram/types/poll_option.py index f3059f01..f380934c 100644 --- a/aiogram/types/poll_option.py +++ b/aiogram/types/poll_option.py @@ -1,9 +1,12 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, List, Optional from .base import TelegramObject +if TYPE_CHECKING: + from .message_entity import MessageEntity + class PollOption(TelegramObject): """ @@ -16,16 +19,28 @@ 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 + """*Optional*. Special entities that appear in the option *text*. Currently, only custom emoji entities are allowed in poll option texts""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! # This section was auto-generated via `butcher` def __init__( - __pydantic__self__, *, text: str, voter_count: int, **__pydantic_kwargs: Any + __pydantic__self__, + *, + text: str, + voter_count: int, + text_entities: Optional[List[MessageEntity]] = None, + **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! # This method was auto-generated via `butcher` # Is needed only for type checking and IDE support without any additional plugins - super().__init__(text=text, voter_count=voter_count, **__pydantic_kwargs) + super().__init__( + text=text, + voter_count=voter_count, + text_entities=text_entities, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/pre_checkout_query.py b/aiogram/types/pre_checkout_query.py index 6c10650f..7733113f 100644 --- a/aiogram/types/pre_checkout_query.py +++ b/aiogram/types/pre_checkout_query.py @@ -24,7 +24,7 @@ class PreCheckoutQuery(TelegramObject): from_user: User = Field(..., alias="from") """User who sent the query""" currency: str - """Three-letter ISO 4217 `currency `_ code""" + """Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_""" total_amount: int """Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`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).""" invoice_payload: str diff --git a/aiogram/types/reply_keyboard_markup.py b/aiogram/types/reply_keyboard_markup.py index 057b123d..f3d6dabd 100644 --- a/aiogram/types/reply_keyboard_markup.py +++ b/aiogram/types/reply_keyboard_markup.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: class ReplyKeyboardMarkup(MutableTelegramObject): """ - This object represents a `custom keyboard `_ with reply options (see `Introduction to bots `_ for details and examples). + This object represents a `custom keyboard `_ with reply options (see `Introduction to bots `_ for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account. Source: https://core.telegram.org/bots/api#replykeyboardmarkup """ diff --git a/aiogram/types/reply_keyboard_remove.py b/aiogram/types/reply_keyboard_remove.py index 9733ecf9..9c135a10 100644 --- a/aiogram/types/reply_keyboard_remove.py +++ b/aiogram/types/reply_keyboard_remove.py @@ -7,7 +7,7 @@ from .base import MutableTelegramObject class ReplyKeyboardRemove(MutableTelegramObject): """ - Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`). + Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`). Not supported in channels and for messages sent on behalf of a Telegram Business account. Source: https://core.telegram.org/bots/api#replykeyboardremove """ diff --git a/aiogram/types/reply_parameters.py b/aiogram/types/reply_parameters.py index 6e4019de..5b03fdab 100644 --- a/aiogram/types/reply_parameters.py +++ b/aiogram/types/reply_parameters.py @@ -19,11 +19,11 @@ class ReplyParameters(TelegramObject): message_id: int """Identifier of the message that will be replied to in the current chat, or in the chat *chat_id* if it is specified""" chat_id: Optional[Union[int, str]] = None - """*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)""" + """*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`). Not supported for messages sent on behalf of a business account.""" allow_sending_without_reply: Optional[Union[bool, Default]] = Default( "allow_sending_without_reply" ) - """*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.""" + """*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found. Always :code:`False` for replies in another chat or forum topic. Always :code:`True` for messages sent on behalf of a business account.""" quote: Optional[str] = None """*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") diff --git a/aiogram/types/shared_user.py b/aiogram/types/shared_user.py new file mode 100644 index 00000000..e160b894 --- /dev/null +++ b/aiogram/types/shared_user.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .photo_size import PhotoSize + + +class SharedUser(TelegramObject): + """ + This object contains information about a user that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_users.KeyboardButtonRequestUsers` button. + + Source: https://core.telegram.org/bots/api#shareduser + """ + + user_id: int + """Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.""" + first_name: Optional[str] = None + """*Optional*. First name of the user, if the name was requested by the bot""" + last_name: Optional[str] = None + """*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 + """*Optional*. Available sizes of the chat photo, if the photo was requested by the bot""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + user_id: int, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + username: Optional[str] = None, + photo: Optional[List[PhotoSize]] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + user_id=user_id, + first_name=first_name, + last_name=last_name, + username=username, + photo=photo, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/sticker_set.py b/aiogram/types/sticker_set.py index 81747747..29f9962f 100644 --- a/aiogram/types/sticker_set.py +++ b/aiogram/types/sticker_set.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional +from pydantic import Field + from .base import TelegramObject if TYPE_CHECKING: @@ -22,14 +24,20 @@ class StickerSet(TelegramObject): """Sticker set title""" sticker_type: str """Type of stickers in the set, currently one of 'regular', 'mask', 'custom_emoji'""" - is_animated: bool - """:code:`True`, if the sticker set contains `animated stickers `_""" - is_video: bool - """:code:`True`, if the sticker set contains `video stickers `_""" stickers: List[Sticker] """List of all set stickers""" thumbnail: Optional[PhotoSize] = None """*Optional*. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format""" + is_animated: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """:code:`True`, if the sticker set contains `animated stickers `_ + +.. deprecated:: API:7.2 + https://core.telegram.org/bots/api-changelog#march-31-2024""" + is_video: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """:code:`True`, if the sticker set contains `video stickers `_ + +.. deprecated:: API:7.2 + https://core.telegram.org/bots/api-changelog#march-31-2024""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -41,10 +49,10 @@ class StickerSet(TelegramObject): name: str, title: str, sticker_type: str, - is_animated: bool, - is_video: bool, stickers: List[Sticker], thumbnail: Optional[PhotoSize] = None, + is_animated: Optional[bool] = None, + is_video: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -55,9 +63,9 @@ class StickerSet(TelegramObject): name=name, title=title, sticker_type=sticker_type, - is_animated=is_animated, - is_video=is_video, stickers=stickers, thumbnail=thumbnail, + is_animated=is_animated, + is_video=is_video, **__pydantic_kwargs, ) diff --git a/aiogram/types/successful_payment.py b/aiogram/types/successful_payment.py index 97dcefe5..c6543cec 100644 --- a/aiogram/types/successful_payment.py +++ b/aiogram/types/successful_payment.py @@ -16,7 +16,7 @@ class SuccessfulPayment(TelegramObject): """ currency: str - """Three-letter ISO 4217 `currency `_ code""" + """Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_""" total_amount: int """Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`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).""" invoice_payload: str diff --git a/aiogram/types/update.py b/aiogram/types/update.py index d7686593..0533996d 100644 --- a/aiogram/types/update.py +++ b/aiogram/types/update.py @@ -6,6 +6,8 @@ from ..utils.mypy_hacks import lru_cache from .base import TelegramObject if TYPE_CHECKING: + from .business_connection import BusinessConnection + from .business_messages_deleted import BusinessMessagesDeleted from .callback_query import CallbackQuery from .chat_boost_removed import ChatBoostRemoved from .chat_boost_updated import ChatBoostUpdated @@ -41,6 +43,14 @@ class Update(TelegramObject): """*Optional*. New incoming channel post of any kind - text, photo, sticker, etc.""" edited_channel_post: Optional[Message] = None """*Optional*. New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.""" + business_connection: Optional[BusinessConnection] = None + """*Optional*. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot""" + business_message: Optional[Message] = None + """*Optional*. New message from a connected business account""" + edited_business_message: Optional[Message] = None + """*Optional*. New version of a message from a connected business account""" + deleted_business_messages: Optional[BusinessMessagesDeleted] = None + """*Optional*. Messages were deleted from a connected business account""" message_reaction: Optional[MessageReactionUpdated] = None """*Optional*. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify :code:`"message_reaction"` in the list of *allowed_updates* to receive these updates. The update isn't received for reactions set by bots.""" message_reaction_count: Optional[MessageReactionCountUpdated] = None @@ -82,6 +92,10 @@ class Update(TelegramObject): edited_message: Optional[Message] = None, channel_post: Optional[Message] = None, edited_channel_post: Optional[Message] = None, + business_connection: Optional[BusinessConnection] = None, + business_message: Optional[Message] = None, + edited_business_message: Optional[Message] = None, + deleted_business_messages: Optional[BusinessMessagesDeleted] = None, message_reaction: Optional[MessageReactionUpdated] = None, message_reaction_count: Optional[MessageReactionCountUpdated] = None, inline_query: Optional[InlineQuery] = None, @@ -108,6 +122,10 @@ class Update(TelegramObject): edited_message=edited_message, channel_post=channel_post, edited_channel_post=edited_channel_post, + business_connection=business_connection, + business_message=business_message, + edited_business_message=edited_business_message, + deleted_business_messages=deleted_business_messages, message_reaction=message_reaction, message_reaction_count=message_reaction_count, inline_query=inline_query, @@ -173,6 +191,14 @@ class Update(TelegramObject): return "chat_boost" if self.removed_chat_boost: return "removed_chat_boost" + if self.deleted_business_messages: + return "deleted_business_messages" + if self.business_connection: + return "business_connection" + if self.edited_business_message: + return "edited_business_message" + if self.business_message: + return "business_message" raise UpdateTypeLookupError("Update does not contain any known event type.") diff --git a/aiogram/types/user.py b/aiogram/types/user.py index 571447cd..7236effc 100644 --- a/aiogram/types/user.py +++ b/aiogram/types/user.py @@ -39,6 +39,8 @@ class User(TelegramObject): """*Optional*. :code:`True`, if `privacy mode `_ is disabled for the bot. Returned only in :class:`aiogram.methods.get_me.GetMe`.""" supports_inline_queries: Optional[bool] = None """*Optional*. :code:`True`, if the bot supports inline queries. Returned only in :class:`aiogram.methods.get_me.GetMe`.""" + can_connect_to_business: Optional[bool] = None + """*Optional*. :code:`True`, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in :class:`aiogram.methods.get_me.GetMe`.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -58,6 +60,7 @@ class User(TelegramObject): can_join_groups: Optional[bool] = None, can_read_all_group_messages: Optional[bool] = None, supports_inline_queries: Optional[bool] = None, + can_connect_to_business: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -76,6 +79,7 @@ class User(TelegramObject): can_join_groups=can_join_groups, can_read_all_group_messages=can_read_all_group_messages, supports_inline_queries=supports_inline_queries, + can_connect_to_business=can_connect_to_business, **__pydantic_kwargs, ) diff --git a/aiogram/types/users_shared.py b/aiogram/types/users_shared.py index b175aaf7..351fc0e2 100644 --- a/aiogram/types/users_shared.py +++ b/aiogram/types/users_shared.py @@ -1,6 +1,13 @@ -from typing import TYPE_CHECKING, Any, List +from __future__ import annotations -from aiogram.types import TelegramObject +from typing import TYPE_CHECKING, Any, List, Optional + +from pydantic import Field + +from .base import TelegramObject + +if TYPE_CHECKING: + from .shared_user import SharedUser class UsersShared(TelegramObject): @@ -12,18 +19,30 @@ class UsersShared(TelegramObject): request_id: int """Identifier of the request""" - user_ids: List[int] - """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.""" + users: List[SharedUser] + """Information about users shared with the bot.""" + 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 + https://core.telegram.org/bots/api-changelog#march-31-2024""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! # This section was auto-generated via `butcher` def __init__( - __pydantic__self__, *, request_id: int, user_ids: List[int], **__pydantic_kwargs: Any + __pydantic__self__, + *, + request_id: int, + users: List[SharedUser], + user_ids: Optional[List[int]] = None, + **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! # This method was auto-generated via `butcher` # Is needed only for type checking and IDE support without any additional plugins - super().__init__(request_id=request_id, user_ids=user_ids, **__pydantic_kwargs) + super().__init__( + request_id=request_id, users=users, user_ids=user_ids, **__pydantic_kwargs + ) diff --git a/aiogram/utils/formatting.py b/aiogram/utils/formatting.py index 9aa3466e..145eadcf 100644 --- a/aiogram/utils/formatting.py +++ b/aiogram/utils/formatting.py @@ -442,6 +442,17 @@ class BlockQuote(Text): type = MessageEntityType.BLOCKQUOTE +class ExpandableBlockQuote(Text): + """ + Expandable block quote element. + + Will be wrapped into :obj:`aiogram.types.message_entity.MessageEntity` + with type :obj:`aiogram.enums.message_entity_type.MessageEntityType.EXPANDABLE_BLOCKQUOTE` + """ + + type = MessageEntityType.EXPANDABLE_BLOCKQUOTE + + NODE_TYPES: Dict[Optional[str], Type[Text]] = { Text.type: Text, HashTag.type: HashTag, @@ -461,6 +472,7 @@ NODE_TYPES: Dict[Optional[str], Type[Text]] = { TextMention.type: TextMention, CustomEmoji.type: CustomEmoji, BlockQuote.type: BlockQuote, + ExpandableBlockQuote.type: ExpandableBlockQuote, } diff --git a/aiogram/utils/keyboard.py b/aiogram/utils/keyboard.py index ef9b2f52..921c28c1 100644 --- a/aiogram/utils/keyboard.py +++ b/aiogram/utils/keyboard.py @@ -397,8 +397,7 @@ class ReplyKeyboardBuilder(KeyboardBuilder[KeyboardButton]): if TYPE_CHECKING: - def as_markup(self, **kwargs: Any) -> ReplyKeyboardMarkup: - ... + def as_markup(self, **kwargs: Any) -> ReplyKeyboardMarkup: ... def __init__(self, markup: Optional[List[List[KeyboardButton]]] = None) -> None: super().__init__(button_type=KeyboardButton, markup=markup) diff --git a/aiogram/utils/media_group.py b/aiogram/utils/media_group.py index e4277d2f..ff985258 100644 --- a/aiogram/utils/media_group.py +++ b/aiogram/utils/media_group.py @@ -359,8 +359,10 @@ class MediaGroupBuilder: update_first_media["parse_mode"] = None return [ - media.model_copy(update=update_first_media) - if index == 0 and self.caption is not None - else media + ( + media.model_copy(update=update_first_media) + if index == 0 and self.caption is not None + else media + ) for index, media in enumerate(self._media) ] diff --git a/aiogram/utils/payload.py b/aiogram/utils/payload.py index f070dd4e..dbdba653 100644 --- a/aiogram/utils/payload.py +++ b/aiogram/utils/payload.py @@ -60,6 +60,7 @@ Encoding and decoding with your own methods: # result: decoded == "foo" """ + from base64 import urlsafe_b64decode, urlsafe_b64encode from typing import Callable, Optional diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index 58d6c0f4..440fffa6 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -57,6 +57,7 @@ class TextDecoration(ABC): MessageEntityType.STRIKETHROUGH, MessageEntityType.SPOILER, MessageEntityType.BLOCKQUOTE, + MessageEntityType.EXPANDABLE_BLOCKQUOTE, }: return cast(str, getattr(self, entity.type)(value=text)) if entity.type == MessageEntityType.PRE: @@ -172,6 +173,10 @@ class TextDecoration(ABC): def blockquote(self, value: str) -> str: pass + @abstractmethod + def expandable_blockquote(self, value: str) -> str: + pass + class HtmlDecoration(TextDecoration): BOLD_TAG = "b" @@ -218,6 +223,9 @@ class HtmlDecoration(TextDecoration): def blockquote(self, value: str) -> str: return f"<{self.BLOCKQUOTE_TAG}>{value}" + def expandable_blockquote(self, value: str) -> str: + return f"<{self.BLOCKQUOTE_TAG} expandable>{value}" + class MarkdownDecoration(TextDecoration): MARKDOWN_QUOTE_PATTERN: Pattern[str] = re.compile(r"([_*\[\]()~`>#+\-=|{}.!\\])") @@ -253,11 +261,14 @@ class MarkdownDecoration(TextDecoration): return re.sub(pattern=self.MARKDOWN_QUOTE_PATTERN, repl=r"\\\1", string=value) def custom_emoji(self, value: str, custom_emoji_id: str) -> str: - return self.link(value=value, link=f"tg://emoji?id={custom_emoji_id}") + return f'!{self.link(value=value, link=f"tg://emoji?id={custom_emoji_id}")}' def blockquote(self, value: str) -> str: return "\n".join(f">{line}" for line in value.splitlines()) + def expandable_blockquote(self, value: str) -> str: + return "\n".join(f">{line}" for line in value.splitlines()) + "||" + html_decoration = HtmlDecoration() markdown_decoration = MarkdownDecoration() diff --git a/docs/api/defaults.rst b/docs/api/defaults.rst new file mode 100644 index 00000000..93f3a59b --- /dev/null +++ b/docs/api/defaults.rst @@ -0,0 +1,81 @@ +=============== +Global defaults +=============== + +aiogram provides mechanism to set some global defaults for all requests to Telegram Bot API +in your application using :class:`aiogram.client.default.DefaultBotProperties` class. + +There are some properties that can be set: + +.. autoclass:: aiogram.client.default.DefaultBotProperties + :members: + :member-order: bysource + :undoc-members: True + +.. note:: + + If you need to override default properties for some requests, you should use `aiogram.client.default.DefaultBotProperties` + only for properties that you want to set as defaults and pass explicit values for other properties. + +.. danger:: + + If you upgrading from aiogram 3.0-3.6 to 3.7, + you should update your code to use `aiogram.client.default.DefaultBotProperties`. + +Example +======= + +Here is an example of setting default parse mode for all requests to Telegram Bot API: + +.. code-block:: python + + bot = Bot( + token=..., + defaults=DefaultBotProperties( + parse_mode=ParseMode.HTML, + ) + ) + +In this case all messages sent by this bot will be parsed as HTML, so you don't need to specify `parse_mode` +in every message you send. + +Instead of + +.. code-block:: python + + await bot.send_message(chat_id, text, parse_mode=ParseMode.HTML) + +you can use + +.. code-block:: python + + await bot.send_message(chat_id, text) + +and the message will be sent with HTML parse mode. + +In some cases you may want to override default properties for some requests. You can do it by passing +explicit values to the method: + +.. code-block:: python + + await bot.send_message(chat_id, text, parse_mode=ParseMode.MARKDOWN_V2) + +In this case the message will be sent with Markdown parse mode instead of default HTML. + +Another example of overriding default properties: + +.. code-block:: python + + await bot.send_message(chat_id, text, parse_mode=None) + +In this case the message will be send withoout parse mode, even if default parse mode is set it may be useful +if you want to send message with plain text or :ref:`aiogram.types.message_entity.MessageEntity`. + +.. code-block:: python + + await bot.send_message( + chat_id=chat_id, + text=text, + entities=[MessageEntity(type='bold', offset=0, length=4)], + parse_mode=None + ) diff --git a/docs/api/index.rst b/docs/api/index.rst index d323ecf0..89a35839 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -14,3 +14,4 @@ All methods and types is fully autogenerated from Telegram Bot API docs by parse enums/index download_file upload_file + defaults diff --git a/docs/api/methods/get_business_connection.rst b/docs/api/methods/get_business_connection.rst new file mode 100644 index 00000000..f6bc58e9 --- /dev/null +++ b/docs/api/methods/get_business_connection.rst @@ -0,0 +1,38 @@ +##################### +getBusinessConnection +##################### + +Returns: :obj:`BusinessConnection` + +.. automodule:: aiogram.methods.get_business_connection + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: BusinessConnection = await bot.get_business_connection(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.get_business_connection import GetBusinessConnection` +- alias: :code:`from aiogram.methods import GetBusinessConnection` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: BusinessConnection = await bot(GetBusinessConnection(...)) diff --git a/docs/api/methods/get_chat.rst b/docs/api/methods/get_chat.rst index c0c95236..d5fbc489 100644 --- a/docs/api/methods/get_chat.rst +++ b/docs/api/methods/get_chat.rst @@ -2,7 +2,7 @@ getChat ####### -Returns: :obj:`Chat` +Returns: :obj:`ChatFullInfo` .. automodule:: aiogram.methods.get_chat :members: @@ -19,7 +19,7 @@ As bot method .. code-block:: - result: Chat = await bot.get_chat(...) + result: ChatFullInfo = await bot.get_chat(...) Method as object @@ -35,4 +35,4 @@ With specific bot .. code-block:: python - result: Chat = await bot(GetChat(...)) + result: ChatFullInfo = await bot(GetChat(...)) diff --git a/docs/api/methods/index.rst b/docs/api/methods/index.rst index 1258e783..2325a0c6 100644 --- a/docs/api/methods/index.rst +++ b/docs/api/methods/index.rst @@ -17,6 +17,7 @@ Stickers delete_sticker_set get_custom_emoji_stickers get_sticker_set + replace_sticker_in_set send_sticker set_custom_emoji_sticker_set_thumbnail set_sticker_emoji_list @@ -55,6 +56,7 @@ Available methods export_chat_invite_link forward_message forward_messages + get_business_connection get_chat get_chat_administrators get_chat_member @@ -159,6 +161,7 @@ Payments answer_pre_checkout_query answer_shipping_query create_invoice_link + refund_star_payment send_invoice Getting updates diff --git a/docs/api/methods/refund_star_payment.rst b/docs/api/methods/refund_star_payment.rst new file mode 100644 index 00000000..1248d500 --- /dev/null +++ b/docs/api/methods/refund_star_payment.rst @@ -0,0 +1,45 @@ +################# +refundStarPayment +################# + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.refund_star_payment + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.refund_star_payment(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.refund_star_payment import RefundStarPayment` +- alias: :code:`from aiogram.methods import RefundStarPayment` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(RefundStarPayment(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return RefundStarPayment(...) diff --git a/docs/api/methods/replace_sticker_in_set.rst b/docs/api/methods/replace_sticker_in_set.rst new file mode 100644 index 00000000..ae050abf --- /dev/null +++ b/docs/api/methods/replace_sticker_in_set.rst @@ -0,0 +1,45 @@ +################### +replaceStickerInSet +################### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.replace_sticker_in_set + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.replace_sticker_in_set(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.replace_sticker_in_set import ReplaceStickerInSet` +- alias: :code:`from aiogram.methods import ReplaceStickerInSet` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(ReplaceStickerInSet(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return ReplaceStickerInSet(...) diff --git a/docs/api/types/background_fill.rst b/docs/api/types/background_fill.rst new file mode 100644 index 00000000..d9431b7c --- /dev/null +++ b/docs/api/types/background_fill.rst @@ -0,0 +1,10 @@ +############## +BackgroundFill +############## + + +.. automodule:: aiogram.types.background_fill + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/background_fill_freeform_gradient.rst b/docs/api/types/background_fill_freeform_gradient.rst new file mode 100644 index 00000000..5b051686 --- /dev/null +++ b/docs/api/types/background_fill_freeform_gradient.rst @@ -0,0 +1,10 @@ +############################## +BackgroundFillFreeformGradient +############################## + + +.. automodule:: aiogram.types.background_fill_freeform_gradient + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/background_fill_gradient.rst b/docs/api/types/background_fill_gradient.rst new file mode 100644 index 00000000..6e87e7f9 --- /dev/null +++ b/docs/api/types/background_fill_gradient.rst @@ -0,0 +1,10 @@ +###################### +BackgroundFillGradient +###################### + + +.. automodule:: aiogram.types.background_fill_gradient + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/background_fill_solid.rst b/docs/api/types/background_fill_solid.rst new file mode 100644 index 00000000..9fdafa26 --- /dev/null +++ b/docs/api/types/background_fill_solid.rst @@ -0,0 +1,10 @@ +################### +BackgroundFillSolid +################### + + +.. automodule:: aiogram.types.background_fill_solid + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/background_type.rst b/docs/api/types/background_type.rst new file mode 100644 index 00000000..f4e457d5 --- /dev/null +++ b/docs/api/types/background_type.rst @@ -0,0 +1,10 @@ +############## +BackgroundType +############## + + +.. automodule:: aiogram.types.background_type + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/background_type_chat_theme.rst b/docs/api/types/background_type_chat_theme.rst new file mode 100644 index 00000000..cd13f8c1 --- /dev/null +++ b/docs/api/types/background_type_chat_theme.rst @@ -0,0 +1,10 @@ +####################### +BackgroundTypeChatTheme +####################### + + +.. automodule:: aiogram.types.background_type_chat_theme + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/background_type_fill.rst b/docs/api/types/background_type_fill.rst new file mode 100644 index 00000000..d79cc474 --- /dev/null +++ b/docs/api/types/background_type_fill.rst @@ -0,0 +1,10 @@ +################## +BackgroundTypeFill +################## + + +.. automodule:: aiogram.types.background_type_fill + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/background_type_pattern.rst b/docs/api/types/background_type_pattern.rst new file mode 100644 index 00000000..e1c69401 --- /dev/null +++ b/docs/api/types/background_type_pattern.rst @@ -0,0 +1,10 @@ +##################### +BackgroundTypePattern +##################### + + +.. automodule:: aiogram.types.background_type_pattern + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/background_type_wallpaper.rst b/docs/api/types/background_type_wallpaper.rst new file mode 100644 index 00000000..49a043ba --- /dev/null +++ b/docs/api/types/background_type_wallpaper.rst @@ -0,0 +1,10 @@ +####################### +BackgroundTypeWallpaper +####################### + + +.. automodule:: aiogram.types.background_type_wallpaper + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/birthdate.rst b/docs/api/types/birthdate.rst new file mode 100644 index 00000000..0039c686 --- /dev/null +++ b/docs/api/types/birthdate.rst @@ -0,0 +1,10 @@ +######### +Birthdate +######### + + +.. automodule:: aiogram.types.birthdate + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/business_connection.rst b/docs/api/types/business_connection.rst new file mode 100644 index 00000000..1a196bc3 --- /dev/null +++ b/docs/api/types/business_connection.rst @@ -0,0 +1,10 @@ +################## +BusinessConnection +################## + + +.. automodule:: aiogram.types.business_connection + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/business_intro.rst b/docs/api/types/business_intro.rst new file mode 100644 index 00000000..31939bb7 --- /dev/null +++ b/docs/api/types/business_intro.rst @@ -0,0 +1,10 @@ +############# +BusinessIntro +############# + + +.. automodule:: aiogram.types.business_intro + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/business_location.rst b/docs/api/types/business_location.rst new file mode 100644 index 00000000..751dcbf1 --- /dev/null +++ b/docs/api/types/business_location.rst @@ -0,0 +1,10 @@ +################ +BusinessLocation +################ + + +.. automodule:: aiogram.types.business_location + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/business_messages_deleted.rst b/docs/api/types/business_messages_deleted.rst new file mode 100644 index 00000000..7854d96e --- /dev/null +++ b/docs/api/types/business_messages_deleted.rst @@ -0,0 +1,10 @@ +####################### +BusinessMessagesDeleted +####################### + + +.. automodule:: aiogram.types.business_messages_deleted + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/business_opening_hours.rst b/docs/api/types/business_opening_hours.rst new file mode 100644 index 00000000..c3b2e770 --- /dev/null +++ b/docs/api/types/business_opening_hours.rst @@ -0,0 +1,10 @@ +#################### +BusinessOpeningHours +#################### + + +.. automodule:: aiogram.types.business_opening_hours + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/business_opening_hours_interval.rst b/docs/api/types/business_opening_hours_interval.rst new file mode 100644 index 00000000..561efe7c --- /dev/null +++ b/docs/api/types/business_opening_hours_interval.rst @@ -0,0 +1,10 @@ +############################ +BusinessOpeningHoursInterval +############################ + + +.. automodule:: aiogram.types.business_opening_hours_interval + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_background.rst b/docs/api/types/chat_background.rst new file mode 100644 index 00000000..9d55f7d0 --- /dev/null +++ b/docs/api/types/chat_background.rst @@ -0,0 +1,10 @@ +############## +ChatBackground +############## + + +.. automodule:: aiogram.types.chat_background + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_full_info.rst b/docs/api/types/chat_full_info.rst new file mode 100644 index 00000000..702c64da --- /dev/null +++ b/docs/api/types/chat_full_info.rst @@ -0,0 +1,10 @@ +############ +ChatFullInfo +############ + + +.. automodule:: aiogram.types.chat_full_info + :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 62bae4b3..db2d9119 100644 --- a/docs/api/types/index.rst +++ b/docs/api/types/index.rst @@ -13,6 +13,16 @@ Available types animation audio + background_fill + background_fill_freeform_gradient + background_fill_gradient + background_fill_solid + background_type + background_type_chat_theme + background_type_fill + background_type_pattern + background_type_wallpaper + birthdate bot_command bot_command_scope bot_command_scope_all_chat_administrators @@ -25,9 +35,16 @@ Available types bot_description bot_name bot_short_description + business_connection + business_intro + business_location + business_messages_deleted + business_opening_hours + business_opening_hours_interval callback_query chat chat_administrator_rights + chat_background chat_boost chat_boost_added chat_boost_removed @@ -36,6 +53,7 @@ Available types chat_boost_source_giveaway chat_boost_source_premium chat_boost_updated + chat_full_info chat_invite_link chat_join_request chat_location @@ -77,6 +95,7 @@ Available types input_media_document input_media_photo input_media_video + input_poll_option keyboard_button keyboard_button_poll_type keyboard_button_request_chat @@ -114,6 +133,7 @@ Available types reply_keyboard_remove reply_parameters response_parameters + shared_user story switch_inline_query_chosen_chat text_quote diff --git a/docs/api/types/input_poll_option.rst b/docs/api/types/input_poll_option.rst new file mode 100644 index 00000000..66b7f11b --- /dev/null +++ b/docs/api/types/input_poll_option.rst @@ -0,0 +1,10 @@ +############### +InputPollOption +############### + + +.. automodule:: aiogram.types.input_poll_option + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/shared_user.rst b/docs/api/types/shared_user.rst new file mode 100644 index 00000000..2fd3f46f --- /dev/null +++ b/docs/api/types/shared_user.rst @@ -0,0 +1,10 @@ +########## +SharedUser +########## + + +.. automodule:: aiogram.types.shared_user + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/upload_file.rst b/docs/api/upload_file.rst index 715474f7..24fa726f 100644 --- a/docs/api/upload_file.rst +++ b/docs/api/upload_file.rst @@ -20,12 +20,10 @@ Here are the three different available builtin types of input file: .. warning:: - **Be respectful with Telegram** + **Be respectful to Telegram** Instances of `InputFile` are reusable. - That's mean you can create instance of InputFile and sent this file multiple times but Telegram - does not recommend to do that and when you upload file once just save their `file_id` - and use it in next times. + That means you can create an instance of InputFile and send it multiple times. However, Telegram does not recommend doing this. Instead, once you upload a file, save its `file_id` and reuse that later. Upload from file system ======================= diff --git a/docs/contributing.rst b/docs/contributing.rst index a4a3b8e0..c68480b0 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -78,13 +78,13 @@ Linux / macOS: .. code-block:: bash - pip install -e ."[dev,test,docs,fast,redis,proxy,i18n]" + pip install -e ."[dev,test,docs,fast,redis,mongo,proxy,i18n]" Windows: .. code-block:: bash - pip install -e .[dev,test,docs,fast,redis,proxy,i18n] + pip install -e .[dev,test,docs,fast,redis,mongo,proxy,i18n] It will install :code:`aiogram` in editable mode into your virtual environment and all dependencies. @@ -116,11 +116,12 @@ All changes should be tested: pytest tests -Also if you are doing something with Redis-storage, you will need to test everything works with Redis: +Also if you are doing something with Redis-storage or/and MongoDB-storage, +you will need to test everything works with Redis or/and MongoDB: .. code-block:: bash - pytest --redis redis://:/ tests + pytest --redis redis://:/ --mongo mongodb://:@: tests Docs ---- diff --git a/docs/dispatcher/dispatcher.rst b/docs/dispatcher/dispatcher.rst index 2bb192de..0b650109 100644 --- a/docs/dispatcher/dispatcher.rst +++ b/docs/dispatcher/dispatcher.rst @@ -47,7 +47,7 @@ All updates can be propagated to the dispatcher by :obj:`Dispatcher.feed_update( .. code-block:: python bot = Bot(...) - dp = Dispathcher() + dp = Dispatcher() ... diff --git a/docs/dispatcher/filters/command.rst b/docs/dispatcher/filters/command.rst index 00fe83c3..171e659b 100644 --- a/docs/dispatcher/filters/command.rst +++ b/docs/dispatcher/filters/command.rst @@ -6,8 +6,8 @@ Usage ===== 1. Filter single variant of commands: :code:`Command("start")` -2. Handle command by regexp pattern: :code:`Command(re.compile(r"item_(\d+)"))` -3. Match command by multiple variants: :code:`Command("item", re.compile(r"item_(\d+)"))` +2. Handle command by regexp pattern: :code:`Command(re.compile(r"item_(\\d+)"))` +3. Match command by multiple variants: :code:`Command("item", re.compile(r"item_(\\d+)"))` 4. Handle commands in public chats intended for other bots: :code:`Command("command", ignore_mention=True)` 5. Use :class:`aiogram.types.bot_command.BotCommand` object as command reference :code:`Command(BotCommand(command="command", description="My awesome command")` diff --git a/docs/dispatcher/finite_state_machine/storages.rst b/docs/dispatcher/finite_state_machine/storages.rst index 702838e5..3795d2f1 100644 --- a/docs/dispatcher/finite_state_machine/storages.rst +++ b/docs/dispatcher/finite_state_machine/storages.rst @@ -19,13 +19,23 @@ RedisStorage :members: __init__, from_url :member-order: bysource -Keys inside storage can be customized via key builders: +MongoStorage +------------ -.. autoclass:: aiogram.fsm.storage.redis.KeyBuilder +.. autoclass:: aiogram.fsm.storage.mongo.MongoStorage + :members: __init__, from_url + :member-order: bysource + +KeyBuilder +------------ + +Keys inside Redis and Mongo storages can be customized via key builders: + +.. autoclass:: aiogram.fsm.storage.base.KeyBuilder :members: :member-order: bysource -.. autoclass:: aiogram.fsm.storage.redis.DefaultKeyBuilder +.. autoclass:: aiogram.fsm.storage.base.DefaultKeyBuilder :members: :member-order: bysource diff --git a/docs/index.rst b/docs/index.rst index 6be454e7..a923cab1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,6 +5,15 @@ Simple usage .. literalinclude:: ../examples/echo_bot.py + +Usage without dispatcher +------------------------ + +Just only interact with Bot API, without handling events + +.. literalinclude:: ../examples/without_dispatcher.py + + Contents ======== diff --git a/docs/migration_2_to_3.rst b/docs/migration_2_to_3.rst index 0eeef2bf..1ce8bd21 100644 --- a/docs/migration_2_to_3.rst +++ b/docs/migration_2_to_3.rst @@ -6,9 +6,9 @@ Migration FAQ (2.x -> 3.0) This guide is still in progress. -This version introduces numerous breaking changes and architectural improvements. -It helps reduce the count of global variables in your code, provides useful mechanisms -to modularize your code, and enables the creation of shareable modules via packages on PyPI. +This version introduces numerous breaking changes and architectural improvements. +It helps reduce the count of global variables in your code, provides useful mechanisms +to modularize your code, and enables the creation of shareable modules via packages on PyPI. It also makes middlewares and filters more controllable, among other improvements. @@ -16,18 +16,26 @@ On this page, you can read about the changes made in relation to the last stable .. note:: - This page more closely resembles a detailed changelog than a migration guide, + This page more closely resembles a detailed changelog than a migration guide, but it will be updated in the future. Feel free to contribute to this page, if you find something that is not mentioned here. +Dependencies +========== + +- The dependencies required for :code:`i18n` are no longer part of the default package. + If your application uses translation functionality, be sure to add an optional dependency: + + :code:`pip install aiogram[i18n]` + Dispatcher ========== -- The :class:`Dispatcher` class no longer accepts a `Bot` instance in its initializer. - Instead, the `Bot` instance should be passed to the dispatcher only for starting polling - or handling events from webhooks. This approach also allows for the use of multiple bot +- The :class:`Dispatcher` class no longer accepts a `Bot` instance in its initializer. + Instead, the `Bot` instance should be passed to the dispatcher only for starting polling + or handling events from webhooks. This approach also allows for the use of multiple bot instances simultaneously ("multibot"). - :class:`Dispatcher` now can be extended with another Dispatcher-like thing named :class:`Router` (:ref:`Read more » `). @@ -35,11 +43,11 @@ Dispatcher - Removed the **_handler** suffix from all event handler decorators and registering methods. (:ref:`Read more » `) - The Executor has been entirely removed; you can now use the Dispatcher directly to start poll the API or handle webhooks from it. -- The throttling method has been completely removed; you can now use middlewares to control +- The throttling method has been completely removed; you can now use middlewares to control the execution context and implement any throttling mechanism you desire. - Removed global context variables from the API types, Bot and Dispatcher object, - From now on, if you want to access the current bot instance within handlers or filters, - you should accept the argument :code:`bot: Bot` and use it instead of :code:`Bot.get_current()`. + From now on, if you want to access the current bot instance within handlers or filters, + you should accept the argument :code:`bot: Bot` and use it instead of :code:`Bot.get_current()`. In middlewares, it can be accessed via :code:`data["bot"]`. - To skip pending updates, you should now call the :class:`aiogram.methods.delete_webhook.DeleteWebhook` method directly, rather than passing :code:`skip_updates=True` to the start polling method. @@ -49,18 +57,18 @@ Filtering events ================ - Keyword filters can no longer be used; use filters explicitly. (`Read more » `_) -- Due to the removal of keyword filters, all previously enabled-by-default filters - (such as state and content_type) are now disabled. +- Due to the removal of keyword filters, all previously enabled-by-default filters + (such as state and content_type) are now disabled. You must specify them explicitly if you wish to use them. For example instead of using :code:`@dp.message_handler(content_types=ContentType.PHOTO)` you should use :code:`@router.message(F.photo)` - Most common filters have been replaced with the "magic filter." (:ref:`Read more » `) -- By default, the message handler now receives any content type. +- By default, the message handler now receives any content type. If you want a specific one, simply add the appropriate filters (Magic or any other). -- The state filter is no longer enabled by default. This means that if you used :code:`state="*"` - in v2, you should not pass any state filter in v3. +- The state filter is no longer enabled by default. This means that if you used :code:`state="*"` + in v2, you should not pass any state filter in v3. Conversely, if the state was not specified in v2, you will now need to specify it in v3. -- Added the possibility to register global filters for each router, which helps to reduce code +- Added the possibility to register global filters for each router, which helps to reduce code repetition and provides an easier way to control the purpose of each router. @@ -68,18 +76,18 @@ Filtering events Bot API ======= -- All API methods are now classes with validation, implemented via - `pydantic `. +- All API methods are now classes with validation, implemented via + `pydantic `. These API calls are also available as methods in the Bot class. -- More pre-defined Enums have been added and moved to the `aiogram.enums` sub-package. +- More pre-defined Enums have been added and moved to the `aiogram.enums` sub-package. For example, the chat type enum is now :class:`aiogram.enums.ChatType` instead of :class:`aiogram.types.chat.ChatType`. -- The HTTP client session has been separated into a container that can be reused +- The HTTP client session has been separated into a container that can be reused across different Bot instances within the application. -- API Exceptions are no longer classified by specific messages, - as Telegram has no documented error codes. - However, all errors are classified by HTTP status codes, and for each method, - only one type of error can be associated with a given code. - Therefore, in most cases, you should check only the error type (by status code) +- API Exceptions are no longer classified by specific messages, + as Telegram has no documented error codes. + However, all errors are classified by HTTP status codes, and for each method, + only one type of error can be associated with a given code. + Therefore, in most cases, you should check only the error type (by status code) without inspecting the error message. @@ -87,12 +95,12 @@ Bot API Middlewares =========== -- Middlewares can now control an execution context, e.g., using context managers. +- Middlewares can now control an execution context, e.g., using context managers. (:ref:`Read more » `) - All contextual data is now shared end-to-end between middlewares, filters, and handlers. For example now you can easily pass some data into context inside middleware and get it in the filters layer as the same way as in the handlers via keyword arguments. -- Added a mechanism named **flags** that helps customize handler behavior +- Added a mechanism named **flags** that helps customize handler behavior in conjunction with middlewares. (:ref:`Read more » `) @@ -116,24 +124,24 @@ Callbacks data Finite State machine ==================== -- State filters will no longer be automatically added to all handlers; +- State filters will no longer be automatically added to all handlers; you will need to specify the state if you want to use it. -- Added the possibility to change the FSM strategy. For example, - if you want to control the state for each user based on chat topics rather than +- Added the possibility to change the FSM strategy. For example, + if you want to control the state for each user based on chat topics rather than the user in a chat, you can specify this in the Dispatcher. - Now :class:`aiogram.fsm.state.State` and :class:`aiogram.fsm.state.StateGroup` don't have helper methods like :code:`.set()`, :code:`.next()`, etc. - Instead, you should set states by passing them directly to :class:`aiogram.fsm.context.FSMContext` (:ref:`Read more » `) -- The state proxy is deprecated; you should update the state data by calling +- The state proxy is deprecated; you should update the state data by calling :code:`state.set_data(...)` and :code:`state.get_data()` respectively. Sending Files ============= -- From now on, you should wrap files in an InputFile object before sending them, +- From now on, you should wrap files in an InputFile object before sending them, instead of passing the IO object directly to the API method. (:ref:`Read more » `) @@ -149,3 +157,76 @@ Telegram API Server - The `server` parameter has been moved from the `Bot` instance to `api` in `BaseSession`. - The constant `aiogram.bot.api.TELEGRAM_PRODUCTION` has been moved to `aiogram.client.telegram.PRODUCTION`. + + +Telegram objects transformation (to dict, to json, from json) +============================================================= + +- Methods :class:`TelegramObject.to_object()`, :class:`TelegramObject.to_json()` and :class:`TelegramObject.to_python()` + have been removed due to the use of `pydantic `_ models. +- :class:`TelegramObject.to_object()` should be replaced by :class:`TelegramObject.model_validate()` + (`Read more `_) +- :class:`TelegramObject.as_json()` should be replaced by :class:`TelegramObject.model_dump_json()` + (`Read more `_) +- :class:`TelegramObject.to_python()` should be replaced by :class:`TelegramObject.model_dump()` + (`Read more `_) + +Here are some usage examples: + +- Creating an object from a dictionary representation of an object + +.. code-block:: + + # Version 2.x + message_dict = {"id": 42, ...} + message_obj = Message.to_object(message_dict) + print(message_obj) + # id=42 name='n' ... + print(type(message_obj)) + # + + # Version 3.x + message_dict = {"id": 42, ...} + message_obj = Message.model_validate(message_dict) + print(message_obj) + # id=42 name='n' ... + print(type(message_obj)) + # + +- Creating a json representation of an object + +.. code-block:: + + async def handler(message: Message) -> None: + # Version 2.x + message_json = message.as_json() + print(message_json) + # {"id": 42, ...} + print(type(message_json)) + # + + # Version 3.x + message_json = message.model_dump_json() + print(message_json) + # {"id": 42, ...} + print(type(message_json)) + # + +- Creating a dictionary representation of an object + +.. code-block:: + + async def handler(message: Message) -> None: + # Version 2.x + message_dict = message.to_python() + print(message_dict) + # {"id": 42, ...} + print(type(message_dict)) + # + + # Version 3.x + message_dict = message.model_dump() + print(message_dict) + # {"id": 42, ...} + print(type(message_dict)) + # diff --git a/docs/utils/formatting.rst b/docs/utils/formatting.rst index 898c1d13..9f3a0572 100644 --- a/docs/utils/formatting.rst +++ b/docs/utils/formatting.rst @@ -197,3 +197,9 @@ Available elements .. autoclass:: aiogram.utils.formatting.CustomEmoji :show-inheritance: + +.. autoclass:: aiogram.utils.formatting.BlockQuote + :show-inheritance: + +.. autoclass:: aiogram.utils.formatting.ExpandableBlockQuote + :show-inheritance: diff --git a/examples/context_addition_from_filter.py b/examples/context_addition_from_filter.py index 40338940..73143417 100644 --- a/examples/context_addition_from_filter.py +++ b/examples/context_addition_from_filter.py @@ -14,7 +14,7 @@ class HelloFilter(Filter): async def __call__( self, message: Message, - event_from_user: User + event_from_user: User, # Filters also can accept keyword parameters like in handlers ) -> Union[bool, Dict[str, Any]]: if message.text.casefold() == "hello": diff --git a/examples/echo_bot.py b/examples/echo_bot.py index 7cb1babe..6a720ddb 100644 --- a/examples/echo_bot.py +++ b/examples/echo_bot.py @@ -3,16 +3,17 @@ import logging import sys from os import getenv -from aiogram import Bot, Dispatcher, Router, types +from aiogram import Bot, Dispatcher, html +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode from aiogram.filters import CommandStart from aiogram.types import Message -from aiogram.utils.markdown import hbold # Bot token can be obtained via https://t.me/BotFather TOKEN = getenv("BOT_TOKEN") # All handlers should be attached to the Router (or Dispatcher) + dp = Dispatcher() @@ -26,11 +27,11 @@ async def command_start_handler(message: Message) -> None: # and the target chat will be passed to :ref:`aiogram.methods.send_message.SendMessage` # method automatically or call API method directly via # Bot instance: `bot.send_message(chat_id=message.chat.id, ...)` - await message.answer(f"Hello, {hbold(message.from_user.full_name)}!") + await message.answer(f"Hello, {html.bold(message.from_user.full_name)}!") @dp.message() -async def echo_handler(message: types.Message) -> None: +async def echo_handler(message: Message) -> None: """ Handler will forward receive a message back to the sender @@ -45,8 +46,9 @@ async def echo_handler(message: types.Message) -> None: async def main() -> None: - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) + # And the run events dispatching await dp.start_polling(bot) diff --git a/examples/echo_bot_webhook.py b/examples/echo_bot_webhook.py index 1fa56c3d..07a83351 100644 --- a/examples/echo_bot_webhook.py +++ b/examples/echo_bot_webhook.py @@ -1,13 +1,15 @@ """ This example shows how to use webhook on behind of any reverse proxy (nginx, traefik, ingress etc.) """ + import logging import sys from os import getenv from aiohttp import web -from aiogram import Bot, Dispatcher, Router, types +from aiogram import Bot, Dispatcher, Router +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode from aiogram.filters import CommandStart from aiogram.types import Message @@ -29,7 +31,7 @@ WEBHOOK_PATH = "/webhook" WEBHOOK_SECRET = "my-secret" # Base URL for webhook will be used to generate webhook URL for Telegram, # in this example it is used public DNS with HTTPS support -BASE_WEBHOOK_URL = "https://aiogram.dev/" +BASE_WEBHOOK_URL = "https://aiogram.dev" # All handlers should be attached to the Router (or Dispatcher) router = Router() @@ -49,7 +51,7 @@ async def command_start_handler(message: Message) -> None: @router.message() -async def echo_handler(message: types.Message) -> None: +async def echo_handler(message: Message) -> None: """ Handler will forward receive a message back to the sender @@ -78,8 +80,8 @@ def main() -> None: # Register startup hook to initialize webhook dp.startup.register(on_startup) - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) # Create aiohttp.web.Application instance app = web.Application() diff --git a/examples/echo_bot_webhook_ssl.py b/examples/echo_bot_webhook_ssl.py index ad41bc4d..28c14d1c 100644 --- a/examples/echo_bot_webhook_ssl.py +++ b/examples/echo_bot_webhook_ssl.py @@ -1,6 +1,7 @@ """ This example shows how to use webhook with SSL certificate. """ + import logging import ssl import sys @@ -8,7 +9,8 @@ from os import getenv from aiohttp import web -from aiogram import Bot, Dispatcher, Router, types +from aiogram import Bot, Dispatcher, Router +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode from aiogram.filters import CommandStart from aiogram.types import FSInputFile, Message @@ -54,7 +56,7 @@ async def command_start_handler(message: Message) -> None: @router.message() -async def echo_handler(message: types.Message) -> None: +async def echo_handler(message: Message) -> None: """ Handler will forward receive a message back to the sender @@ -89,8 +91,8 @@ def main() -> None: # Register startup hook to initialize webhook dp.startup.register(on_startup) - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) # Create aiohttp.web.Application instance app = web.Application() diff --git a/examples/error_handling.py b/examples/error_handling.py index 83b5500d..fca83f82 100644 --- a/examples/error_handling.py +++ b/examples/error_handling.py @@ -1,8 +1,11 @@ import asyncio import html import logging +from os import getenv from aiogram import Bot, Dispatcher, types +from aiogram.client.default import DefaultBotProperties +from aiogram.enums import ParseMode from aiogram.filters import ( Command, CommandObject, @@ -11,7 +14,7 @@ from aiogram.filters import ( ) from aiogram.types import ErrorEvent -TOKEN = "42:TOKEN" +TOKEN = getenv("BOT_TOKEN") dp = Dispatcher() @@ -99,8 +102,8 @@ async def handle_set_name(message: types.Message, command: CommandObject) -> Non async def main() -> None: - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode="HTML") + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) # And the run events dispatching await dp.start_polling(bot) diff --git a/examples/finite_state_machine.py b/examples/finite_state_machine.py index 2905ec5b..f371d2ca 100644 --- a/examples/finite_state_machine.py +++ b/examples/finite_state_machine.py @@ -5,6 +5,7 @@ from os import getenv from typing import Any, Dict from aiogram import Bot, Dispatcher, F, Router, html +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode from aiogram.filters import Command, CommandStart from aiogram.fsm.context import FSMContext @@ -124,10 +125,14 @@ async def show_summary(message: Message, data: Dict[str, Any], positive: bool = async def main(): - bot = Bot(token=TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) + dp = Dispatcher() + dp.include_router(form_router) + # Start event dispatching await dp.start_polling(bot) diff --git a/examples/multi_file_bot/bot.py b/examples/multi_file_bot/bot.py index 927b52a0..0f1ba083 100644 --- a/examples/multi_file_bot/bot.py +++ b/examples/multi_file_bot/bot.py @@ -6,6 +6,7 @@ from handlers.echo import echo_router from handlers.start import start_router from aiogram import Bot, Dispatcher +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode # Bot token can be obtained via https://t.me/BotFather @@ -21,8 +22,9 @@ async def main() -> None: echo_router, ) - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) + # And the run events dispatching await dp.start_polling(bot) diff --git a/examples/multi_file_bot/handlers/start.py b/examples/multi_file_bot/handlers/start.py index 804268c3..3e95f2ab 100644 --- a/examples/multi_file_bot/handlers/start.py +++ b/examples/multi_file_bot/handlers/start.py @@ -1,11 +1,11 @@ from aiogram import Router -from aiogram.filters import Command +from aiogram.filters import CommandStart from aiogram.types import Message start_router = Router() -@start_router.message(Command("start")) +@start_router.message(CommandStart()) async def command_start_handler(message: Message) -> None: """ This handler receives messages with `/start` command diff --git a/examples/own_filter.py b/examples/own_filter.py index 89101920..af87408a 100644 --- a/examples/own_filter.py +++ b/examples/own_filter.py @@ -14,5 +14,4 @@ class MyFilter(Filter): @router.message(MyFilter("hello")) -async def my_handler(message: Message): - ... +async def my_handler(message: Message): ... diff --git a/examples/quiz_scene.py b/examples/quiz_scene.py index 343fef75..b07888df 100644 --- a/examples/quiz_scene.py +++ b/examples/quiz_scene.py @@ -289,13 +289,13 @@ def create_dispatcher(): async def main(): - dispatcher = create_dispatcher() - bot = Bot(TOKEN) - await dispatcher.start_polling(bot) + dp = create_dispatcher() + bot = Bot(token=TOKEN) + await dp.start_polling(bot) if __name__ == "__main__": - logging.basicConfig(level=logging.INFO) - asyncio.run(main()) # Alternatively, you can use aiogram-cli: # `aiogram run polling quiz_scene:create_dispatcher --log-level info --token BOT_TOKEN` + logging.basicConfig(level=logging.INFO) + asyncio.run(main()) diff --git a/examples/scene.py b/examples/scene.py index 090c64c2..ab83bd44 100644 --- a/examples/scene.py +++ b/examples/scene.py @@ -16,6 +16,8 @@ from aiogram.types import ( ReplyKeyboardRemove, ) +TOKEN = getenv("BOT_TOKEN") + BUTTON_CANCEL = KeyboardButton(text="❌ Cancel") BUTTON_BACK = KeyboardButton(text="🔙 Back") @@ -195,9 +197,13 @@ def create_dispatcher() -> Dispatcher: return dispatcher +def main() -> None: + dp = create_dispatcher() + bot = Bot(token=TOKEN) + dp.run_polling(bot) + + if __name__ == "__main__": # Recommended to use CLI instead of this snippet. # `aiogram run polling scene_example:create_dispatcher --token BOT_TOKEN --log-level info` - dp = create_dispatcher() - bot = Bot(token=getenv("TELEGRAM_TOKEN")) - dp.run_polling() + main() diff --git a/examples/specify_updates.py b/examples/specify_updates.py index 56571f1a..c25613a2 100644 --- a/examples/specify_updates.py +++ b/examples/specify_updates.py @@ -4,6 +4,7 @@ import sys from os import getenv from aiogram import Bot, Dispatcher, Router +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode from aiogram.filters import LEAVE_TRANSITION, ChatMemberUpdatedFilter, CommandStart from aiogram.types import ( @@ -78,8 +79,8 @@ async def my_chat_member_change(chat_member: ChatMemberUpdated, bot: Bot) -> Non async def main() -> None: - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) dp = Dispatcher() diff --git a/examples/web_app/handlers.py b/examples/web_app/handlers.py index 5896c0b2..843f4c63 100644 --- a/examples/web_app/handlers.py +++ b/examples/web_app/handlers.py @@ -1,5 +1,5 @@ from aiogram import Bot, F, Router -from aiogram.filters import Command +from aiogram.filters import Command, CommandStart from aiogram.types import ( InlineKeyboardButton, InlineKeyboardMarkup, @@ -11,7 +11,7 @@ from aiogram.types import ( my_router = Router() -@my_router.message(Command("start")) +@my_router.message(CommandStart()) async def command_start(message: Message, bot: Bot, base_url: str): await bot.set_chat_menu_button( chat_id=message.chat.id, diff --git a/examples/web_app/main.py b/examples/web_app/main.py index db148153..06b64566 100644 --- a/examples/web_app/main.py +++ b/examples/web_app/main.py @@ -8,6 +8,8 @@ from handlers import my_router from routes import check_data_handler, demo_handler, send_message_handler from aiogram import Bot, Dispatcher +from aiogram.client.default import DefaultBotProperties +from aiogram.enums.parse_mode import ParseMode from aiogram.types import MenuButtonWebApp, WebAppInfo from aiogram.webhook.aiohttp_server import SimpleRequestHandler, setup_application @@ -24,7 +26,7 @@ async def on_startup(bot: Bot, base_url: str): def main(): - bot = Bot(token=TOKEN, parse_mode="HTML") + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) dispatcher = Dispatcher() dispatcher["base_url"] = APP_BASE_URL dispatcher.startup.register(on_startup) diff --git a/examples/without_dispatcher.py b/examples/without_dispatcher.py new file mode 100644 index 00000000..87e1d8e6 --- /dev/null +++ b/examples/without_dispatcher.py @@ -0,0 +1,36 @@ +import asyncio +from argparse import ArgumentParser + +from aiogram import Bot +from aiogram.client.default import DefaultBotProperties +from aiogram.enums import ParseMode + + +def create_parser() -> ArgumentParser: + parser = ArgumentParser() + parser.add_argument("--token", help="Telegram Bot API Token") + parser.add_argument("--chat-id", type=int, help="Target chat id") + parser.add_argument("--message", "-m", help="Message text to sent", default="Hello, World!") + + return parser + + +async def main(): + parser = create_parser() + ns = parser.parse_args() + + token = ns.token + chat_id = ns.chat_id + message = ns.message + + async with Bot( + token=token, + default=DefaultBotProperties( + parse_mode=ParseMode.HTML, + ), + ) as bot: + await bot.send_message(chat_id=chat_id, text=message) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/pyproject.toml b/pyproject.toml index 8dd765c6..5dbd962b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ classifiers = [ dependencies = [ "magic-filter>=1.0.12,<1.1", "aiohttp~=3.9.0", - "pydantic>=2.4.1,<2.7", + "pydantic>=2.4.1,<2.8", "aiofiles~=23.2.1", "certifi>=2023.7.22", "typing-extensions>=4.7.0,<=5.0", @@ -61,6 +61,9 @@ fast = [ redis = [ "redis[hiredis]~=5.0.1", ] +mongo = [ + "motor~=3.3.2", +] proxy = [ "aiohttp-socks~=0.8.3", ] @@ -98,13 +101,14 @@ docs = [ "sphinxcontrib-towncrier~=0.3.2a0", ] dev = [ - "black~=23.10.0", - "isort~=5.12.0", - "ruff~=0.1.1", - "mypy~=1.6.1", + "black~=24.4.2", + "isort~=5.13.2", + "ruff~=0.4.9", + "mypy~=1.10.0", "toml~=0.10.2", - "pre-commit~=3.5.0", - "packaging~=23.1", + "pre-commit~=3.5", + "packaging~=24.1", + "motor-types~=1.0.0b4", ] [project.urls] @@ -117,6 +121,7 @@ features = [ "dev", "fast", "redis", + "mongo", "proxy", "i18n", "cli", @@ -127,15 +132,16 @@ post-install-commands = [ [tool.hatch.envs.default.scripts] reformat = [ - "black aiogram tests", - "isort aiogram tests", + "black aiogram tests examples", + "isort aiogram tests examples", ] -lint = "ruff aiogram" +lint = "ruff check aiogram tests examples" [tool.hatch.envs.docs] features = [ "fast", "redis", + "mongo", "proxy", "i18n", "docs", @@ -150,6 +156,7 @@ features = [ "dev", "fast", "redis", + "mongo", "proxy", "i18n", "test", @@ -167,6 +174,7 @@ update = [ features = [ "fast", "redis", + "mongo", "proxy", "i18n", "test", @@ -182,6 +190,10 @@ cov-redis = [ "pytest --cov-config pyproject.toml --cov=aiogram --html=reports/py{matrix:python}/tests/index.html --redis {env:REDIS_DNS:'redis://localhost:6379'} {args}", "coverage html -d reports/py{matrix:python}/coverage", ] +cov-mongo = [ + "pytest --cov-config pyproject.toml --cov=aiogram --html=reports/py{matrix:python}/tests/index.html --mongo {env:MONGO_DNS:'mongodb://mongo:mongo@localhost:27017'} {args}", + "coverage html -d reports/py{matrix:python}/coverage", +] view-cov = "google-chrome-stable reports/py{matrix:python}/coverage/index.html" @@ -190,19 +202,6 @@ python = ["38", "39", "310", "311", "312"] [tool.ruff] line-length = 99 -select = [ - # "C", # TODO: mccabe - code complecity - "C4", - "E", - "F", - "T10", - "T20", - "Q", - "RET", -] -ignore = [ - "F401" -] src = ["aiogram", "tests"] exclude = [ ".git", @@ -218,7 +217,22 @@ exclude = [ ] target-version = "py310" -[tool.ruff.isort] +[tool.ruff.lint] +select = [ + # "C", # TODO: mccabe - code complecity + "C4", + "E", + "F", + "T10", + "T20", + "Q", + "RET", +] +ignore = [ + "F401" +] + +[tool.ruff.lint.isort] known-first-party = [ "aiogram", "finite_state_machine", @@ -226,7 +240,7 @@ known-first-party = [ "routes", ] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "aiogram/client/bot.py" = ["E501"] "aiogram/types/*" = ["E501"] "aiogram/methods/*" = ["E501"] diff --git a/tests/conftest.py b/tests/conftest.py index 3e063ff1..497dd50f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,58 +2,62 @@ from pathlib import Path import pytest from _pytest.config import UsageError +from pymongo.errors import InvalidURI, PyMongoError +from pymongo.uri_parser import parse_uri as parse_mongo_url from redis.asyncio.connection import parse_url as parse_redis_url +from redis.exceptions import ConnectionError from aiogram import Dispatcher +from aiogram.fsm.storage.base import StorageKey from aiogram.fsm.storage.memory import ( DisabledEventIsolation, MemoryStorage, SimpleEventIsolation, ) -from aiogram.fsm.storage.redis import RedisEventIsolation, RedisStorage +from aiogram.fsm.storage.mongo import MongoStorage +from aiogram.fsm.storage.redis import RedisStorage from tests.mocked_bot import MockedBot DATA_DIR = Path(__file__).parent / "data" +CHAT_ID = -42 +USER_ID = 42 + +SKIP_MESSAGE_PATTERN = 'Need "--{db}" option with {db} URI to run' +INVALID_URI_PATTERN = "Invalid {db} URI {uri!r}: {err}" + def pytest_addoption(parser): parser.addoption("--redis", default=None, help="run tests which require redis connection") + parser.addoption("--mongo", default=None, help="run tests which require mongo connection") def pytest_configure(config): config.addinivalue_line("markers", "redis: marked tests require redis connection to run") - - -def pytest_collection_modifyitems(config, items): - redis_uri = config.getoption("--redis") - if redis_uri is None: - skip_redis = pytest.mark.skip(reason="need --redis option with redis URI to run") - for item in items: - if "redis" in item.keywords: - item.add_marker(skip_redis) - return - try: - parse_redis_url(redis_uri) - except ValueError as e: - raise UsageError(f"Invalid redis URI {redis_uri!r}: {e}") + config.addinivalue_line("markers", "mongo: marked tests require mongo connection to run") @pytest.fixture() def redis_server(request): redis_uri = request.config.getoption("--redis") - return redis_uri + if redis_uri is None: + pytest.skip(SKIP_MESSAGE_PATTERN.format(db="redis")) + else: + return redis_uri @pytest.fixture() @pytest.mark.redis async def redis_storage(redis_server): - if not redis_server: - pytest.skip("Redis is not available here") + try: + parse_redis_url(redis_server) + except ValueError as e: + raise UsageError(INVALID_URI_PATTERN.format(db="redis", uri=redis_server, err=e)) storage = RedisStorage.from_url(redis_server) try: await storage.redis.info() except ConnectionError as e: - pytest.skip(str(e)) + pytest.fail(str(e)) try: yield storage finally: @@ -62,6 +66,37 @@ async def redis_storage(redis_server): await storage.close() +@pytest.fixture() +def mongo_server(request): + mongo_uri = request.config.getoption("--mongo") + if mongo_uri is None: + pytest.skip(SKIP_MESSAGE_PATTERN.format(db="mongo")) + else: + return mongo_uri + + +@pytest.fixture() +@pytest.mark.mongo +async def mongo_storage(mongo_server): + try: + parse_mongo_url(mongo_server) + except InvalidURI as e: + raise UsageError(INVALID_URI_PATTERN.format(db="mongo", uri=mongo_server, err=e)) + storage = MongoStorage.from_url( + url=mongo_server, + connection_kwargs={"serverSelectionTimeoutMS": 2000}, + ) + try: + await storage._client.server_info() + except PyMongoError as e: + pytest.fail(str(e)) + else: + yield storage + await storage._client.drop_database(storage._database) + finally: + await storage.close() + + @pytest.fixture() async def memory_storage(): storage = MemoryStorage() @@ -101,6 +136,11 @@ def bot(): return MockedBot() +@pytest.fixture(name="storage_key") +def create_storage_key(bot: MockedBot): + return StorageKey(chat_id=CHAT_ID, user_id=USER_ID, bot_id=bot.id) + + @pytest.fixture() async def dispatcher(): dp = Dispatcher() diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 453f5e5a..895908ba 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -5,3 +5,11 @@ services: image: redis:6-alpine ports: - "${REDIS_PORT-6379}:6379" + + mongo: + image: mongo:7.0.6 + environment: + MONGO_INITDB_ROOT_USERNAME: mongo + MONGO_INITDB_ROOT_PASSWORD: mongo + ports: + - "${MONGODB_PORT-27017}:27017" diff --git a/tests/test_api/test_client/test_bot.py b/tests/test_api/test_client/test_bot.py index 7a836b04..34593864 100644 --- a/tests/test_api/test_client/test_bot.py +++ b/tests/test_api/test_client/test_bot.py @@ -12,8 +12,8 @@ from aiogram.client.session.aiohttp import AiohttpSession from aiogram.client.telegram import TelegramAPIServer from aiogram.methods import GetFile, GetMe from aiogram.types import File, PhotoSize -from tests.deprecated import check_deprecated from tests.mocked_bot import MockedBot +from tests.test_api.test_client.test_session.test_base_session import CustomSession @pytest.fixture() @@ -42,36 +42,30 @@ class TestBot: assert isinstance(bot.session, AiohttpSession) assert bot.id == 42 - def test_init_default(self): - with check_deprecated( - max_version="3.7.0", - exception=TypeError, - ): - bot = Bot(token="42:Test", parse_mode="HTML") + async def test_bot_context_manager_over_session(self): + session = CustomSession() + with patch( + "tests.test_api.test_client.test_session.test_base_session.CustomSession.close", + new_callable=AsyncMock, + ) as mocked_close: + async with Bot(token="42:TEST", session=session) as bot: + assert bot.id == 42 + assert bot.session is session - def test_deprecated_parse_mode(self): - with check_deprecated( - max_version="3.7.0", - exception=AttributeError, - ): - bot = Bot(token="42:Test", parse_mode="HTML") - assert bot.parse_mode == "HTML" + mocked_close.assert_awaited_once() - def test_disable_web_page_preview(self): - with check_deprecated( - max_version="3.7.0", - exception=TypeError, - ): - bot = Bot(token="42:Test", disable_web_page_preview=True) - assert bot.disable_web_page_preview is True - - def test_deprecated_protect_content(self): - with check_deprecated( - max_version="3.7.0", - exception=AttributeError, - ): - bot = Bot(token="42:Test", protect_content=True) - assert bot.protect_content is True + @pytest.mark.parametrize( + "kwargs", + [ + {"parse_mode": "HTML"}, + {"disable_web_page_preview": True}, + {"protect_content": True}, + {"parse_mode": True, "disable_web_page_preview": True}, + ], + ) + def test_init_default(self, kwargs): + with pytest.raises(TypeError): + Bot(token="42:Test", **kwargs) def test_hashable(self): bot = Bot("42:TEST") diff --git a/tests/test_api/test_client/test_session/test_base_session.py b/tests/test_api/test_client/test_session/test_base_session.py index 1a1b3c14..6bca619c 100644 --- a/tests/test_api/test_client/test_session/test_base_session.py +++ b/tests/test_api/test_client/test_session/test_base_session.py @@ -26,7 +26,7 @@ from aiogram.exceptions import ( TelegramUnauthorizedError, ) from aiogram.methods import DeleteMessage, GetMe, TelegramMethod -from aiogram.types import UNSET_PARSE_MODE, User, LinkPreviewOptions +from aiogram.types import UNSET_PARSE_MODE, LinkPreviewOptions, User from aiogram.types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_add_sticker_to_set.py b/tests/test_api/test_methods/test_add_sticker_to_set.py index 8e617a74..84b7a9a8 100644 --- a/tests/test_api/test_methods/test_add_sticker_to_set.py +++ b/tests/test_api/test_methods/test_add_sticker_to_set.py @@ -1,3 +1,4 @@ +from aiogram.enums import StickerFormat from aiogram.methods import AddStickerToSet from aiogram.types import InputSticker from tests.mocked_bot import MockedBot @@ -10,7 +11,9 @@ class TestAddStickerToSet: response: bool = await bot.add_sticker_to_set( user_id=42, name="test stickers pack", - sticker=InputSticker(sticker="file id", emoji_list=[":)"]), + sticker=InputSticker( + sticker="file id", format=StickerFormat.STATIC, emoji_list=[":)"] + ), ) request = bot.get_request() assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_create_new_sticker_set.py b/tests/test_api/test_methods/test_create_new_sticker_set.py index 7aef1fc8..840f0c91 100644 --- a/tests/test_api/test_methods/test_create_new_sticker_set.py +++ b/tests/test_api/test_methods/test_create_new_sticker_set.py @@ -13,8 +13,10 @@ class TestCreateNewStickerSet: name="name", title="title", stickers=[ - InputSticker(sticker="file id", emoji_list=[":)"]), - InputSticker(sticker=FSInputFile("file.png"), emoji_list=["=("]), + InputSticker(sticker="file id", format=StickerFormat.STATIC, emoji_list=[":)"]), + InputSticker( + sticker=FSInputFile("file.png"), format=StickerFormat.STATIC, emoji_list=["=("] + ), ], sticker_format=StickerFormat.STATIC, ) diff --git a/tests/test_api/test_methods/test_get_business_connection.py b/tests/test_api/test_methods/test_get_business_connection.py new file mode 100644 index 00000000..22776cb4 --- /dev/null +++ b/tests/test_api/test_methods/test_get_business_connection.py @@ -0,0 +1,24 @@ +from aiogram.methods import GetBusinessConnection +from aiogram.types import BusinessConnection, User +from tests.mocked_bot import MockedBot + + +class TestGetBusinessConnection: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + GetBusinessConnection, + ok=True, + result=BusinessConnection( + id="test", + user=User(id=42, is_bot=False, first_name="User"), + user_chat_id=42, + date=42, + can_reply=True, + is_enabled=True, + ), + ) + response: BusinessConnection = await bot.get_business_connection( + business_connection_id="test" + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_get_chat.py b/tests/test_api/test_methods/test_get_chat.py index 902b03b3..9f67b0c7 100644 --- a/tests/test_api/test_methods/test_get_chat.py +++ b/tests/test_api/test_methods/test_get_chat.py @@ -1,14 +1,22 @@ -from aiogram.methods import GetChat, Request -from aiogram.types import Chat +from aiogram.methods import GetChat +from aiogram.types import ChatFullInfo from tests.mocked_bot import MockedBot class TestGetChat: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for( - GetChat, ok=True, result=Chat(id=-42, type="channel", title="chat") + GetChat, + ok=True, + result=ChatFullInfo( + id=-42, + type="channel", + title="chat", + accent_color_id=0, + max_reaction_count=0, + ), ) - response: Chat = await bot.get_chat(chat_id=-42) + response: ChatFullInfo = await bot.get_chat(chat_id=-42) request = bot.get_request() assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_refund_star_payment.py b/tests/test_api/test_methods/test_refund_star_payment.py new file mode 100644 index 00000000..4e83f940 --- /dev/null +++ b/tests/test_api/test_methods/test_refund_star_payment.py @@ -0,0 +1,16 @@ +from aiogram.enums import StickerFormat +from aiogram.methods import AddStickerToSet, RefundStarPayment +from aiogram.types import InputSticker +from tests.mocked_bot import MockedBot + + +class TestRefundStarPayment: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(RefundStarPayment, ok=True, result=True) + + response: bool = await bot.refund_star_payment( + user_id=42, + telegram_payment_charge_id="12345", + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_replace_sticker_in_set.py b/tests/test_api/test_methods/test_replace_sticker_in_set.py new file mode 100644 index 00000000..e556919d --- /dev/null +++ b/tests/test_api/test_methods/test_replace_sticker_in_set.py @@ -0,0 +1,21 @@ +from aiogram.methods import ReplaceStickerInSet +from aiogram.types import InputSticker +from tests.mocked_bot import MockedBot + + +class TestReplaceStickerInSet: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(ReplaceStickerInSet, ok=True, result=True) + + response: bool = await bot.replace_sticker_in_set( + user_id=42, + name="test", + old_sticker="test", + sticker=InputSticker( + sticker="test", + format="static", + emoji_list=["test"], + ), + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_set_sticker_set_thumbnail.py b/tests/test_api/test_methods/test_set_sticker_set_thumbnail.py index 6c33f862..bfdfd808 100644 --- a/tests/test_api/test_methods/test_set_sticker_set_thumbnail.py +++ b/tests/test_api/test_methods/test_set_sticker_set_thumbnail.py @@ -1,3 +1,4 @@ +from aiogram.enums import StickerFormat from aiogram.methods import Request, SetStickerSetThumbnail from tests.mocked_bot import MockedBot @@ -6,6 +7,8 @@ class TestSetStickerSetThumbnail: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetStickerSetThumbnail, ok=True, result=None) - response: bool = await bot.set_sticker_set_thumbnail(name="test", user_id=42) + response: bool = await bot.set_sticker_set_thumbnail( + name="test", format=StickerFormat.STATIC, user_id=42 + ) request = bot.get_request() assert response == prepare_result.result diff --git a/tests/test_api/test_types/test_message.py b/tests/test_api/test_types/test_message.py index 56c06ceb..be29070e 100644 --- a/tests/test_api/test_types/test_message.py +++ b/tests/test_api/test_types/test_message.py @@ -40,7 +40,10 @@ from aiogram.types import ( UNSET_PARSE_MODE, Animation, Audio, + BackgroundFillSolid, + BackgroundTypeFill, Chat, + ChatBackground, ChatBoostAdded, ChatShared, Contact, @@ -71,6 +74,7 @@ from aiogram.types import ( PollOption, ProximityAlertTriggered, ReactionTypeCustomEmoji, + SharedUser, Sticker, Story, SuccessfulPayment, @@ -469,7 +473,7 @@ TEST_MESSAGE_USERS_SHARED = Message( from_user=None, users_shared=UsersShared( request_id=0, - user_ids=[1, 2], + users=[SharedUser(user_id=1), SharedUser(user_id=2)], ), ) TEST_CHAT_SHARED = Message( @@ -485,8 +489,6 @@ TEST_MESSAGE_STORY = Message( chat=Chat(id=42, type="private"), from_user=User(id=42, is_bot=False, first_name="Test"), story=Story(chat=Chat(id=42, type="private"), id=42), - forward_signature="Test", - forward_date=datetime.datetime.now(), ) TEST_MESSAGE_GIVEAWAY = Message( @@ -527,13 +529,6 @@ TEST_MESSAGE_GIVEAWAY_COMPLETED = Message( from_user=None, giveaway_completed=GiveawayCompleted(winner_count=10), ) -TEST_MESSAGE_HAS_MEDIA_SPOILER = Message( - message_id=42, - date=datetime.datetime.now(), - chat=Chat(id=42, type="private"), - from_user=None, - has_media_spoiler=True, -) TEST_MESSAGE_GENERAL_FORUM_TOPIC_HIDDEN = Message( message_id=42, date=datetime.datetime.now(), @@ -552,7 +547,6 @@ TEST_MESSAGE_WRITE_ACCESS_ALLOWED = Message( message_id=42, date=datetime.datetime.now(), chat=Chat(id=42, type="private"), - from_user=None, write_access_allowed=WriteAccessAllowed(), ) TEST_MESSAGE_BOOST_ADDED = Message( @@ -562,6 +556,18 @@ TEST_MESSAGE_BOOST_ADDED = Message( from_user=User(id=42, is_bot=False, first_name="User"), boost_added=ChatBoostAdded(boost_count=1), ) +TEST_CHAT_BACKGROUND_SET = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=User(id=42, is_bot=False, first_name="User"), + chat_background_set=ChatBackground( + type=BackgroundTypeFill( + fill=BackgroundFillSolid(color=0x000000), + dark_theme_dimming=0, + ) + ), +) TEST_MESSAGE_UNKNOWN = Message( message_id=42, date=datetime.datetime.now(), @@ -625,11 +631,11 @@ MESSAGES_AND_CONTENT_TYPES = [ [TEST_MESSAGE_GIVEAWAY_CREATED, ContentType.GIVEAWAY_CREATED], [TEST_MESSAGE_GIVEAWAY_WINNERS, ContentType.GIVEAWAY_WINNERS], [TEST_MESSAGE_GIVEAWAY_COMPLETED, ContentType.GIVEAWAY_COMPLETED], - [TEST_MESSAGE_HAS_MEDIA_SPOILER, ContentType.HAS_MEDIA_SPOILER], [TEST_MESSAGE_GENERAL_FORUM_TOPIC_HIDDEN, ContentType.GENERAL_FORUM_TOPIC_HIDDEN], [TEST_MESSAGE_GENERAL_FORUM_TOPIC_UNHIDDEN, ContentType.GENERAL_FORUM_TOPIC_UNHIDDEN], [TEST_MESSAGE_WRITE_ACCESS_ALLOWED, ContentType.WRITE_ACCESS_ALLOWED], [TEST_MESSAGE_BOOST_ADDED, ContentType.BOOST_ADDED], + [TEST_CHAT_BACKGROUND_SET, ContentType.CHAT_BACKGROUND_SET], [TEST_MESSAGE_UNKNOWN, ContentType.UNKNOWN], ] @@ -674,7 +680,6 @@ MESSAGES_AND_COPY_METHODS = [ [TEST_MESSAGE_USER_SHARED, None], [TEST_CHAT_SHARED, None], [TEST_MESSAGE_GIVEAWAY_COMPLETED, None], - [TEST_MESSAGE_HAS_MEDIA_SPOILER, None], [TEST_MESSAGE_WEB_APP_DATA, None], [TEST_FORUM_TOPIC_CREATED, None], [TEST_FORUM_TOPIC_EDITED, None], @@ -689,6 +694,7 @@ MESSAGES_AND_COPY_METHODS = [ [TEST_MESSAGE_GIVEAWAY, None], [TEST_MESSAGE_GIVEAWAY_WINNERS, None], [TEST_MESSAGE_BOOST_ADDED, None], + [TEST_CHAT_BACKGROUND_SET, None], [TEST_MESSAGE_UNKNOWN, None], ] diff --git a/tests/test_dispatcher/test_dispatcher.py b/tests/test_dispatcher/test_dispatcher.py index ccac7c1e..98467934 100644 --- a/tests/test_dispatcher/test_dispatcher.py +++ b/tests/test_dispatcher/test_dispatcher.py @@ -16,6 +16,8 @@ from aiogram.dispatcher.event.bases import UNHANDLED, SkipHandler from aiogram.dispatcher.router import Router from aiogram.methods import GetMe, GetUpdates, SendMessage, TelegramMethod from aiogram.types import ( + BusinessConnection, + BusinessMessagesDeleted, CallbackQuery, Chat, ChatBoost, @@ -525,6 +527,65 @@ class TestDispatcher: True, False, ), + pytest.param( + "deleted_business_messages", + Update( + update_id=42, + deleted_business_messages=BusinessMessagesDeleted( + chat=Chat(id=-42, type="private"), + business_connection_id="qwerty", + message_ids=[1, 2, 3], + ), + ), + True, + False, + ), + pytest.param( + "business_connection", + Update( + update_id=42, + business_connection=BusinessConnection( + id="qwerty", + user=User(id=42, is_bot=False, first_name="Test"), + user_chat_id=42, + date=datetime.datetime.now(), + can_reply=True, + is_enabled=True, + ), + ), + False, + True, + ), + pytest.param( + "edited_business_message", + Update( + update_id=42, + edited_business_message=Message( + message_id=42, + date=datetime.datetime.now(), + text="test", + chat=Chat(id=42, type="private"), + from_user=User(id=42, is_bot=False, first_name="Test"), + ), + ), + True, + True, + ), + pytest.param( + "business_message", + Update( + update_id=42, + business_message=Message( + message_id=42, + date=datetime.datetime.now(), + text="test", + chat=Chat(id=42, type="private"), + from_user=User(id=42, is_bot=False, first_name="Test"), + ), + ), + True, + True, + ), ], ) async def test_listen_update( @@ -931,17 +992,13 @@ class TestDispatcher: pytest.fail("Expected 'Detected slow response into webhook' warning.") def test_specify_updates_calculation(self): - def simple_msg_handler() -> None: - ... + def simple_msg_handler() -> None: ... - def simple_callback_query_handler() -> None: - ... + def simple_callback_query_handler() -> None: ... - def simple_poll_handler() -> None: - ... + def simple_poll_handler() -> None: ... - def simple_edited_msg_handler() -> None: - ... + def simple_edited_msg_handler() -> None: ... dispatcher = Dispatcher() dispatcher.message.register(simple_msg_handler) diff --git a/tests/test_dispatcher/test_middlewares/test_user_context.py b/tests/test_dispatcher/test_middlewares/test_user_context.py index 54c09ce2..b3818fbe 100644 --- a/tests/test_dispatcher/test_middlewares/test_user_context.py +++ b/tests/test_dispatcher/test_middlewares/test_user_context.py @@ -2,8 +2,11 @@ from unittest.mock import patch import pytest -from aiogram.dispatcher.middlewares.user_context import UserContextMiddleware -from aiogram.types import Update +from aiogram.dispatcher.middlewares.user_context import ( + EventContext, + UserContextMiddleware, +) +from aiogram.types import Chat, Update, User async def next_handler(*args, **kwargs): @@ -18,9 +21,23 @@ class TestUserContextMiddleware: async def test_call(self): middleware = UserContextMiddleware() data = {} - with patch.object(UserContextMiddleware, "resolve_event_context", return_value=[1, 2, 3]): + + chat = Chat(id=1, type="private", title="Test") + user = User(id=2, first_name="Test", is_bot=False) + thread_id = 3 + + with patch.object( + UserContextMiddleware, + "resolve_event_context", + return_value=EventContext(user=user, chat=chat, thread_id=3), + ): await middleware(next_handler, Update(update_id=42), data) - assert data["event_chat"] == 1 - assert data["event_from_user"] == 2 - assert data["event_thread_id"] == 3 + event_context = data["event_context"] + assert isinstance(event_context, EventContext) + assert event_context.chat is chat + assert event_context.user is user + assert event_context.thread_id == thread_id + assert data["event_chat"] is chat + assert data["event_from_user"] is user + assert data["event_thread_id"] == thread_id diff --git a/tests/test_fsm/storage/test_isolation.py b/tests/test_fsm/storage/test_isolation.py index 1fb21d55..867362c1 100644 --- a/tests/test_fsm/storage/test_isolation.py +++ b/tests/test_fsm/storage/test_isolation.py @@ -4,13 +4,7 @@ from unittest.mock import AsyncMock, patch import pytest from aiogram.fsm.storage.base import BaseEventIsolation, StorageKey -from aiogram.fsm.storage.redis import RedisEventIsolation -from tests.mocked_bot import MockedBot - - -@pytest.fixture(name="storage_key") -def create_storage_key(bot: MockedBot): - return StorageKey(chat_id=-42, user_id=42, bot_id=bot.id) +from aiogram.fsm.storage.redis import RedisEventIsolation, RedisStorage @pytest.mark.parametrize( @@ -32,6 +26,14 @@ class TestIsolations: class TestRedisEventIsolation: + def test_create_isolation(self): + fake_redis = object() + storage = RedisStorage(redis=fake_redis) + isolation = storage.create_isolation() + assert isinstance(isolation, RedisEventIsolation) + assert isolation.redis is fake_redis + assert isolation.key_builder is storage.key_builder + def test_init_without_key_builder(self): redis = AsyncMock() isolation = RedisEventIsolation(redis=redis) diff --git a/tests/test_fsm/storage/test_key_builder.py b/tests/test_fsm/storage/test_key_builder.py new file mode 100644 index 00000000..f62ac505 --- /dev/null +++ b/tests/test_fsm/storage/test_key_builder.py @@ -0,0 +1,106 @@ +from typing import Literal, Optional + +import pytest + +from aiogram.fsm.storage.base import DEFAULT_DESTINY, DefaultKeyBuilder, StorageKey + +PREFIX = "test" +BOT_ID = 42 +CHAT_ID = -1 +USER_ID = 2 +THREAD_ID = 3 +BUSINESS_CONNECTION_ID = "4" +FIELD = "data" + + +class TestDefaultKeyBuilder: + @pytest.mark.parametrize( + "key_builder,field,result", + [ + [ + DefaultKeyBuilder( + prefix=PREFIX, + with_bot_id=True, + with_destiny=True, + with_business_connection_id=True, + ), + FIELD, + f"{PREFIX}:{BOT_ID}:{BUSINESS_CONNECTION_ID}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}:{FIELD}", + ], + [ + DefaultKeyBuilder(prefix=PREFIX, with_bot_id=True, with_destiny=True), + None, + f"{PREFIX}:{BOT_ID}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}", + ], + [ + DefaultKeyBuilder( + prefix=PREFIX, with_bot_id=True, with_business_connection_id=True + ), + FIELD, + f"{PREFIX}:{BOT_ID}:{BUSINESS_CONNECTION_ID}:{CHAT_ID}:{USER_ID}:{FIELD}", + ], + [ + DefaultKeyBuilder(prefix=PREFIX, with_bot_id=True), + None, + f"{PREFIX}:{BOT_ID}:{CHAT_ID}:{USER_ID}", + ], + [ + DefaultKeyBuilder( + prefix=PREFIX, with_destiny=True, with_business_connection_id=True + ), + FIELD, + f"{PREFIX}:{BUSINESS_CONNECTION_ID}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}:{FIELD}", + ], + [ + DefaultKeyBuilder(prefix=PREFIX, with_destiny=True), + None, + f"{PREFIX}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}", + ], + [ + DefaultKeyBuilder(prefix=PREFIX, with_business_connection_id=True), + FIELD, + f"{PREFIX}:{BUSINESS_CONNECTION_ID}:{CHAT_ID}:{USER_ID}:{FIELD}", + ], + [DefaultKeyBuilder(prefix=PREFIX), None, f"{PREFIX}:{CHAT_ID}:{USER_ID}"], + ], + ) + async def test_generate_key( + self, + key_builder: DefaultKeyBuilder, + field: Optional[Literal["data", "state", "lock"]], + result: str, + ): + key = StorageKey( + chat_id=CHAT_ID, + user_id=USER_ID, + bot_id=BOT_ID, + business_connection_id=BUSINESS_CONNECTION_ID, + destiny=DEFAULT_DESTINY, + ) + assert key_builder.build(key, field) == result + + async def test_destiny_check(self): + key_builder = DefaultKeyBuilder( + with_destiny=False, + ) + key = StorageKey(chat_id=CHAT_ID, user_id=USER_ID, bot_id=BOT_ID) + assert key_builder.build(key, FIELD) + + key = StorageKey( + chat_id=CHAT_ID, user_id=USER_ID, bot_id=BOT_ID, destiny="CUSTOM_TEST_DESTINY" + ) + with pytest.raises(ValueError): + key_builder.build(key, FIELD) + + def test_thread_id(self): + key_builder = DefaultKeyBuilder( + prefix=PREFIX, + ) + key = StorageKey( + chat_id=CHAT_ID, + user_id=USER_ID, + bot_id=BOT_ID, + thread_id=THREAD_ID, + destiny=DEFAULT_DESTINY, + ) + assert key_builder.build(key, FIELD) == f"{PREFIX}:{CHAT_ID}:{THREAD_ID}:{USER_ID}:{FIELD}" diff --git a/tests/test_fsm/storage/test_mongo.py b/tests/test_fsm/storage/test_mongo.py new file mode 100644 index 00000000..95a476d6 --- /dev/null +++ b/tests/test_fsm/storage/test_mongo.py @@ -0,0 +1,166 @@ +import pytest +from pymongo.errors import PyMongoError + +from aiogram.fsm.state import State +from aiogram.fsm.storage.mongo import MongoStorage, StorageKey +from tests.conftest import CHAT_ID, USER_ID + +PREFIX = "fsm" + + +async def test_get_storage_passing_only_url(mongo_server): + storage = MongoStorage.from_url(url=mongo_server) + try: + await storage._client.server_info() + except PyMongoError as e: + pytest.fail(str(e)) + + +async def test_update_not_existing_data_with_empty_dictionary( + mongo_storage: MongoStorage, + storage_key: StorageKey, +): + assert await mongo_storage._collection.find_one({}) is None + assert await mongo_storage.get_data(key=storage_key) == {} + assert await mongo_storage.update_data(key=storage_key, data={}) == {} + assert await mongo_storage._collection.find_one({}) is None + + +async def test_document_life_cycle( + mongo_storage: MongoStorage, + storage_key: StorageKey, +): + assert await mongo_storage._collection.find_one({}) is None + await mongo_storage.set_state(storage_key, "test") + await mongo_storage.set_data(storage_key, {"key": "value"}) + assert await mongo_storage._collection.find_one({}) == { + "_id": f"{PREFIX}:{CHAT_ID}:{USER_ID}", + "state": "test", + "data": {"key": "value"}, + } + await mongo_storage.set_state(storage_key, None) + assert await mongo_storage._collection.find_one({}) == { + "_id": f"{PREFIX}:{CHAT_ID}:{USER_ID}", + "data": {"key": "value"}, + } + await mongo_storage.set_data(storage_key, {}) + assert await mongo_storage._collection.find_one({}) is None + + +class TestStateAndDataDoNotAffectEachOther: + async def test_state_and_data_do_not_affect_each_other_while_getting( + self, + mongo_storage: MongoStorage, + storage_key: StorageKey, + ): + assert await mongo_storage._collection.find_one({}) is None + await mongo_storage.set_state(storage_key, "test") + await mongo_storage.set_data(storage_key, {"key": "value"}) + assert await mongo_storage.get_state(storage_key) == "test" + assert await mongo_storage.get_data(storage_key) == {"key": "value"} + + async def test_data_do_not_affect_to_deleted_state_getting( + self, + mongo_storage: MongoStorage, + storage_key: StorageKey, + ): + await mongo_storage.set_state(storage_key, "test") + await mongo_storage.set_data(storage_key, {"key": "value"}) + await mongo_storage.set_state(storage_key, None) + assert await mongo_storage.get_state(storage_key) is None + + async def test_state_do_not_affect_to_deleted_data_getting( + self, + mongo_storage: MongoStorage, + storage_key: StorageKey, + ): + await mongo_storage.set_state(storage_key, "test") + await mongo_storage.set_data(storage_key, {"key": "value"}) + await mongo_storage.set_data(storage_key, {}) + assert await mongo_storage.get_data(storage_key) == {} + + async def test_state_do_not_affect_to_updating_not_existing_data_with_empty_dictionary( + self, + mongo_storage: MongoStorage, + storage_key: StorageKey, + ): + await mongo_storage.set_state(storage_key, "test") + assert await mongo_storage._collection.find_one({}, projection={"_id": 0}) == { + "state": "test" + } + assert await mongo_storage.update_data(key=storage_key, data={}) == {} + assert await mongo_storage._collection.find_one({}, projection={"_id": 0}) == { + "state": "test" + } + + async def test_state_do_not_affect_to_updating_not_existing_data_with_non_empty_dictionary( + self, + mongo_storage: MongoStorage, + storage_key: StorageKey, + ): + await mongo_storage.set_state(storage_key, "test") + assert await mongo_storage._collection.find_one({}, projection={"_id": 0}) == { + "state": "test" + } + assert await mongo_storage.update_data( + key=storage_key, + data={"key": "value"}, + ) == {"key": "value"} + assert await mongo_storage._collection.find_one({}, projection={"_id": 0}) == { + "state": "test", + "data": {"key": "value"}, + } + + async def test_state_do_not_affect_to_updating_existing_data_with_empty_dictionary( + self, + mongo_storage: MongoStorage, + storage_key: StorageKey, + ): + await mongo_storage.set_state(storage_key, "test") + await mongo_storage.set_data(storage_key, {"key": "value"}) + assert await mongo_storage._collection.find_one({}, projection={"_id": 0}) == { + "state": "test", + "data": {"key": "value"}, + } + assert await mongo_storage.update_data(key=storage_key, data={}) == {"key": "value"} + assert await mongo_storage._collection.find_one({}, projection={"_id": 0}) == { + "state": "test", + "data": {"key": "value"}, + } + + async def test_state_do_not_affect_to_updating_existing_data_with_non_empty_dictionary( + self, + mongo_storage: MongoStorage, + storage_key: StorageKey, + ): + await mongo_storage.set_state(storage_key, "test") + await mongo_storage.set_data(storage_key, {"key": "value"}) + assert await mongo_storage._collection.find_one({}, projection={"_id": 0}) == { + "state": "test", + "data": {"key": "value"}, + } + assert await mongo_storage.update_data( + key=storage_key, + data={"key": "VALUE", "key_2": "value_2"}, + ) == {"key": "VALUE", "key_2": "value_2"} + assert await mongo_storage._collection.find_one({}, projection={"_id": 0}) == { + "state": "test", + "data": {"key": "VALUE", "key_2": "value_2"}, + } + + +@pytest.mark.parametrize( + "value,result", + [ + [None, None], + ["", ""], + ["text", "text"], + [State(), None], + [State(state="*"), "*"], + [State("text"), "@:text"], + [State("test", group_name="Test"), "Test:test"], + [[1, 2, 3], "[1, 2, 3]"], + ], +) +def test_resolve_state(value, result, mongo_storage: MongoStorage): + assert mongo_storage.resolve_state(value) == result diff --git a/tests/test_fsm/storage/test_redis.py b/tests/test_fsm/storage/test_redis.py deleted file mode 100644 index adca384a..00000000 --- a/tests/test_fsm/storage/test_redis.py +++ /dev/null @@ -1,69 +0,0 @@ -import pytest - -from aiogram.fsm.storage.base import DEFAULT_DESTINY, StorageKey -from aiogram.fsm.storage.redis import ( - DefaultKeyBuilder, - RedisEventIsolation, - RedisStorage, -) - -PREFIX = "test" -BOT_ID = 42 -CHAT_ID = -1 -USER_ID = 2 -THREAD_ID = 3 -FIELD = "data" - - -class TestRedisDefaultKeyBuilder: - @pytest.mark.parametrize( - "with_bot_id,with_destiny,result", - [ - [False, False, f"{PREFIX}:{CHAT_ID}:{USER_ID}:{FIELD}"], - [True, False, f"{PREFIX}:{BOT_ID}:{CHAT_ID}:{USER_ID}:{FIELD}"], - [True, True, f"{PREFIX}:{BOT_ID}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}:{FIELD}"], - [False, True, f"{PREFIX}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}:{FIELD}"], - ], - ) - async def test_generate_key(self, with_bot_id: bool, with_destiny: bool, result: str): - key_builder = DefaultKeyBuilder( - prefix=PREFIX, - with_bot_id=with_bot_id, - with_destiny=with_destiny, - ) - key = StorageKey(chat_id=CHAT_ID, user_id=USER_ID, bot_id=BOT_ID, destiny=DEFAULT_DESTINY) - assert key_builder.build(key, FIELD) == result - - async def test_destiny_check(self): - key_builder = DefaultKeyBuilder( - with_destiny=False, - ) - key = StorageKey(chat_id=CHAT_ID, user_id=USER_ID, bot_id=BOT_ID) - assert key_builder.build(key, FIELD) - - key = StorageKey( - chat_id=CHAT_ID, user_id=USER_ID, bot_id=BOT_ID, destiny="CUSTOM_TEST_DESTINY" - ) - with pytest.raises(ValueError): - key_builder.build(key, FIELD) - - def test_thread_id(self): - key_builder = DefaultKeyBuilder( - prefix=PREFIX, - ) - key = StorageKey( - chat_id=CHAT_ID, - user_id=USER_ID, - bot_id=BOT_ID, - thread_id=THREAD_ID, - destiny=DEFAULT_DESTINY, - ) - assert key_builder.build(key, FIELD) == f"{PREFIX}:{CHAT_ID}:{THREAD_ID}:{USER_ID}:{FIELD}" - - def test_create_isolation(self): - fake_redis = object() - storage = RedisStorage(redis=fake_redis) - isolation = storage.create_isolation() - assert isinstance(isolation, RedisEventIsolation) - assert isolation.redis is fake_redis - assert isolation.key_builder is storage.key_builder diff --git a/tests/test_fsm/storage/test_storages.py b/tests/test_fsm/storage/test_storages.py index 3558e33d..690bc791 100644 --- a/tests/test_fsm/storage/test_storages.py +++ b/tests/test_fsm/storage/test_storages.py @@ -1,20 +1,18 @@ import pytest from aiogram.fsm.storage.base import BaseStorage, StorageKey -from tests.mocked_bot import MockedBot - - -@pytest.fixture(name="storage_key") -def create_storage_key(bot: MockedBot): - return StorageKey(chat_id=-42, user_id=42, bot_id=bot.id) @pytest.mark.parametrize( "storage", - [pytest.lazy_fixture("redis_storage"), pytest.lazy_fixture("memory_storage")], + [ + pytest.lazy_fixture("redis_storage"), + pytest.lazy_fixture("mongo_storage"), + pytest.lazy_fixture("memory_storage"), + ], ) class TestStorages: - async def test_set_state(self, bot: MockedBot, storage: BaseStorage, storage_key: StorageKey): + async def test_set_state(self, storage: BaseStorage, storage_key: StorageKey): assert await storage.get_state(key=storage_key) is None await storage.set_state(key=storage_key, state="state") @@ -22,7 +20,7 @@ class TestStorages: await storage.set_state(key=storage_key, state=None) assert await storage.get_state(key=storage_key) is None - async def test_set_data(self, bot: MockedBot, storage: BaseStorage, storage_key: StorageKey): + async def test_set_data(self, storage: BaseStorage, storage_key: StorageKey): assert await storage.get_data(key=storage_key) == {} await storage.set_data(key=storage_key, data={"foo": "bar"}) @@ -30,11 +28,11 @@ class TestStorages: await storage.set_data(key=storage_key, data={}) assert await storage.get_data(key=storage_key) == {} - async def test_update_data( - self, bot: MockedBot, storage: BaseStorage, storage_key: StorageKey - ): + async def test_update_data(self, storage: BaseStorage, storage_key: StorageKey): assert await storage.get_data(key=storage_key) == {} assert await storage.update_data(key=storage_key, data={"foo": "bar"}) == {"foo": "bar"} + assert await storage.update_data(key=storage_key, data={}) == {"foo": "bar"} + assert await storage.get_data(key=storage_key) == {"foo": "bar"} assert await storage.update_data(key=storage_key, data={"baz": "spam"}) == { "foo": "bar", "baz": "spam", @@ -43,3 +41,11 @@ class TestStorages: "foo": "bar", "baz": "spam", } + assert await storage.update_data(key=storage_key, data={"baz": "test"}) == { + "foo": "bar", + "baz": "test", + } + assert await storage.get_data(key=storage_key) == { + "foo": "bar", + "baz": "test", + } diff --git a/tests/test_utils/test_formatting.py b/tests/test_utils/test_formatting.py index b39ceb32..dbe07d17 100644 --- a/tests/test_utils/test_formatting.py +++ b/tests/test_utils/test_formatting.py @@ -3,12 +3,14 @@ import pytest from aiogram.enums import MessageEntityType from aiogram.types import MessageEntity, User from aiogram.utils.formatting import ( + BlockQuote, Bold, BotCommand, CashTag, Code, CustomEmoji, Email, + ExpandableBlockQuote, HashTag, Italic, PhoneNumber, @@ -105,6 +107,14 @@ class TestNode: CustomEmoji("test", custom_emoji_id="42"), 'test', ], + [ + BlockQuote("test"), + "
test
", + ], + [ + ExpandableBlockQuote("test"), + "
test
", + ], ], ) def test_render_plain_only(self, node: Text, result: str): diff --git a/tests/test_utils/test_text_decorations.py b/tests/test_utils/test_text_decorations.py index 6a177ab3..50623447 100644 --- a/tests/test_utils/test_text_decorations.py +++ b/tests/test_utils/test_text_decorations.py @@ -71,6 +71,11 @@ class TestTextDecoration: MessageEntity(type="blockquote", offset=0, length=5), "
test
", ], + [ + html_decoration, + MessageEntity(type="expandable_blockquote", offset=0, length=5), + "
test
", + ], [markdown_decoration, MessageEntity(type="bold", offset=0, length=5), "*test*"], [markdown_decoration, MessageEntity(type="italic", offset=0, length=5), "_\rtest_\r"], [markdown_decoration, MessageEntity(type="code", offset=0, length=5), "`test`"], @@ -99,7 +104,7 @@ class TestTextDecoration: [ markdown_decoration, MessageEntity(type="custom_emoji", offset=0, length=5, custom_emoji_id="42"), - "[test](tg://emoji?id=42)", + "![test](tg://emoji?id=42)", ], [ markdown_decoration, @@ -116,6 +121,11 @@ class TestTextDecoration: MessageEntity(type="blockquote", offset=0, length=5), ">test", ], + [ + markdown_decoration, + MessageEntity(type="expandable_blockquote", offset=0, length=5), + ">test||", + ], ], ) def test_apply_single_entity(