diff --git a/.apiversion b/.apiversion index 0f0fefae..5904f7ad 100644 --- a/.apiversion +++ b/.apiversion @@ -1 +1 @@ -7.1 +7.2 diff --git a/.butcher/enums/ContentType.yml b/.butcher/enums/ContentType.yml index 4d0bb58a..fdebf066 100644 --- a/.butcher/enums/ContentType.yml +++ b/.butcher/enums/ContentType.yml @@ -37,3 +37,7 @@ extract: - link_preview_options - sender_boost_count - reply_to_story + - business_connection_id + - sender_business_bot + - is_from_offline + - has_media_spoiler 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/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/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/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/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..c2bbcb62 100644 --- a/.butcher/methods/promoteChatMember/entity.json +++ b/.butcher/methods/promoteChatMember/entity.json @@ -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/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/entity.json b/.butcher/methods/sendAnimation/entity.json index f3e82be9..1bf8309f 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, @@ -126,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendAudio/entity.json b/.butcher/methods/sendAudio/entity.json index 94f4b1ff..ed6e0de6 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, @@ -118,9 +126,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\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..dff7c071 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, @@ -86,9 +94,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendDice/entity.json b/.butcher/methods/sendDice/entity.json index f6d09e5d..eebb0ab7 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, @@ -62,9 +70,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendDocument/entity.json b/.butcher/methods/sendDocument/entity.json index 4868bcd6..cdb32b8a 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, @@ -102,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendGame/entity.json b/.butcher/methods/sendGame/entity.json index 2532a480..909ade99 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, @@ -62,9 +70,9 @@ { "type": "InlineKeyboardMarkup", "required": false, - "description": "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.", - "html_description": "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.", - "rst_description": "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.\n", + "description": "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. Not supported for messages sent on behalf of a business account.", + "html_description": "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. Not supported for messages sent on behalf of a business account.", + "rst_description": "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. Not supported for messages sent on behalf of a business account.\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendLocation/entity.json b/.butcher/methods/sendLocation/entity.json index 07fd9d5a..e91683fb 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, @@ -102,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendMediaGroup/entity.json b/.butcher/methods/sendMediaGroup/entity.json index 6f9c4490..88a4d07a 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, diff --git a/.butcher/methods/sendMessage/entity.json b/.butcher/methods/sendMessage/entity.json index 8550f779..a70826ef 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, @@ -86,9 +94,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendPhoto/entity.json b/.butcher/methods/sendPhoto/entity.json index fa65104b..c9c69a72 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, @@ -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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendPoll/entity.json b/.butcher/methods/sendPoll/entity.json index bf1daa6d..c3517737 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, @@ -150,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendSticker/entity.json b/.butcher/methods/sendSticker/entity.json index 9b67cb82..36a8c5cf 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" }, { @@ -70,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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.", + "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. Not supported for messages sent on behalf of a business account.", + "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. Not supported for messages sent on behalf of a business account.\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendVenue/entity.json b/.butcher/methods/sendVenue/entity.json index 4b4c52e6..c1363c55 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, @@ -118,9 +126,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendVideo/entity.json b/.butcher/methods/sendVideo/entity.json index 1d117484..4f877661 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, @@ -134,9 +142,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendVideoNote/entity.json b/.butcher/methods/sendVideoNote/entity.json index 2727d1b7..857185c9 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, @@ -86,9 +94,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" }, { diff --git a/.butcher/methods/sendVoice/entity.json b/.butcher/methods/sendVoice/entity.json index b5a4da98..819d6cab 100644 --- a/.butcher/methods/sendVoice/entity.json +++ b/.butcher/methods/sendVoice/entity.json @@ -11,6 +11,14 @@ "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.", "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, @@ -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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\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..94bf6573 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.2", + "release_date": "2024-03-31" }, "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 non-service message from a connected business account", + "html_description": "Optional. New non-service message from a connected business account", + "rst_description": "*Optional*. New non-service 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" @@ -571,6 +611,46 @@ "name": "active_usernames", "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 + }, + { + "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 + }, + { + "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 + }, + { + "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 + }, + { + "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 + }, { "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.", @@ -845,6 +925,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 +941,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 +1037,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", @@ -1804,17 +1908,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 }, @@ -2775,14 +2879,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 +2887,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", @@ -3084,6 +3188,56 @@ "annotations": [], "category": "types" }, + { + "anchor": "shareduser", + "name": "SharedUser", + "description": "This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUser button.", + "html_description": "

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

", + "rst_description": "This object contains information about a user that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_user.KeyboardButtonRequestUser` 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 +3254,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 +3267,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 +3286,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" @@ -3711,9 +3889,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 +3924,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 name", + "html_description": "Optional. Pass True to request the users' first and last name", + "rst_description": "*Optional*. Pass :code:`True` to request the users' first and last name\n", + "name": "request_name", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' username", + "html_description": "Optional. Pass True to request the users' username", + "rst_description": "*Optional*. Pass :code:`True` to request the users' username\n", + "name": "request_username", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' photo", + "html_description": "Optional. Pass True to request the users' photo", + "rst_description": "*Optional*. Pass :code:`True` to request the users' photo\n", + "name": "request_photo", + "required": false } ], "category": "types" @@ -3753,9 +3955,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 сhat 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 сhat 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 сhat if appropriate `More about requesting chats » `_", "annotations": [ { "type": "Integer", @@ -3820,6 +4022,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" @@ -4389,33 +4615,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 } @@ -4660,33 +4886,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 +5347,152 @@ ], "category": "types" }, + { + "anchor": "birthdate", + "name": "Birthdate", + "description": "", + "html_description": "", + "rst_description": "", + "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": "", + "html_description": "", + "rst_description": "", + "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": "", + "html_description": "", + "rst_description": "", + "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": "", + "html_description": "", + "rst_description": "", + "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": "", + "html_description": "", + "rst_description": "", + "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 +6313,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": "A JSON-serialized list of identifiers of deleted messages in the chat of the business account", + "html_description": "A JSON-serialized list of identifiers of deleted messages in the chat of the business account", + "rst_description": "A JSON-serialized 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", @@ -6420,6 +6884,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, @@ -6495,9 +6967,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -6595,9 +7067,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" }, { @@ -6751,9 +7223,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 +7262,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, @@ -6873,9 +7353,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -6888,6 +7368,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, @@ -6995,9 +7483,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -7010,6 +7498,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, @@ -7101,9 +7597,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -7116,6 +7612,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, @@ -7239,9 +7743,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -7254,6 +7758,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, @@ -7369,9 +7881,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -7384,6 +7896,14 @@ "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.", "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, @@ -7467,9 +7987,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -7482,6 +8002,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, @@ -7557,9 +8085,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -7572,6 +8100,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, @@ -7630,6 +8166,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, @@ -7721,9 +8265,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -7736,6 +8280,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, @@ -7843,9 +8395,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -7858,6 +8410,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, @@ -7933,9 +8493,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -7948,6 +8508,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, @@ -8087,9 +8655,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -8102,6 +8670,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, @@ -8153,9 +8729,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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account", + "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. Not supported for messages sent on behalf of a business account\n", "name": "reply_markup" } ], @@ -8168,6 +8744,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 +8763,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 +8805,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" }, { @@ -8529,33 +9113,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" } ], @@ -9590,6 +10174,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", @@ -10337,9 +10939,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 +11115,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 +11191,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 +11233,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 +11260,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" }, { @@ -10698,9 +11300,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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.", + "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. Not supported for messages sent on behalf of a business account.", + "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. Not supported for messages sent on behalf of a business account.\n", "name": "reply_markup" } ], @@ -10734,9 +11336,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 +11347,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 +11417,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 +11439,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 +11514,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 +11690,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" @@ -14640,65 +15284,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 +15826,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, @@ -15233,9 +15885,9 @@ { "type": "InlineKeyboardMarkup", "required": false, - "description": "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.", - "html_description": "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.", - "rst_description": "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.\n", + "description": "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. Not supported for messages sent on behalf of a business account.", + "html_description": "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. Not supported for messages sent on behalf of a business account.", + "rst_description": "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. Not supported for messages sent on behalf of a business account.\n", "name": "reply_markup" } ], diff --git a/.butcher/types/Birthdate/entity.json b/.butcher/types/Birthdate/entity.json new file mode 100644 index 00000000..b70055c6 --- /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": "", + "html_description": "", + "rst_description": "", + "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..4208d21f --- /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": "", + "html_description": "", + "rst_description": "", + "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..0d3ddac3 --- /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": "", + "html_description": "", + "rst_description": "", + "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..3eb82a8d --- /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": "A JSON-serialized list of identifiers of deleted messages in the chat of the business account", + "html_description": "A JSON-serialized list of identifiers of deleted messages in the chat of the business account", + "rst_description": "A JSON-serialized 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..7632bbe0 --- /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": "", + "html_description": "", + "rst_description": "", + "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..7c5dbf86 --- /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": "", + "html_description": "", + "rst_description": "", + "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..3a273c91 100644 --- a/.butcher/types/Chat/entity.json +++ b/.butcher/types/Chat/entity.json @@ -83,6 +83,46 @@ "name": "active_usernames", "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 + }, + { + "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 + }, + { + "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 + }, + { + "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 + }, + { + "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 + }, { "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.", diff --git a/.butcher/types/ChatAdministratorRights/entity.json b/.butcher/types/ChatAdministratorRights/entity.json index d45cda66..b242ed93 100644 --- a/.butcher/types/ChatAdministratorRights/entity.json +++ b/.butcher/types/ChatAdministratorRights/entity.json @@ -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/ChatMemberAdministrator/entity.json b/.butcher/types/ChatMemberAdministrator/entity.json index b0e4a00c..a52feb11 100644 --- a/.butcher/types/ChatMemberAdministrator/entity.json +++ b/.butcher/types/ChatMemberAdministrator/entity.json @@ -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/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/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/KeyboardButtonRequestChat/entity.json b/.butcher/types/KeyboardButtonRequestChat/entity.json index a8674be8..255df173 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 сhat 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 сhat 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 сhat 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..ed7a2141 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 name", + "html_description": "Optional. Pass True to request the users' first and last name", + "rst_description": "*Optional*. Pass :code:`True` to request the users' first and last name\n", + "name": "request_name", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' username", + "html_description": "Optional. Pass True to request the users' username", + "rst_description": "*Optional*. Pass :code:`True` to request the users' username\n", + "name": "request_username", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request the users' photo", + "html_description": "Optional. Pass True to request the users' photo", + "rst_description": "*Optional*. Pass :code:`True` to request the users' photo\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..c190dcbb 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", 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..6e33fe97 --- /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 KeyboardButtonRequestUser button.", + "html_description": "

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

", + "rst_description": "This object contains information about a user that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_user.KeyboardButtonRequestUser` 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/Update/entity.json b/.butcher/types/Update/entity.json index 756fcb01..e28a0d4e 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 non-service message from a connected business account", + "html_description": "Optional. New non-service message from a connected business account", + "rst_description": "*Optional*. New non-service 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/CHANGES/1444.misc.rst b/CHANGES/1444.misc.rst new file mode 100644 index 00000000..35e82ca9 --- /dev/null +++ b/CHANGES/1444.misc.rst @@ -0,0 +1 @@ +Added full support of `Bot API 7.2 `_ diff --git a/README.rst b/README.rst index 4ebf2f2d..e84e60e3 100644 --- a/README.rst +++ b/README.rst @@ -52,7 +52,7 @@ Features - Asynchronous (`asyncio docs `_, :pep:`492`) - Has type hints (:pep:`484`) and can be used with `mypy `_ - Supports `PyPy `_ -- Supports `Telegram Bot API 7.1 `_ and gets fast updates to the latest versions of the Bot API +- Supports `Telegram Bot API 7.2 `_ 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..bdbcd36b 100644 --- a/aiogram/__meta__.py +++ b/aiogram/__meta__.py @@ -1,2 +1,2 @@ -__version__ = "3.4.1" -__api_version__ = "7.1" +__version__ = "3.5.0" +__api_version__ = "7.2" diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index ab25a549..bf556d1d 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -61,6 +61,7 @@ from ..methods import ( ExportChatInviteLink, ForwardMessage, ForwardMessages, + GetBusinessConnection, GetChat, GetChatAdministrators, GetChatMember, @@ -88,6 +89,7 @@ from ..methods import ( PromoteChatMember, ReopenForumTopic, ReopenGeneralForumTopic, + ReplaceStickerInSet, RestrictChatMember, RevokeChatInviteLink, SendAnimation, @@ -155,6 +157,7 @@ from ..types import ( BotDescription, BotName, BotShortDescription, + BusinessConnection, Chat, ChatAdministratorRights, ChatInviteLink, @@ -518,7 +521,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 @@ -1051,9 +1054,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 +1068,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 +1080,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) @@ -1728,7 +1731,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. """ @@ -2073,10 +2076,10 @@ class Bot: :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_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 +2187,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, @@ -2210,6 +2214,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 @@ -2222,7 +2227,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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 +2237,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, @@ -2254,6 +2260,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"), @@ -2280,6 +2287,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. @@ -2291,7 +2299,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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 +2309,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, @@ -2322,6 +2331,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 +2346,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 +2355,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,6 +2365,7 @@ 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, @@ -2374,13 +2387,14 @@ 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 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. Not supported for messages sent on behalf of a business account :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,6 +2405,7 @@ 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, @@ -2406,6 +2421,7 @@ 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, @@ -2424,12 +2440,13 @@ 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 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. Not supported for messages sent on behalf of a business account :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,6 +2455,7 @@ 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, @@ -2453,6 +2471,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, @@ -2476,6 +2495,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 @@ -2485,7 +2505,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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 +2515,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, @@ -2514,6 +2535,7 @@ 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"), @@ -2530,11 +2552,12 @@ 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 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 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. Not supported for messages sent on behalf of a business account. :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 @@ -2544,6 +2567,7 @@ 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, @@ -2663,6 +2687,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, @@ -2686,6 +2711,7 @@ 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. @@ -2694,7 +2720,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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 +2731,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, @@ -2723,6 +2750,7 @@ 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"), @@ -2738,6 +2766,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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 @@ -2751,6 +2780,7 @@ 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, @@ -2764,6 +2794,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, @@ -2790,6 +2821,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param text: Text of the message to be sent, 1-4096 characters after entities parsing + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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* @@ -2797,7 +2829,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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,6 +2840,7 @@ 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, @@ -2826,6 +2859,7 @@ 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"), @@ -2848,6 +2882,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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. @@ -2856,7 +2891,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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,6 +2901,7 @@ 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, @@ -2885,6 +2921,7 @@ class Bot: chat_id: Union[int, str], question: str, options: List[str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, is_anonymous: Optional[bool] = None, type: Optional[str] = None, @@ -2914,6 +2951,7 @@ 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 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 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' @@ -2928,7 +2966,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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,6 +2977,7 @@ class Bot: chat_id=chat_id, question=question, options=options, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, is_anonymous=is_anonymous, type=type, @@ -2963,6 +3002,7 @@ 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, @@ -2981,13 +3021,14 @@ 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 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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. :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,6 +3038,7 @@ 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, @@ -3015,6 +3057,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, @@ -3040,6 +3083,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'.) @@ -3048,7 +3092,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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 +3105,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, @@ -3079,6 +3124,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, @@ -3106,6 +3152,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 @@ -3119,7 +3166,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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 +3176,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, @@ -3152,6 +3200,7 @@ 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, @@ -3173,6 +3222,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » `. Sending video notes by a URL is currently unsupported + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param duration: Duration of sent video in seconds :param length: Video width and height, i.e. diameter of the video message @@ -3180,7 +3230,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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,6 +3240,7 @@ 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, @@ -3207,6 +3258,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"), @@ -3229,6 +3281,7 @@ class Bot: :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » ` + :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param 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. @@ -3237,7 +3290,7 @@ class Bot: :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param 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. Not supported for messages sent on behalf of a business account :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 +3300,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, @@ -3812,7 +3866,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 +4189,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 +4200,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 +4209,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 +4318,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 +4350,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 +4378,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 +4434,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 +4447,52 @@ 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) diff --git a/aiogram/dispatcher/middlewares/user_context.py b/aiogram/dispatcher/middlewares/user_context.py index 87c38147..0c780048 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,114 @@ 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 + 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 + 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..20b01c43 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" 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/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..a66d56be 100644 --- a/aiogram/fsm/storage/base.py +++ b/aiogram/fsm/storage/base.py @@ -16,6 +16,7 @@ class StorageKey: chat_id: int user_id: int thread_id: Optional[int] = None + business_connection_id: Optional[str] = None destiny: str = DEFAULT_DESTINY diff --git a/aiogram/fsm/storage/redis.py b/aiogram/fsm/storage/redis.py index 33e44be4..a818a831 100644 --- a/aiogram/fsm/storage/redis.py +++ b/aiogram/fsm/storage/redis.py @@ -44,7 +44,10 @@ 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. + optional bot_id, business_connection_id and destiny. + + Format: + :code:`::::::` """ def __init__( @@ -53,23 +56,28 @@ class DefaultKeyBuilder(KeyBuilder): 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_destiny: include destiny key + :param with_business_connection_id: include business connection id + :param with_destiny: include a 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: Literal["data", "state", "lock"]) -> 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)) diff --git a/aiogram/methods/__init__.py b/aiogram/methods/__init__.py index 370cbee1..cd9692e2 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 @@ -65,6 +66,7 @@ from .pin_chat_message import PinChatMessage from .promote_chat_member import PromoteChatMember 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 +161,7 @@ __all__ = ( "ExportChatInviteLink", "ForwardMessage", "ForwardMessages", + "GetBusinessConnection", "GetChat", "GetChatAdministrators", "GetChatMember", @@ -186,6 +189,7 @@ __all__ = ( "PromoteChatMember", "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_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_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/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_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..9a0deac7 100644 --- a/aiogram/methods/promote_chat_member.py +++ b/aiogram/methods/promote_chat_member.py @@ -42,13 +42,13 @@ class PromoteChatMember(TelegramMethod[bool]): 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/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..42362c94 100644 --- a/aiogram/methods/send_animation.py +++ b/aiogram/methods/send_animation.py @@ -33,6 +33,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 @@ -60,7 +62,7 @@ class SendAnimation(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -83,6 +85,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, @@ -109,6 +112,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, diff --git a/aiogram/methods/send_audio.py b/aiogram/methods/send_audio.py index 43b6a781..b7d945d9 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 @@ -58,7 +60,7 @@ class SendAudio(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -81,6 +83,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"), @@ -106,6 +109,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, 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..49cfedc9 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 @@ -47,7 +49,7 @@ class SendContact(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -71,6 +73,7 @@ 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, @@ -92,6 +95,7 @@ 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, diff --git a/aiogram/methods/send_dice.py b/aiogram/methods/send_dice.py index d8a9ac8d..40d7dcdf 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 @@ -41,7 +43,7 @@ class SendDice(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -63,6 +65,7 @@ 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, @@ -81,6 +84,7 @@ 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, diff --git a/aiogram/methods/send_document.py b/aiogram/methods/send_document.py index 718dd346..e4ac3dfe 100644 --- a/aiogram/methods/send_document.py +++ b/aiogram/methods/send_document.py @@ -33,6 +33,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 @@ -54,7 +56,7 @@ class SendDocument(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -77,6 +79,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, @@ -100,6 +103,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, diff --git a/aiogram/methods/send_game.py b/aiogram/methods/send_game.py index 73e69795..4822bcdc 100644 --- a/aiogram/methods/send_game.py +++ b/aiogram/methods/send_game.py @@ -23,6 +23,8 @@ 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 @@ -32,7 +34,7 @@ class SendGame(TelegramMethod[Message]): reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[InlineKeyboardMarkup] = None - """A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.""" + """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. Not supported for messages sent on behalf of a business account.""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -55,6 +57,7 @@ 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"), @@ -71,6 +74,7 @@ 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, diff --git a/aiogram/methods/send_location.py b/aiogram/methods/send_location.py index 44a74300..5c07a0c8 100644 --- a/aiogram/methods/send_location.py +++ b/aiogram/methods/send_location.py @@ -32,6 +32,8 @@ 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 @@ -51,7 +53,7 @@ class SendLocation(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -75,6 +77,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, @@ -98,6 +101,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, diff --git a/aiogram/methods/send_media_group.py b/aiogram/methods/send_media_group.py index bbf886cc..58e44946 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,6 +34,8 @@ 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 @@ -62,6 +68,7 @@ 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"), @@ -77,6 +84,7 @@ 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, diff --git a/aiogram/methods/send_message.py b/aiogram/methods/send_message.py index fc002ec4..d55c6e49 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") @@ -49,7 +51,7 @@ class SendMessage(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -79,6 +81,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, @@ -105,6 +108,7 @@ 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, diff --git a/aiogram/methods/send_photo.py b/aiogram/methods/send_photo.py index b10ac8f0..acad7aac 100644 --- a/aiogram/methods/send_photo.py +++ b/aiogram/methods/send_photo.py @@ -33,6 +33,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 @@ -52,7 +54,7 @@ class SendPhoto(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -75,6 +77,7 @@ 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"), @@ -97,6 +100,7 @@ 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, diff --git a/aiogram/methods/send_poll.py b/aiogram/methods/send_poll.py index eab1b656..d44fbb83 100644 --- a/aiogram/methods/send_poll.py +++ b/aiogram/methods/send_poll.py @@ -35,6 +35,8 @@ class SendPoll(TelegramMethod[Message]): """Poll question, 1-300 characters""" options: List[str] """A JSON-serialized list of answer options, 2-10 strings 1-100 characters each""" + 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""" is_anonymous: Optional[bool] = None @@ -66,7 +68,7 @@ class SendPoll(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -90,6 +92,7 @@ class SendPoll(TelegramMethod[Message]): chat_id: Union[int, str], question: str, options: List[str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, is_anonymous: Optional[bool] = None, type: Optional[str] = None, @@ -119,6 +122,7 @@ class SendPoll(TelegramMethod[Message]): chat_id=chat_id, question=question, options=options, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, is_anonymous=is_anonymous, type=type, diff --git a/aiogram/methods/send_sticker.py b/aiogram/methods/send_sticker.py index a29bc770..63bdcb33 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 @@ -44,7 +46,7 @@ class SendSticker(TelegramMethod[Message]): 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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -67,6 +69,7 @@ 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, @@ -86,6 +89,7 @@ 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, diff --git a/aiogram/methods/send_venue.py b/aiogram/methods/send_venue.py index be9aaf44..307446ef 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 @@ -55,7 +57,7 @@ class SendVenue(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -81,6 +83,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, @@ -106,6 +109,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, diff --git a/aiogram/methods/send_video.py b/aiogram/methods/send_video.py index 89b33b4b..b3eb3179 100644 --- a/aiogram/methods/send_video.py +++ b/aiogram/methods/send_video.py @@ -33,6 +33,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 @@ -62,7 +64,7 @@ class SendVideo(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -85,6 +87,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, @@ -112,6 +115,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, diff --git a/aiogram/methods/send_video_note.py b/aiogram/methods/send_video_note.py index 0b31a348..b4573fea 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 @@ -48,7 +50,7 @@ class SendVideoNote(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -71,6 +73,7 @@ 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, @@ -92,6 +95,7 @@ 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, diff --git a/aiogram/methods/send_voice.py b/aiogram/methods/send_voice.py index 65dccc6a..1e981c96 100644 --- a/aiogram/methods/send_voice.py +++ b/aiogram/methods/send_voice.py @@ -33,6 +33,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 @@ -52,7 +54,7 @@ class SendVoice(TelegramMethod[Message]): 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. Not supported for messages sent on behalf of a business account""" allow_sending_without_reply: Optional[bool] = Field( None, json_schema_extra={"deprecated": True} ) @@ -75,6 +77,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"), @@ -97,6 +100,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, 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..184239e9 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -3,6 +3,7 @@ from typing import List, Literal, Optional, Union from .animation import Animation from .audio import Audio 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,6 +18,12 @@ 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 @@ -165,6 +172,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 +204,7 @@ from .write_access_allowed import WriteAccessAllowed __all__ = ( "Animation", "Audio", + "Birthdate", "BotCommand", "BotCommandScope", "BotCommandScopeAllChatAdministrators", @@ -209,6 +218,12 @@ __all__ = ( "BotName", "BotShortDescription", "BufferedInputFile", + "BusinessConnection", + "BusinessIntro", + "BusinessLocation", + "BusinessMessagesDeleted", + "BusinessOpeningHours", + "BusinessOpeningHoursInterval", "CallbackGame", "CallbackQuery", "Chat", @@ -357,6 +372,7 @@ __all__ = ( "ReplyParameters", "ResponseParameters", "SentWebAppMessage", + "SharedUser", "ShippingAddress", "ShippingOption", "ShippingQuery", diff --git a/aiogram/types/birthdate.py b/aiogram/types/birthdate.py new file mode 100644 index 00000000..ccb29889 --- /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): + """ + + + 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/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..bd71c3c3 --- /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): + """ + + + 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..549335be --- /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): + """ + + + 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..5313e2a8 --- /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] + """A JSON-serialized 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..ab1a6b66 --- /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): + """ + + + 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..5968976a --- /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): + """ + + + 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..261c6e40 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -37,6 +37,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 @@ -71,6 +75,16 @@ class Chat(TelegramObject): """*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`.""" + birthdate: Optional[Birthdate] = None + """*Optional*. For private chats, the date of birth of the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + business_intro: Optional[BusinessIntro] = None + """*Optional*. For private chats with business accounts, the intro of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + business_location: Optional[BusinessLocation] = None + """*Optional*. For private chats with business accounts, the location of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + business_opening_hours: Optional[BusinessOpeningHours] = None + """*Optional*. For private chats with business accounts, the opening hours of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + personal_chat: Optional[Chat] = None + """*Optional*. For private chats, the personal channel of the user. 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 @@ -144,6 +158,11 @@ class Chat(TelegramObject): 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, @@ -190,6 +209,11 @@ class Chat(TelegramObject): 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, accent_color_id=accent_color_id, background_custom_emoji_id=background_custom_emoji_id, @@ -522,6 +546,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 +565,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 +577,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) @@ -884,10 +911,10 @@ class Chat(TelegramObject): :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_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..d2347906 100644 --- a/aiogram/types/chat_administrator_rights.py +++ b/aiogram/types/chat_administrator_rights.py @@ -38,13 +38,13 @@ class ChatAdministratorRights(TelegramObject): 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_join_request.py b/aiogram/types/chat_join_request.py index 074bcc45..d2144dad 100644 --- a/aiogram/types/chat_join_request.py +++ b/aiogram/types/chat_join_request.py @@ -157,6 +157,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, @@ -187,6 +188,7 @@ 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* @@ -194,7 +196,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +210,7 @@ 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, @@ -225,6 +228,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, @@ -255,6 +259,7 @@ 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* @@ -262,7 +267,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +281,7 @@ 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, @@ -293,6 +299,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, @@ -323,6 +330,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 @@ -335,7 +343,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +356,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, @@ -369,6 +378,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, @@ -399,6 +409,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 @@ -411,7 +422,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +435,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, @@ -445,6 +457,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"), @@ -475,6 +488,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. @@ -486,7 +500,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +513,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, @@ -519,6 +534,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"), @@ -549,6 +565,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. @@ -560,7 +577,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +590,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, @@ -594,6 +612,7 @@ 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, @@ -619,13 +638,14 @@ 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 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. Not supported for messages sent on behalf of a business account :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,6 +659,7 @@ 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, @@ -655,6 +676,7 @@ 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, @@ -680,13 +702,14 @@ 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 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. Not supported for messages sent on behalf of a business account :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,6 +723,7 @@ 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, @@ -715,6 +739,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, @@ -742,6 +767,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 @@ -751,7 +777,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +790,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, @@ -782,6 +809,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, @@ -809,6 +837,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 @@ -818,7 +847,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +860,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, @@ -849,6 +879,7 @@ 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"), @@ -869,11 +900,12 @@ 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 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 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. Not supported for messages sent on behalf of a business account. :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_game.SendGame` @@ -886,6 +918,7 @@ 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, @@ -899,6 +932,7 @@ 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"), @@ -919,11 +953,12 @@ 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 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 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. Not supported for messages sent on behalf of a business account. :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_game.SendGame` @@ -936,6 +971,7 @@ 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, @@ -1170,6 +1206,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, @@ -1197,6 +1234,7 @@ 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. @@ -1205,7 +1243,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1257,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, @@ -1237,6 +1276,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, @@ -1264,6 +1304,7 @@ 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. @@ -1272,7 +1313,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1327,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, @@ -1303,6 +1345,7 @@ 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"), @@ -1322,6 +1365,7 @@ 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 @@ -1338,6 +1382,7 @@ 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, @@ -1350,6 +1395,7 @@ 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"), @@ -1369,6 +1415,7 @@ 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 @@ -1385,6 +1432,7 @@ 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, @@ -1397,6 +1445,7 @@ 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"), @@ -1423,6 +1472,7 @@ 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. @@ -1431,7 +1481,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +1494,7 @@ 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, @@ -1461,6 +1512,7 @@ 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"), @@ -1487,6 +1539,7 @@ 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. @@ -1495,7 +1548,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +1561,7 @@ 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, @@ -1526,6 +1580,7 @@ class ChatJoinRequest(TelegramObject): self, question: str, options: List[str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, is_anonymous: Optional[bool] = None, type: Optional[str] = None, @@ -1559,6 +1614,7 @@ class ChatJoinRequest(TelegramObject): :param question: Poll question, 1-300 characters :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each + :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 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' @@ -1573,7 +1629,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +1643,7 @@ class ChatJoinRequest(TelegramObject): chat_id=self.chat.id, question=question, options=options, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, is_anonymous=is_anonymous, type=type, @@ -1611,6 +1668,7 @@ class ChatJoinRequest(TelegramObject): self, question: str, options: List[str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, is_anonymous: Optional[bool] = None, type: Optional[str] = None, @@ -1644,6 +1702,7 @@ class ChatJoinRequest(TelegramObject): :param question: Poll question, 1-300 characters :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each + :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 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' @@ -1658,7 +1717,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +1731,7 @@ 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, is_anonymous=is_anonymous, type=type, @@ -1694,6 +1754,7 @@ 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, @@ -1716,12 +1777,13 @@ 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 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. Not supported for messages sent on behalf of a business account :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,6 +1795,7 @@ 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, @@ -1746,6 +1809,7 @@ 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, @@ -1768,12 +1832,13 @@ 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 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. Not supported for messages sent on behalf of a business account :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,6 +1850,7 @@ 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, @@ -1799,6 +1865,7 @@ 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, @@ -1821,13 +1888,14 @@ 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 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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. :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,6 +1908,7 @@ 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, @@ -1854,6 +1923,7 @@ 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, @@ -1876,13 +1946,14 @@ 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 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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. :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,6 +1966,7 @@ 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, @@ -1912,6 +1984,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, @@ -1941,6 +2014,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'.) @@ -1949,7 +2023,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2039,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, @@ -1985,6 +2060,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, @@ -2014,6 +2090,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'.) @@ -2022,7 +2099,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2115,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, @@ -2055,6 +2133,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, @@ -2086,6 +2165,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 @@ -2099,7 +2179,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2192,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, @@ -2134,6 +2215,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, @@ -2165,6 +2247,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 @@ -2178,7 +2261,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2274,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, @@ -2213,6 +2297,7 @@ 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, @@ -2238,6 +2323,7 @@ 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 @@ -2245,7 +2331,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +2344,7 @@ 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, @@ -2274,6 +2361,7 @@ 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, @@ -2299,6 +2387,7 @@ 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 @@ -2306,7 +2395,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +2408,7 @@ 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, @@ -2335,6 +2425,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"), @@ -2361,6 +2452,7 @@ class ChatJoinRequest(TelegramObject): 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. @@ -2369,7 +2461,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2474,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, @@ -2399,6 +2492,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"), @@ -2425,6 +2519,7 @@ class ChatJoinRequest(TelegramObject): 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. @@ -2433,7 +2528,7 @@ class ChatJoinRequest(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2541,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, diff --git a/aiogram/types/chat_member_administrator.py b/aiogram/types/chat_member_administrator.py index d135bc20..62667a01 100644 --- a/aiogram/types/chat_member_administrator.py +++ b/aiogram/types/chat_member_administrator.py @@ -45,13 +45,13 @@ class ChatMemberAdministrator(ChatMember): 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..dbac44b9 100644 --- a/aiogram/types/chat_member_updated.py +++ b/aiogram/types/chat_member_updated.py @@ -137,6 +137,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, @@ -167,6 +168,7 @@ 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* @@ -174,7 +176,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +190,7 @@ 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, @@ -205,6 +208,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, @@ -235,6 +239,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 @@ -247,7 +252,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +265,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, @@ -281,6 +287,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"), @@ -311,6 +318,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. @@ -322,7 +330,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +343,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, @@ -356,6 +365,7 @@ 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, @@ -381,13 +391,14 @@ 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 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. Not supported for messages sent on behalf of a business account :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,6 +412,7 @@ 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, @@ -416,6 +428,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, @@ -443,6 +456,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 @@ -452,7 +466,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +479,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, @@ -483,6 +498,7 @@ 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"), @@ -503,11 +519,12 @@ 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 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 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. Not supported for messages sent on behalf of a business account. :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_game.SendGame` @@ -520,6 +537,7 @@ 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, @@ -644,6 +662,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, @@ -671,6 +690,7 @@ 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. @@ -679,7 +699,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +713,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, @@ -710,6 +731,7 @@ 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"), @@ -729,6 +751,7 @@ 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 @@ -745,6 +768,7 @@ 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, @@ -757,6 +781,7 @@ 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"), @@ -783,6 +808,7 @@ 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. @@ -791,7 +817,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +830,7 @@ 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, @@ -822,6 +849,7 @@ class ChatMemberUpdated(TelegramObject): self, question: str, options: List[str], + business_connection_id: Optional[str] = None, message_thread_id: Optional[int] = None, is_anonymous: Optional[bool] = None, type: Optional[str] = None, @@ -855,6 +883,7 @@ class ChatMemberUpdated(TelegramObject): :param question: Poll question, 1-300 characters :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each + :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 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' @@ -869,7 +898,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +912,7 @@ class ChatMemberUpdated(TelegramObject): chat_id=self.chat.id, question=question, options=options, + business_connection_id=business_connection_id, message_thread_id=message_thread_id, is_anonymous=is_anonymous, type=type, @@ -905,6 +935,7 @@ 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, @@ -927,12 +958,13 @@ 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 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. Not supported for messages sent on behalf of a business account :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,6 +976,7 @@ 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, @@ -958,6 +991,7 @@ 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, @@ -980,13 +1014,14 @@ 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 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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. :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,6 +1034,7 @@ 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, @@ -1016,6 +1052,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, @@ -1045,6 +1082,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'.) @@ -1053,7 +1091,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1107,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, @@ -1086,6 +1125,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, @@ -1117,6 +1157,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 @@ -1130,7 +1171,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1184,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, @@ -1165,6 +1207,7 @@ 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, @@ -1190,6 +1233,7 @@ 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 @@ -1197,7 +1241,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +1254,7 @@ 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, @@ -1226,6 +1271,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"), @@ -1252,6 +1298,7 @@ class ChatMemberUpdated(TelegramObject): 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. @@ -1260,7 +1307,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1320,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, 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/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_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/keyboard_button_request_chat.py b/aiogram/types/keyboard_button_request_chat.py index 24caf635..7494cf11 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 сhat 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..28b7fae6 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 name""" + request_username: Optional[bool] = None + """*Optional*. Pass :code:`True` to request the users' username""" + request_photo: Optional[bool] = None + """*Optional*. Pass :code:`True` to request the users' photo""" 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..261489dc 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -3,7 +3,7 @@ from __future__ import annotations import datetime from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union -from pydantic import Field +from pydantic import Field, computed_field from aiogram.utils.text_decorations import ( TextDecoration, @@ -96,6 +96,7 @@ if TYPE_CHECKING: from .reply_keyboard_markup import ReplyKeyboardMarkup from .reply_keyboard_remove import ReplyKeyboardRemove from .reply_parameters import ReplyParameters + from .shared_user import SharedUser from .sticker import Sticker from .story import Story from .successful_payment import SuccessfulPayment @@ -136,6 +137,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 +163,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 @@ -328,6 +335,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,6 +354,7 @@ 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, @@ -426,6 +436,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,6 +448,7 @@ 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, @@ -610,8 +623,6 @@ 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.boost_added: @@ -658,6 +669,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. @@ -676,7 +688,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +704,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, @@ -737,6 +750,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. @@ -754,7 +768,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +785,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, @@ -814,6 +829,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. @@ -832,7 +848,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +864,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, @@ -891,6 +908,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. @@ -908,7 +926,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +943,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, @@ -963,6 +982,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. @@ -976,7 +996,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1012,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, @@ -1027,6 +1048,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. @@ -1039,7 +1061,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +1078,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, phone_number=phone_number, first_name=first_name, last_name=last_name, @@ -1092,6 +1115,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. @@ -1107,7 +1131,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1147,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, @@ -1162,6 +1187,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. @@ -1176,7 +1202,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1219,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, @@ -1224,6 +1251,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. @@ -1234,7 +1262,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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: 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 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. Not supported for messages sent on behalf of a business account. :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_game.SendGame` """ @@ -1250,6 +1278,7 @@ 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, @@ -1277,6 +1306,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. @@ -1286,7 +1316,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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: 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 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. Not supported for messages sent on behalf of a business account. :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_game.SendGame` @@ -1303,6 +1333,7 @@ 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, @@ -1349,6 +1380,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. @@ -1395,6 +1427,7 @@ 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, @@ -1462,6 +1495,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. @@ -1508,6 +1542,7 @@ 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, @@ -1561,6 +1596,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. @@ -1576,7 +1612,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1628,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, @@ -1631,6 +1668,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. @@ -1645,7 +1683,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1700,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, @@ -1692,6 +1731,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. @@ -1717,6 +1757,7 @@ 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, @@ -1742,6 +1783,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. @@ -1767,6 +1809,7 @@ 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, @@ -1802,6 +1845,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. @@ -1815,7 +1859,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +1876,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, @@ -1873,6 +1918,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. @@ -1885,7 +1931,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +1949,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, text=text, parse_mode=parse_mode, entities=entities, @@ -1939,6 +1986,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. @@ -1953,7 +2001,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +2017,7 @@ 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, @@ -2006,6 +2055,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. @@ -2019,7 +2069,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +2086,7 @@ 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, @@ -2079,6 +2130,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. @@ -2100,7 +2152,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +2168,7 @@ 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, @@ -2167,6 +2220,7 @@ 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. @@ -2187,7 +2241,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +2258,7 @@ 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, is_anonymous=is_anonymous, @@ -2243,6 +2298,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. @@ -2253,7 +2309,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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 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. Not supported for messages sent on behalf of a business account :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,6 +2325,7 @@ 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, @@ -2298,6 +2355,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. @@ -2307,7 +2365,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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 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. Not supported for messages sent on behalf of a business account :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,6 +2382,7 @@ 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, @@ -2353,18 +2412,19 @@ 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 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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. :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,6 +2440,7 @@ 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, @@ -2411,17 +2472,18 @@ 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 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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. :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,6 +2500,7 @@ 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, @@ -2474,6 +2537,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. @@ -2491,7 +2555,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2571,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, @@ -2550,6 +2615,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. @@ -2566,7 +2632,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2649,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, @@ -2627,6 +2694,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. @@ -2646,7 +2714,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2730,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, @@ -2709,6 +2778,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. @@ -2727,7 +2797,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2814,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, @@ -2784,6 +2855,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. @@ -2797,7 +2869,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +2885,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, @@ -2848,6 +2921,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. @@ -2860,7 +2934,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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,6 +2951,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, video_note=video_note, duration=duration, length=length, @@ -2912,6 +2987,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 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. @@ -2926,7 +3002,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +3018,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, @@ -2979,6 +3056,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 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. @@ -2992,7 +3070,7 @@ class Message(MaybeInaccessibleMessage): :param disable_notification: 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. Not supported for messages sent on behalf of a business account :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 +3087,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, @@ -3032,6 +3111,7 @@ 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, ) -> Union[ ForwardMessage, @@ -3096,6 +3176,7 @@ 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 @@ -3784,7 +3865,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/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..da157824 --- /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_user.KeyboardButtonRequestUser` 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/update.py b/aiogram/types/update.py index d7686593..57ef2df5 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 non-service 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/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/index.rst b/docs/api/methods/index.rst index 1258e783..3eda4ce7 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 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/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/index.rst b/docs/api/types/index.rst index 62bae4b3..1a0b9ee5 100644 --- a/docs/api/types/index.rst +++ b/docs/api/types/index.rst @@ -13,6 +13,7 @@ Available types animation audio + birthdate bot_command bot_command_scope bot_command_scope_all_chat_administrators @@ -25,6 +26,12 @@ 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 @@ -114,6 +121,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/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/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_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..a17228b4 100644 --- a/tests/test_api/test_types/test_message.py +++ b/tests/test_api/test_types/test_message.py @@ -71,6 +71,7 @@ from aiogram.types import ( PollOption, ProximityAlertTriggered, ReactionTypeCustomEmoji, + SharedUser, Sticker, Story, SuccessfulPayment, @@ -469,7 +470,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 +486,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 +526,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 +544,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( @@ -625,7 +616,6 @@ 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], @@ -674,7 +664,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], diff --git a/tests/test_dispatcher/test_dispatcher.py b/tests/test_dispatcher/test_dispatcher.py index ccac7c1e..56a44e6f 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( 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_redis.py b/tests/test_fsm/storage/test_redis.py index adca384a..18c143e3 100644 --- a/tests/test_fsm/storage/test_redis.py +++ b/tests/test_fsm/storage/test_redis.py @@ -12,26 +12,62 @@ BOT_ID = 42 CHAT_ID = -1 USER_ID = 2 THREAD_ID = 3 +BUSINESS_CONNECTION_ID = "4" FIELD = "data" class TestRedisDefaultKeyBuilder: @pytest.mark.parametrize( - "with_bot_id,with_destiny,result", + "key_builder,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}"], + [ + DefaultKeyBuilder( + prefix=PREFIX, + with_bot_id=True, + with_destiny=True, + with_business_connection_id=True, + ), + f"{PREFIX}:{BOT_ID}:{BUSINESS_CONNECTION_ID}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}:{FIELD}", + ], + [ + DefaultKeyBuilder(prefix=PREFIX, with_bot_id=True, with_destiny=True), + f"{PREFIX}:{BOT_ID}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}:{FIELD}", + ], + [ + DefaultKeyBuilder( + prefix=PREFIX, with_bot_id=True, with_business_connection_id=True + ), + f"{PREFIX}:{BOT_ID}:{BUSINESS_CONNECTION_ID}:{CHAT_ID}:{USER_ID}:{FIELD}", + ], + [ + DefaultKeyBuilder(prefix=PREFIX, with_bot_id=True), + f"{PREFIX}:{BOT_ID}:{CHAT_ID}:{USER_ID}:{FIELD}", + ], + [ + DefaultKeyBuilder( + prefix=PREFIX, with_destiny=True, with_business_connection_id=True + ), + f"{PREFIX}:{BUSINESS_CONNECTION_ID}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}:{FIELD}", + ], + [ + DefaultKeyBuilder(prefix=PREFIX, with_destiny=True), + f"{PREFIX}:{CHAT_ID}:{USER_ID}:{DEFAULT_DESTINY}:{FIELD}", + ], + [ + DefaultKeyBuilder(prefix=PREFIX, with_business_connection_id=True), + f"{PREFIX}:{BUSINESS_CONNECTION_ID}:{CHAT_ID}:{USER_ID}:{FIELD}", + ], + [DefaultKeyBuilder(prefix=PREFIX), f"{PREFIX}:{CHAT_ID}:{USER_ID}:{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, + async def test_generate_key(self, key_builder: DefaultKeyBuilder, 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, ) - 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):