Added full support of Bot API 7.2 (#1444)

* Added base support of Bot API 7.2

* Added base support of Bot API 7.2

* Fixing tests and content types for Telegram Bot API 7.2 update (#1453)

* Fixing tests and content types for Telegram Bot API 7.2

* Adding changelog for 1453 PR

* Fixes + coverage

* Replace `BusinessConnection.date` type

* Reformat code

* Refactor UserContextMiddleware to use EventContext class

This update significantly refactors UserContextMiddleware to leverage a new class, EventContext. Instead of resolving event context as a tuple, it now produces an instance of EventContext. Additional adjustments include supporting a business connection ID for event context identification and facilitating backwards compatibility. Tests and other files were also updated accordingly for these changes.

* Cover FSM key builder (business_connection_id

* Added changelog

---------

Co-authored-by: RoLOQ <roman.fedunn@gmail.com>
This commit is contained in:
Alex Root Junior 2024-04-22 13:48:49 +03:00 committed by GitHub
parent 5f157beb26
commit 057478621b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
147 changed files with 3509 additions and 651 deletions

View file

@ -1 +1 @@
7.1 7.2

View file

@ -37,3 +37,7 @@ extract:
- link_preview_options - link_preview_options
- sender_boost_count - sender_boost_count
- reply_to_story - reply_to_story
- business_connection_id
- sender_business_bot
- is_from_offline
- has_media_spoiler

View file

@ -7,9 +7,9 @@
"object": { "object": {
"anchor": "addstickertoset", "anchor": "addstickertoset",
"name": "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.", "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": "<p>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 <em>True</em> on success.</p>", "html_description": "<p>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 <em>True</em> on success.</p>",
"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.", "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": [ "annotations": [
{ {
"type": "Integer", "type": "Integer",

View file

@ -38,9 +38,9 @@
{ {
"type": "Array of Integer", "type": "Array of Integer",
"required": true, "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.", "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": "<td>Identifiers of 1-100 messages in the chat <em>from_chat_id</em> to copy. The identifiers must be specified in a strictly increasing order.</td>", "html_description": "<td>A JSON-serialized list of 1-100 identifiers of messages in the chat <em>from_chat_id</em> to copy. The identifiers must be specified in a strictly increasing order.</td>",
"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", "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" "name": "message_ids"
}, },
{ {

View file

@ -43,14 +43,6 @@
"rst_description": "A JSON-serialized list of 1-50 initial stickers to be added to the sticker set\n", "rst_description": "A JSON-serialized list of 1-50 initial stickers to be added to the sticker set\n",
"name": "stickers" "name": "stickers"
}, },
{
"type": "String",
"required": true,
"description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'",
"html_description": "<td>Format of stickers in the set, must be one of &#8220;static&#8221;, &#8220;animated&#8221;, &#8220;video&#8221;</td>",
"rst_description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'\n",
"name": "sticker_format"
},
{ {
"type": "String", "type": "String",
"required": false, "required": false,
@ -66,6 +58,18 @@
"html_description": "<td>Pass <em>True</em> 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</td>", "html_description": "<td>Pass <em>True</em> 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</td>",
"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", "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" "name": "needs_repainting"
},
{
"type": "String",
"required": false,
"description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'",
"html_description": "<td>Format of stickers in the set, must be one of &#8220;static&#8221;, &#8220;animated&#8221;, &#8220;video&#8221;</td>",
"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" "category": "methods"

View file

@ -22,9 +22,9 @@
{ {
"type": "Array of Integer", "type": "Array of Integer",
"required": true, "required": true,
"description": "Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted", "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": "<td>Identifiers of 1-100 messages to delete. See <a href=\"#deletemessage\">deleteMessage</a> for limitations on which messages can be deleted</td>", "html_description": "<td>A JSON-serialized list of 1-100 identifiers of messages to delete. See <a href=\"#deletemessage\">deleteMessage</a> for limitations on which messages can be deleted</td>",
"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", "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" "name": "message_ids"
} }
], ],

View file

@ -38,9 +38,9 @@
{ {
"type": "Array of Integer", "type": "Array of Integer",
"required": true, "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.", "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": "<td>Identifiers of 1-100 messages in the chat <em>from_chat_id</em> to forward. The identifiers must be specified in a strictly increasing order.</td>", "html_description": "<td>A JSON-serialized list of 1-100 identifiers of messages in the chat <em>from_chat_id</em> to forward. The identifiers must be specified in a strictly increasing order.</td>",
"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", "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" "name": "message_ids"
}, },
{ {

View file

@ -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": "<p>Use this method to get information about the connection of the bot with a business account. Returns a <a href=\"#businessconnection\">BusinessConnection</a> object on success.</p>",
"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": "<td>Unique identifier of the business connection</td>",
"rst_description": "Unique identifier of the business connection\n",
"name": "business_connection_id"
}
],
"category": "methods"
}
}

View file

@ -14,9 +14,9 @@
{ {
"type": "Array of String", "type": "Array of String",
"required": true, "required": true,
"description": "List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.", "description": "A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.",
"html_description": "<td>List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.</td>", "html_description": "<td>A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.</td>",
"rst_description": "List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.\n", "rst_description": "A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.\n",
"name": "custom_emoji_ids" "name": "custom_emoji_ids"
} }
], ],

View file

@ -118,33 +118,33 @@
{ {
"type": "Boolean", "type": "Boolean",
"required": false, "required": false,
"description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", "description": "Pass True if the administrator can post messages in the channel, or access channel statistics; for channels only",
"html_description": "<td>Pass <em>True</em> if the administrator can post messages in the channel, or access channel statistics; channels only</td>", "html_description": "<td>Pass <em>True</em> if the administrator can post messages in the channel, or access channel statistics; for channels only</td>",
"rst_description": "Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; channels only\n", "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" "name": "can_post_messages"
}, },
{ {
"type": "Boolean", "type": "Boolean",
"required": false, "required": false,
"description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", "description": "Pass True if the administrator can edit messages of other users and can pin messages; for channels only",
"html_description": "<td>Pass <em>True</em> if the administrator can edit messages of other users and can pin messages; channels only</td>", "html_description": "<td>Pass <em>True</em> if the administrator can edit messages of other users and can pin messages; for channels only</td>",
"rst_description": "Pass :code:`True` if the administrator can edit messages of other users and can pin messages; channels only\n", "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" "name": "can_edit_messages"
}, },
{ {
"type": "Boolean", "type": "Boolean",
"required": false, "required": false,
"description": "Pass True if the administrator can pin messages, supergroups only", "description": "Pass True if the administrator can pin messages; for supergroups only",
"html_description": "<td>Pass <em>True</em> if the administrator can pin messages, supergroups only</td>", "html_description": "<td>Pass <em>True</em> if the administrator can pin messages; for supergroups only</td>",
"rst_description": "Pass :code:`True` if the administrator can pin messages, supergroups only\n", "rst_description": "Pass :code:`True` if the administrator can pin messages; for supergroups only\n",
"name": "can_pin_messages" "name": "can_pin_messages"
}, },
{ {
"type": "Boolean", "type": "Boolean",
"required": false, "required": false,
"description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only", "description": "Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only",
"html_description": "<td>Pass <em>True</em> if the user is allowed to create, rename, close, and reopen forum topics, supergroups only</td>", "html_description": "<td>Pass <em>True</em> if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only</td>",
"rst_description": "Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only\n", "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" "name": "can_manage_topics"
} }
], ],

View file

@ -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": "<p>Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling <a href=\"#deletestickerfromset\">deleteStickerFromSet</a>, then <a href=\"#addstickertoset\">addStickerToSet</a>, then <a href=\"#setstickerpositioninset\">setStickerPositionInSet</a>. Returns <em>True</em> on success.</p>",
"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": "<td>User identifier of the sticker set owner</td>",
"rst_description": "User identifier of the sticker set owner\n",
"name": "user_id"
},
{
"type": "String",
"required": true,
"description": "Sticker set name",
"html_description": "<td>Sticker set name</td>",
"rst_description": "Sticker set name\n",
"name": "name"
},
{
"type": "String",
"required": true,
"description": "File identifier of the replaced sticker",
"html_description": "<td>File identifier of the replaced sticker</td>",
"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": "<td>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.</td>",
"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"
}
}

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent <a href=\"#message\">Message</a> is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.</p>", "html_description": "<p>Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent <a href=\"#message\">Message</a> is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.</p>",
"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.", "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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -126,9 +134,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>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 <a href=\"#message\">Message</a> is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.</p><p>For sending voice messages, use the <a href=\"#sendvoice\">sendVoice</a> method instead.</p>", "html_description": "<p>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 <a href=\"#message\">Message</a> is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.</p><p>For sending voice messages, use the <a href=\"#sendvoice\">sendVoice</a> method instead.</p>",
"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.", "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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -118,9 +126,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>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 <em>True</em> on success.</p><blockquote>\n<p>Example: The <a href=\"https://t.me/imagebot\">ImageBot</a> needs some time to process a request and upload the image. Instead of sending a text message along the lines of &#8220;Retrieving image, please wait&#8230;&#8221;, the bot may use <a href=\"#sendchataction\">sendChatAction</a> with <em>action</em> = <em>upload_photo</em>. The user will see a &#8220;sending photo&#8221; status for the bot.</p>\n</blockquote><p>We only recommend using this method when a response from the bot will take a <strong>noticeable</strong> amount of time to arrive.</p>", "html_description": "<p>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 <em>True</em> on success.</p><blockquote>\n<p>Example: The <a href=\"https://t.me/imagebot\">ImageBot</a> needs some time to process a request and upload the image. Instead of sending a text message along the lines of &#8220;Retrieving image, please wait&#8230;&#8221;, the bot may use <a href=\"#sendchataction\">sendChatAction</a> with <em>action</em> = <em>upload_photo</em>. The user will see a &#8220;sending photo&#8221; status for the bot.</p>\n</blockquote><p>We only recommend using this method when a response from the bot will take a <strong>noticeable</strong> amount of time to arrive.</p>",
"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 <https://t.me/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.", "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 <https://t.me/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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the action will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the action will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -22,9 +30,9 @@
{ {
"type": "Integer", "type": "Integer",
"required": false, "required": false,
"description": "Unique identifier for the target message thread; supergroups only", "description": "Unique identifier for the target message thread; for supergroups only",
"html_description": "<td>Unique identifier for the target message thread; supergroups only</td>", "html_description": "<td>Unique identifier for the target message thread; for supergroups only</td>",
"rst_description": "Unique identifier for the target message thread; supergroups only\n", "rst_description": "Unique identifier for the target message thread; for supergroups only\n",
"name": "message_thread_id" "name": "message_thread_id"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send phone contacts. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>Use this method to send phone contacts. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"rst_description": "Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned.", "rst_description": "Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned.",
"annotations": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -86,9 +94,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send an animated emoji that will display a random value. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>Use this method to send an animated emoji that will display a random value. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"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.", "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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -62,9 +70,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send general files. On success, the sent <a href=\"#message\">Message</a> 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.</p>", "html_description": "<p>Use this method to send general files. On success, the sent <a href=\"#message\">Message</a> 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.</p>",
"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.", "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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -102,9 +110,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send a game. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>Use this method to send a game. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"rst_description": "Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned.", "rst_description": "Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned.",
"annotations": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n",
"name": "business_connection_id"
},
{ {
"type": "Integer", "type": "Integer",
"required": true, "required": true,
@ -62,9 +70,9 @@
{ {
"type": "InlineKeyboardMarkup", "type": "InlineKeyboardMarkup",
"required": false, "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.", "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": "<td>A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.</td>", "html_description": "<td>A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>. 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.</td>",
"rst_description": "A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.\n", "rst_description": "A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send point on the map. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>Use this method to send point on the map. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"rst_description": "Use this method to send point on the map. On success, the sent :class:`aiogram.types.message.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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -102,9 +110,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>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 <a href=\"#message\">Messages</a> that were sent is returned.</p>", "html_description": "<p>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 <a href=\"#message\">Messages</a> that were sent is returned.</p>",
"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 <https://core.telegram.org/bots/api#message>`_ 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 <https://core.telegram.org/bots/api#message>`_ that were sent is returned.",
"annotations": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send text messages. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>Use this method to send text messages. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"rst_description": "Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned.", "rst_description": "Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned.",
"annotations": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -86,9 +94,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send photos. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>Use this method to send photos. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"rst_description": "Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned.", "rst_description": "Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned.",
"annotations": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -94,9 +102,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send a native poll. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>Use this method to send a native poll. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"rst_description": "Use this method to send a native poll. On success, the sent :class:`aiogram.types.message.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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -150,9 +158,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send static .WEBP, <a href=\"https://telegram.org/blog/animated-stickers\">animated</a> .TGS, or <a href=\"https://telegram.org/blog/video-stickers-better-reactions\">video</a> .WEBM stickers. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>Use this method to send static .WEBP, <a href=\"https://telegram.org/blog/animated-stickers\">animated</a> .TGS, or <a href=\"https://telegram.org/blog/video-stickers-better-reactions\">video</a> .WEBM stickers. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"rst_description": "Use this method to send static .WEBP, `animated <https://telegram.org/blog/animated-stickers>`_ .TGS, or `video <https://telegram.org/blog/video-stickers-better-reactions>`_ .WEBM stickers. On success, the sent :class:`aiogram.types.message.Message` is returned.", "rst_description": "Use this method to send static .WEBP, `animated <https://telegram.org/blog/animated-stickers>`_ .TGS, or `video <https://telegram.org/blog/video-stickers-better-reactions>`_ .WEBM stickers. On success, the sent :class:`aiogram.types.message.Message` is returned.",
"annotations": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -30,9 +38,9 @@
{ {
"type": "InputFile or String", "type": "InputFile or String",
"required": true, "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.", "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": "<td>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. <a href=\"#sending-files\">More information on Sending Files &#187;</a>. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.</td>", "html_description": "<td>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. <a href=\"#sending-files\">More information on Sending Files &#187;</a>. Video and animated stickers can't be sent via an HTTP URL.</td>",
"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 » <sending-files>`. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.\n", "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 » <sending-files>`. Video and animated stickers can't be sent via an HTTP URL.\n",
"name": "sticker" "name": "sticker"
}, },
{ {
@ -70,9 +78,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send information about a venue. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>Use this method to send information about a venue. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"rst_description": "Use this method to send information about a venue. On success, the sent :class:`aiogram.types.message.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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -118,9 +126,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as <a href=\"#document\">Document</a>). On success, the sent <a href=\"#message\">Message</a> is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.</p>", "html_description": "<p>Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as <a href=\"#document\">Document</a>). On success, the sent <a href=\"#message\">Message</a> is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.</p>",
"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.", "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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -134,9 +142,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>As of <a href=\"https://telegram.org/blog/video-messages-and-telescope\">v.4.0</a>, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent <a href=\"#message\">Message</a> is returned.</p>", "html_description": "<p>As of <a href=\"https://telegram.org/blog/video-messages-and-telescope\">v.4.0</a>, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
"rst_description": "As of `v.4.0 <https://telegram.org/blog/video-messages-and-telescope>`_, 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.", "rst_description": "As of `v.4.0 <https://telegram.org/blog/video-messages-and-telescope>`_, 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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -86,9 +94,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -11,6 +11,14 @@
"html_description": "<p>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 <a href=\"#audio\">Audio</a> or <a href=\"#document\">Document</a>). On success, the sent <a href=\"#message\">Message</a> is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.</p>", "html_description": "<p>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 <a href=\"#audio\">Audio</a> or <a href=\"#document\">Document</a>). On success, the sent <a href=\"#message\">Message</a> is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.</p>",
"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.", "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": [ "annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
"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", "type": "Integer or String",
"required": true, "required": true,
@ -94,9 +102,9 @@
{ {
"type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply",
"required": false, "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.", "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": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>", "html_description": "<td>Additional interface options. A JSON-serialized object for an <a href=\"/bots/features#inline-keyboards\">inline keyboard</a>, <a href=\"/bots/features#keyboards\">custom reply keyboard</a>, 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</td>",
"rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.\n", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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" "name": "reply_markup"
}, },
{ {

View file

@ -30,9 +30,9 @@
{ {
"type": "Array of ReactionType", "type": "Array of ReactionType",
"required": false, "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.", "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": "<td>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.</td>", "html_description": "<td>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.</td>",
"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", "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" "name": "reaction"
}, },
{ {

View file

@ -34,6 +34,14 @@
"html_description": "<td>A <strong>.WEBP</strong> or <strong>.PNG</strong> image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a <strong>.TGS</strong> animation with a thumbnail up to 32 kilobytes in size (see <a href=\"/stickers#animated-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#animated-sticker-requirements\">https://core.telegram.org/stickers#animated-sticker-requirements</a> for animated sticker technical requirements), or a <strong>WEBM</strong> video with the thumbnail up to 32 kilobytes in size; see <a href=\"/stickers#video-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#video-sticker-requirements\">https://core.telegram.org/stickers#video-sticker-requirements</a> for video sticker technical requirements. Pass a <em>file_id</em> 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. <a href=\"#sending-files\">More information on Sending Files &#187;</a>. 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.</td>", "html_description": "<td>A <strong>.WEBP</strong> or <strong>.PNG</strong> image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a <strong>.TGS</strong> animation with a thumbnail up to 32 kilobytes in size (see <a href=\"/stickers#animated-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#animated-sticker-requirements\">https://core.telegram.org/stickers#animated-sticker-requirements</a> for animated sticker technical requirements), or a <strong>WEBM</strong> video with the thumbnail up to 32 kilobytes in size; see <a href=\"/stickers#video-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#video-sticker-requirements\">https://core.telegram.org/stickers#video-sticker-requirements</a> for video sticker technical requirements. Pass a <em>file_id</em> 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. <a href=\"#sending-files\">More information on Sending Files &#187;</a>. 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.</td>",
"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>`_`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>`_`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 » <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", "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>`_`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>`_`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 » <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" "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": "<td>Format of the thumbnail, must be one of &#8220;static&#8221; for a <strong>.WEBP</strong> or <strong>.PNG</strong> image, &#8220;animated&#8221; for a <strong>.TGS</strong> animation, or &#8220;video&#8221; for a <strong>WEBM</strong> video</td>",
"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" "category": "methods"

View file

@ -7,9 +7,9 @@
"object": { "object": {
"anchor": "uploadstickerfile", "anchor": "uploadstickerfile",
"name": "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.", "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": "<p>Use this method to upload a file with a sticker for later use in the <a href=\"#createnewstickerset\">createNewStickerSet</a> and <a href=\"#addstickertoset\">addStickerToSet</a> methods (the file can be used multiple times). Returns the uploaded <a href=\"#file\">File</a> on success.</p>", "html_description": "<p>Use this method to upload a file with a sticker for later use in the <a href=\"#createnewstickerset\">createNewStickerSet</a>, <a href=\"#addstickertoset\">addStickerToSet</a>, or <a href=\"#replacestickerinset\">replaceStickerInSet</a> methods (the file can be used multiple times). Returns the uploaded <a href=\"#file\">File</a> on success.</p>",
"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.", "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": [ "annotations": [
{ {
"type": "Integer", "type": "Integer",

File diff suppressed because it is too large Load diff

View file

@ -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": "<td>Day of the user's birth; 1-31</td>",
"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": "<td>Month of the user's birth; 1-12</td>",
"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": "<td><em>Optional</em>. Year of the user's birth</td>",
"rst_description": "*Optional*. Year of the user's birth\n",
"name": "year",
"required": false
}
],
"category": "types"
}
}

View file

@ -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": "<p>Describes the connection of the bot with a business account.</p>",
"rst_description": "Describes the connection of the bot with a business account.",
"annotations": [
{
"type": "String",
"description": "Unique identifier of the business connection",
"html_description": "<td>Unique identifier of the business connection</td>",
"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": "<td>Business account user that created the business connection</td>",
"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": "<td>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.</td>",
"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": "<td>Date the connection was established in Unix time</td>",
"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": "<td>True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours</td>",
"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": "<td>True, if the connection is active</td>",
"rst_description": "True, if the connection is active\n",
"name": "is_enabled",
"required": true
}
],
"category": "types"
}
}

View file

@ -0,0 +1,5 @@
annotations:
date:
parsed_type:
type: std
name: DateTime

View file

@ -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": "<td><em>Optional</em>. Title text of the business intro</td>",
"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": "<td><em>Optional</em>. Message text of the business intro</td>",
"rst_description": "*Optional*. Message text of the business intro\n",
"name": "message",
"required": false
},
{
"type": "Sticker",
"description": "Sticker of the business intro",
"html_description": "<td><em>Optional</em>. Sticker of the business intro</td>",
"rst_description": "*Optional*. Sticker of the business intro\n",
"name": "sticker",
"required": false
}
],
"category": "types"
}
}

View file

@ -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": "<td>Address of the business</td>",
"rst_description": "Address of the business\n",
"name": "address",
"required": true
},
{
"type": "Location",
"description": "Location of the business",
"html_description": "<td><em>Optional</em>. Location of the business</td>",
"rst_description": "*Optional*. Location of the business\n",
"name": "location",
"required": false
}
],
"category": "types"
}
}

View file

@ -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": "<p>This object is received when messages are deleted from a connected business account.</p>",
"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": "<td>Unique identifier of the business connection</td>",
"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": "<td>Information about a chat in the business account. The bot may not have access to the chat or the corresponding user.</td>",
"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": "<td>A JSON-serialized list of identifiers of deleted messages in the chat of the business account</td>",
"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"
}
}

View file

@ -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": "<td>Unique name of the time zone for which the opening hours are defined</td>",
"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": "<td>List of time intervals describing business opening hours</td>",
"rst_description": "List of time intervals describing business opening hours\n",
"name": "opening_hours",
"required": true
}
],
"category": "types"
}
}

View file

@ -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": "<td>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</td>",
"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": "<td>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</td>",
"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"
}
}

View file

@ -83,6 +83,46 @@
"name": "active_usernames", "name": "active_usernames",
"required": false "required": false
}, },
{
"type": "Birthdate",
"description": "For private chats, the date of birth of the user. Returned only in getChat.",
"html_description": "<td><em>Optional</em>. For private chats, the date of birth of the user. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
"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": "<td><em>Optional</em>. For private chats with business accounts, the intro of the business. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
"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": "<td><em>Optional</em>. For private chats with business accounts, the location of the business. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
"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": "<td><em>Optional</em>. For private chats with business accounts, the opening hours of the business. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
"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": "<td><em>Optional</em>. For private chats, the personal channel of the user. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
"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", "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.", "description": "List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.",

View file

@ -101,33 +101,33 @@
}, },
{ {
"type": "Boolean", "type": "Boolean",
"description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", "description": "True, if the administrator can post messages in the channel, or access channel statistics; for channels only",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the administrator can post messages in the channel, or access channel statistics; channels only</td>", "html_description": "<td><em>Optional</em>. <em>True</em>, if the administrator can post messages in the channel, or access channel statistics; for channels only</td>",
"rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", "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", "name": "can_post_messages",
"required": false "required": false
}, },
{ {
"type": "Boolean", "type": "Boolean",
"description": "True, if the administrator can edit messages of other users and can pin messages; channels only", "description": "True, if the administrator can edit messages of other users and can pin messages; for channels only",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the administrator can edit messages of other users and can pin messages; channels only</td>", "html_description": "<td><em>Optional</em>. <em>True</em>, if the administrator can edit messages of other users and can pin messages; for channels only</td>",
"rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only\n", "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", "name": "can_edit_messages",
"required": false "required": false
}, },
{ {
"type": "Boolean", "type": "Boolean",
"description": "True, if the user is allowed to pin messages; groups and supergroups only", "description": "True, if the user is allowed to pin messages; for groups and supergroups only",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; groups and supergroups only</td>", "html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; for groups and supergroups only</td>",
"rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only\n", "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; for groups and supergroups only\n",
"name": "can_pin_messages", "name": "can_pin_messages",
"required": false "required": false
}, },
{ {
"type": "Boolean", "type": "Boolean",
"description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only</td>", "html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only</td>",
"rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only\n", "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", "name": "can_manage_topics",
"required": false "required": false
} }

View file

@ -125,33 +125,33 @@
}, },
{ {
"type": "Boolean", "type": "Boolean",
"description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", "description": "True, if the administrator can post messages in the channel, or access channel statistics; for channels only",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the administrator can post messages in the channel, or access channel statistics; channels only</td>", "html_description": "<td><em>Optional</em>. <em>True</em>, if the administrator can post messages in the channel, or access channel statistics; for channels only</td>",
"rst_description": "*Optional*. :code:`True`, if the administrator can post messages in the channel, or access channel statistics; channels only\n", "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", "name": "can_post_messages",
"required": false "required": false
}, },
{ {
"type": "Boolean", "type": "Boolean",
"description": "True, if the administrator can edit messages of other users and can pin messages; channels only", "description": "True, if the administrator can edit messages of other users and can pin messages; for channels only",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the administrator can edit messages of other users and can pin messages; channels only</td>", "html_description": "<td><em>Optional</em>. <em>True</em>, if the administrator can edit messages of other users and can pin messages; for channels only</td>",
"rst_description": "*Optional*. :code:`True`, if the administrator can edit messages of other users and can pin messages; channels only\n", "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", "name": "can_edit_messages",
"required": false "required": false
}, },
{ {
"type": "Boolean", "type": "Boolean",
"description": "True, if the user is allowed to pin messages; groups and supergroups only", "description": "True, if the user is allowed to pin messages; for groups and supergroups only",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; groups and supergroups only</td>", "html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; for groups and supergroups only</td>",
"rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only\n", "rst_description": "*Optional*. :code:`True`, if the user is allowed to pin messages; for groups and supergroups only\n",
"name": "can_pin_messages", "name": "can_pin_messages",
"required": false "required": false
}, },
{ {
"type": "Boolean", "type": "Boolean",
"description": "True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only", "description": "True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only",
"html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only</td>", "html_description": "<td><em>Optional</em>. <em>True</em>, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only</td>",
"rst_description": "*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only\n", "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", "name": "can_manage_topics",
"required": false "required": false
}, },

View file

@ -7,9 +7,9 @@
"object": { "object": {
"anchor": "chatshared", "anchor": "chatshared",
"name": "ChatShared", "name": "ChatShared",
"description": "This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.", "description": "This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.",
"html_description": "<p>This object contains information about the chat whose identifier was shared with the bot using a <a href=\"#keyboardbuttonrequestchat\">KeyboardButtonRequestChat</a> button.</p>", "html_description": "<p>This object contains information about a chat that was shared with the bot using a <a href=\"#keyboardbuttonrequestchat\">KeyboardButtonRequestChat</a> button.</p>",
"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.", "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": [ "annotations": [
{ {
"type": "Integer", "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", "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", "name": "chat_id",
"required": true "required": true
},
{
"type": "String",
"description": "Title of the chat, if the title was requested by the bot.",
"html_description": "<td><em>Optional</em>. Title of the chat, if the title was requested by the bot.</td>",
"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": "<td><em>Optional</em>. Username of the chat, if the username was requested by the bot and available.</td>",
"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": "<td><em>Optional</em>. Available sizes of the chat photo, if the photo was requested by the bot</td>",
"rst_description": "*Optional*. Available sizes of the chat photo, if the photo was requested by the bot\n",
"name": "photo",
"required": false
} }
], ],
"category": "types" "category": "types"

View file

@ -21,65 +21,65 @@
}, },
{ {
"type": "String", "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.", "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": "<td><em>Optional</em>. Base64-encoded encrypted Telegram Passport element data provided by the user, available for &#8220;personal_details&#8221;, &#8220;passport&#8221;, &#8220;driver_license&#8221;, &#8220;identity_card&#8221;, &#8220;internal_passport&#8221; and &#8220;address&#8221; types. Can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>", "html_description": "<td><em>Optional</em>. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for &#8220;personal_details&#8221;, &#8220;passport&#8221;, &#8220;driver_license&#8221;, &#8220;identity_card&#8221;, &#8220;internal_passport&#8221; and &#8220;address&#8221; types. Can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>",
"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", "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", "name": "data",
"required": false "required": false
}, },
{ {
"type": "String", "type": "String",
"description": "User's verified phone number, available only for 'phone_number' type", "description": "User's verified phone number; available only for 'phone_number' type",
"html_description": "<td><em>Optional</em>. User's verified phone number, available only for &#8220;phone_number&#8221; type</td>", "html_description": "<td><em>Optional</em>. User's verified phone number; available only for &#8220;phone_number&#8221; type</td>",
"rst_description": "*Optional*. User's verified phone number, available only for 'phone_number' type\n", "rst_description": "*Optional*. User's verified phone number; available only for 'phone_number' type\n",
"name": "phone_number", "name": "phone_number",
"required": false "required": false
}, },
{ {
"type": "String", "type": "String",
"description": "User's verified email address, available only for 'email' type", "description": "User's verified email address; available only for 'email' type",
"html_description": "<td><em>Optional</em>. User's verified email address, available only for &#8220;email&#8221; type</td>", "html_description": "<td><em>Optional</em>. User's verified email address; available only for &#8220;email&#8221; type</td>",
"rst_description": "*Optional*. User's verified email address, available only for 'email' type\n", "rst_description": "*Optional*. User's verified email address; available only for 'email' type\n",
"name": "email", "name": "email",
"required": false "required": false
}, },
{ {
"type": "Array of PassportFile", "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.", "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": "<td><em>Optional</em>. Array of encrypted files with documents provided by the user, available for &#8220;utility_bill&#8221;, &#8220;bank_statement&#8221;, &#8220;rental_agreement&#8221;, &#8220;passport_registration&#8221; and &#8220;temporary_registration&#8221; types. Files can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>", "html_description": "<td><em>Optional</em>. Array of encrypted files with documents provided by the user; available only for &#8220;utility_bill&#8221;, &#8220;bank_statement&#8221;, &#8220;rental_agreement&#8221;, &#8220;passport_registration&#8221; and &#8220;temporary_registration&#8221; types. Files can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>",
"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", "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", "name": "files",
"required": false "required": false
}, },
{ {
"type": "PassportFile", "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.", "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": "<td><em>Optional</em>. Encrypted file with the front side of the document, provided by the user. Available for &#8220;passport&#8221;, &#8220;driver_license&#8221;, &#8220;identity_card&#8221; and &#8220;internal_passport&#8221;. The file can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>", "html_description": "<td><em>Optional</em>. Encrypted file with the front side of the document, provided by the user; available only for &#8220;passport&#8221;, &#8220;driver_license&#8221;, &#8220;identity_card&#8221; and &#8220;internal_passport&#8221;. The file can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>",
"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", "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", "name": "front_side",
"required": false "required": false
}, },
{ {
"type": "PassportFile", "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.", "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": "<td><em>Optional</em>. Encrypted file with the reverse side of the document, provided by the user. Available for &#8220;driver_license&#8221; and &#8220;identity_card&#8221;. The file can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>", "html_description": "<td><em>Optional</em>. Encrypted file with the reverse side of the document, provided by the user; available only for &#8220;driver_license&#8221; and &#8220;identity_card&#8221;. The file can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>",
"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", "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", "name": "reverse_side",
"required": false "required": false
}, },
{ {
"type": "PassportFile", "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.", "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": "<td><em>Optional</em>. Encrypted file with the selfie of the user holding a document, provided by the user; available for &#8220;passport&#8221;, &#8220;driver_license&#8221;, &#8220;identity_card&#8221; and &#8220;internal_passport&#8221;. The file can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>", "html_description": "<td><em>Optional</em>. Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for &#8220;passport&#8221;, &#8220;driver_license&#8221;, &#8220;identity_card&#8221; and &#8220;internal_passport&#8221;. The file can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>",
"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", "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", "name": "selfie",
"required": false "required": false
}, },
{ {
"type": "Array of PassportFile", "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.", "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": "<td><em>Optional</em>. Array of encrypted files with translated versions of documents provided by the user. Available if requested for &#8220;passport&#8221;, &#8220;driver_license&#8221;, &#8220;identity_card&#8221;, &#8220;internal_passport&#8221;, &#8220;utility_bill&#8221;, &#8220;bank_statement&#8221;, &#8220;rental_agreement&#8221;, &#8220;passport_registration&#8221; and &#8220;temporary_registration&#8221; types. Files can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>", "html_description": "<td><em>Optional</em>. Array of encrypted files with translated versions of documents provided by the user; available if requested for &#8220;passport&#8221;, &#8220;driver_license&#8221;, &#8220;identity_card&#8221;, &#8220;internal_passport&#8221;, &#8220;utility_bill&#8221;, &#8220;bank_statement&#8221;, &#8220;rental_agreement&#8221;, &#8220;passport_registration&#8221; and &#8220;temporary_registration&#8221; types. Files can be decrypted and verified using the accompanying <a href=\"#encryptedcredentials\">EncryptedCredentials</a>.</td>",
"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", "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", "name": "translation",
"required": false "required": false
}, },

View file

@ -19,6 +19,14 @@
"name": "sticker", "name": "sticker",
"required": true "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": "<td>Format of the added sticker, must be one of &#8220;static&#8221; for a <strong>.WEBP</strong> or <strong>.PNG</strong> image, &#8220;animated&#8221; for a <strong>.TGS</strong> animation, &#8220;video&#8221; for a <strong>WEBM</strong> video</td>",
"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", "type": "Array of String",
"description": "List of 1-20 emoji associated with the sticker", "description": "List of 1-20 emoji associated with the sticker",

View file

@ -7,9 +7,9 @@
"object": { "object": {
"anchor": "keyboardbuttonrequestchat", "anchor": "keyboardbuttonrequestchat",
"name": "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.", "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": "<p>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. <a href=\"/bots/features#chat-and-user-selection\">More about requesting chats &#187;</a></p>", "html_description": "<p>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 &#1089;hat if appropriate <a href=\"/bots/features#chat-and-user-selection\">More about requesting chats &#187;</a></p>",
"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 » <https://core.telegram.org/bots/features#chat-and-user-selection>`_", "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 » <https://core.telegram.org/bots/features#chat-and-user-selection>`_",
"annotations": [ "annotations": [
{ {
"type": "Integer", "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", "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", "name": "bot_is_member",
"required": false "required": false
},
{
"type": "Boolean",
"description": "Pass True to request the chat's title",
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request the chat's title</td>",
"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": "<td><em>Optional</em>. Pass <em>True</em> to request the chat's username</td>",
"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": "<td><em>Optional</em>. Pass <em>True</em> to request the chat's photo</td>",
"rst_description": "*Optional*. Pass :code:`True` to request the chat's photo\n",
"name": "request_photo",
"required": false
} }
], ],
"category": "types" "category": "types"

View file

@ -7,9 +7,9 @@
"object": { "object": {
"anchor": "keyboardbuttonrequestusers", "anchor": "keyboardbuttonrequestusers",
"name": "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.", "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": "<p>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. <a href=\"/bots/features#chat-and-user-selection\">More about requesting users &#187;</a></p>", "html_description": "<p>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. <a href=\"/bots/features#chat-and-user-selection\">More about requesting users &#187;</a></p>",
"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 » <https://core.telegram.org/bots/features#chat-and-user-selection>`_", "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 » <https://core.telegram.org/bots/features#chat-and-user-selection>`_",
"annotations": [ "annotations": [
{ {
"type": "Integer", "type": "Integer",
@ -42,6 +42,30 @@
"rst_description": "*Optional*. The maximum number of users to be selected; 1-10. Defaults to 1.\n", "rst_description": "*Optional*. The maximum number of users to be selected; 1-10. Defaults to 1.\n",
"name": "max_quantity", "name": "max_quantity",
"required": false "required": false
},
{
"type": "Boolean",
"description": "Pass True to request the users' first and last name",
"html_description": "<td><em>Optional</em>. Pass <em>True</em> to request the users' first and last name</td>",
"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": "<td><em>Optional</em>. Pass <em>True</em> to request the users' username</td>",
"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": "<td><em>Optional</em>. Pass <em>True</em> to request the users' photo</td>",
"rst_description": "*Optional*. Pass :code:`True` to request the users' photo\n",
"name": "request_photo",
"required": false
} }
], ],
"category": "types" "category": "types"

View file

@ -11,14 +11,6 @@
"html_description": "<p>This object represents a point on the map.</p>", "html_description": "<p>This object represents a point on the map.</p>",
"rst_description": "This object represents a point on the map.", "rst_description": "This object represents a point on the map.",
"annotations": [ "annotations": [
{
"type": "Float",
"description": "Longitude as defined by sender",
"html_description": "<td>Longitude as defined by sender</td>",
"rst_description": "Longitude as defined by sender\n",
"name": "longitude",
"required": true
},
{ {
"type": "Float", "type": "Float",
"description": "Latitude as defined by sender", "description": "Latitude as defined by sender",
@ -27,6 +19,14 @@
"name": "latitude", "name": "latitude",
"required": true "required": true
}, },
{
"type": "Float",
"description": "Longitude as defined by sender",
"html_description": "<td>Longitude as defined by sender</td>",
"rst_description": "Longitude as defined by sender\n",
"name": "longitude",
"required": true
},
{ {
"type": "Float", "type": "Float",
"description": "The radius of uncertainty for the location, measured in meters; 0-1500", "description": "The radius of uncertainty for the location, measured in meters; 0-1500",

View file

@ -5,6 +5,7 @@ answer:
fill: &fill-answer fill: &fill-answer
chat_id: self.chat.id chat_id: self.chat.id
message_thread_id: self.message_thread_id if self.is_topic_message else None message_thread_id: self.message_thread_id if self.is_topic_message else None
business_connection_id: self.business_connection_id
reply: reply:
method: sendMessage method: sendMessage

View file

@ -51,6 +51,14 @@
"name": "sender_boost_count", "name": "sender_boost_count",
"required": false "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": "<td><em>Optional</em>. 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.</td>",
"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", "type": "Integer",
"description": "Date the message was sent in Unix time. It is always a positive number, representing a valid date.", "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", "name": "date",
"required": true "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": "<td><em>Optional</em>. 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.</td>",
"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", "type": "Chat",
"description": "Chat the message belongs to", "description": "Chat the message belongs to",
@ -147,6 +163,14 @@
"name": "has_protected_content", "name": "has_protected_content",
"required": false "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": "<td><em>Optional</em>. 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</td>",
"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", "type": "String",
"description": "The unique identifier of a media message group this message belongs to", "description": "The unique identifier of a media message group this message belongs to",

View file

@ -21,17 +21,17 @@
}, },
{ {
"type": "Integer or String", "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)", "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": "<td><em>Optional</em>. 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</code>)</td>", "html_description": "<td><em>Optional</em>. 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</code>). Not supported for messages sent on behalf of a business account.</td>",
"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", "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", "name": "chat_id",
"required": false "required": false
}, },
{ {
"type": "Boolean", "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.", "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": "<td><em>Optional</em>. Pass <em>True</em> 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.</td>", "html_description": "<td><em>Optional</em>. Pass <em>True</em> if the message should be sent even if the specified message to be replied to is not found. Always <em>False</em> for replies in another chat or forum topic. Always <em>True</em> for messages sent on behalf of a business account.</td>",
"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", "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", "name": "allow_sending_without_reply",
"required": false "required": false
}, },

View file

@ -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": "<p>This object contains information about a user that was shared with the bot using a <a href=\"#keyboardbuttonrequestuser\">KeyboardButtonRequestUser</a> button.</p>",
"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": "<td>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.</td>",
"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": "<td><em>Optional</em>. First name of the user, if the name was requested by the bot</td>",
"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": "<td><em>Optional</em>. Last name of the user, if the name was requested by the bot</td>",
"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": "<td><em>Optional</em>. Username of the user, if the username was requested by the bot</td>",
"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": "<td><em>Optional</em>. Available sizes of the chat photo, if the photo was requested by the bot</td>",
"rst_description": "*Optional*. Available sizes of the chat photo, if the photo was requested by the bot\n",
"name": "photo",
"required": false
}
],
"category": "types"
}
}

View file

@ -35,22 +35,6 @@
"name": "sticker_type", "name": "sticker_type",
"required": true "required": true
}, },
{
"type": "Boolean",
"description": "True, if the sticker set contains animated stickers",
"html_description": "<td><em>True</em>, if the sticker set contains <a href=\"https://telegram.org/blog/animated-stickers\">animated stickers</a></td>",
"rst_description": ":code:`True`, if the sticker set contains `animated stickers <https://telegram.org/blog/animated-stickers>`_\n",
"name": "is_animated",
"required": true
},
{
"type": "Boolean",
"description": "True, if the sticker set contains video stickers",
"html_description": "<td><em>True</em>, if the sticker set contains <a href=\"https://telegram.org/blog/video-stickers-better-reactions\">video stickers</a></td>",
"rst_description": ":code:`True`, if the sticker set contains `video stickers <https://telegram.org/blog/video-stickers-better-reactions>`_\n",
"name": "is_video",
"required": true
},
{ {
"type": "Array of Sticker", "type": "Array of Sticker",
"description": "List of all set stickers", "description": "List of all set stickers",
@ -66,6 +50,30 @@
"rst_description": "*Optional*. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format\n", "rst_description": "*Optional*. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format\n",
"name": "thumbnail", "name": "thumbnail",
"required": false "required": false
},
{
"type": "Boolean",
"description": "True, if the sticker set contains animated stickers",
"html_description": "<td><em>True</em>, if the sticker set contains <a href=\"https://telegram.org/blog/animated-stickers\">animated stickers</a></td>",
"rst_description": ":code:`True`, if the sticker set contains `animated stickers <https://telegram.org/blog/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": "<td><em>True</em>, if the sticker set contains <a href=\"https://telegram.org/blog/video-stickers-better-reactions\">video stickers</a></td>",
"rst_description": ":code:`True`, if the sticker set contains `video stickers <https://telegram.org/blog/video-stickers-better-reactions>`_\n",
"name": "is_video",
"required": false,
"deprecated": {
"version": "7.2",
"release_date": "2024-03-31"
}
} }
], ],
"category": "types" "category": "types"

View file

@ -51,6 +51,38 @@
"name": "edited_channel_post", "name": "edited_channel_post",
"required": false "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": "<td><em>Optional</em>. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot</td>",
"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": "<td><em>Optional</em>. New non-service message from a connected business account</td>",
"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": "<td><em>Optional</em>. New version of a message from a connected business account</td>",
"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": "<td><em>Optional</em>. Messages were deleted from a connected business account</td>",
"rst_description": "*Optional*. Messages were deleted from a connected business account\n",
"name": "deleted_business_messages",
"required": false
},
{ {
"type": "MessageReactionUpdated", "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.", "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.",

View file

@ -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", "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", "name": "supports_inline_queries",
"required": false "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": "<td><em>Optional</em>. <em>True</em>, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in <a href=\"#getme\">getMe</a>.</td>",
"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" "category": "types"

View file

@ -19,13 +19,25 @@
"name": "request_id", "name": "request_id",
"required": true "required": true
}, },
{
"type": "Array of SharedUser",
"description": "Information about users shared with the bot.",
"html_description": "<td>Information about users shared with the bot.</td>",
"rst_description": "Information about users shared with the bot.\n",
"name": "users",
"required": true
},
{ {
"type": "Array of Integer", "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.", "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": "<td>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.</td>", "html_description": "<td>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.</td>",
"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", "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", "name": "user_ids",
"required": true "required": false,
"deprecated": {
"version": "7.2",
"release_date": "2024-03-31"
}
} }
], ],
"category": "types" "category": "types"

1
CHANGES/1444.misc.rst Normal file
View file

@ -0,0 +1 @@
Added full support of `Bot API 7.2 <https://core.telegram.org/bots/api-changelog#march-31-2024>`_

View file

@ -52,7 +52,7 @@ Features
- Asynchronous (`asyncio docs <https://docs.python.org/3/library/asyncio.html>`_, :pep:`492`) - Asynchronous (`asyncio docs <https://docs.python.org/3/library/asyncio.html>`_, :pep:`492`)
- Has type hints (:pep:`484`) and can be used with `mypy <http://mypy-lang.org/>`_ - Has type hints (:pep:`484`) and can be used with `mypy <http://mypy-lang.org/>`_
- Supports `PyPy <https://www.pypy.org/>`_ - Supports `PyPy <https://www.pypy.org/>`_
- Supports `Telegram Bot API 7.1 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API - Supports `Telegram Bot API 7.2 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API
- Telegram Bot API integration code was `autogenerated <https://github.com/aiogram/tg-codegen>`_ and can be easily re-generated when API gets updated - Telegram Bot API integration code was `autogenerated <https://github.com/aiogram/tg-codegen>`_ and can be easily re-generated when API gets updated
- Updates router (Blueprints) - Updates router (Blueprints)
- Has Finite State Machine - Has Finite State Machine

View file

@ -1,2 +1,2 @@
__version__ = "3.4.1" __version__ = "3.5.0"
__api_version__ = "7.1" __api_version__ = "7.2"

View file

@ -61,6 +61,7 @@ from ..methods import (
ExportChatInviteLink, ExportChatInviteLink,
ForwardMessage, ForwardMessage,
ForwardMessages, ForwardMessages,
GetBusinessConnection,
GetChat, GetChat,
GetChatAdministrators, GetChatAdministrators,
GetChatMember, GetChatMember,
@ -88,6 +89,7 @@ from ..methods import (
PromoteChatMember, PromoteChatMember,
ReopenForumTopic, ReopenForumTopic,
ReopenGeneralForumTopic, ReopenGeneralForumTopic,
ReplaceStickerInSet,
RestrictChatMember, RestrictChatMember,
RevokeChatInviteLink, RevokeChatInviteLink,
SendAnimation, SendAnimation,
@ -155,6 +157,7 @@ from ..types import (
BotDescription, BotDescription,
BotName, BotName,
BotShortDescription, BotShortDescription,
BusinessConnection,
Chat, Chat,
ChatAdministratorRights, ChatAdministratorRights,
ChatInviteLink, ChatInviteLink,
@ -518,7 +521,7 @@ class Bot:
request_timeout: Optional[int] = None, request_timeout: Optional[int] = None,
) -> bool: ) -> 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 Source: https://core.telegram.org/bots/api#addstickertoset
@ -1051,9 +1054,9 @@ class Bot:
name: str, name: str,
title: str, title: str,
stickers: List[InputSticker], stickers: List[InputSticker],
sticker_format: str,
sticker_type: Optional[str] = None, sticker_type: Optional[str] = None,
needs_repainting: Optional[bool] = None, needs_repainting: Optional[bool] = None,
sticker_format: Optional[str] = None,
request_timeout: Optional[int] = None, request_timeout: Optional[int] = None,
) -> bool: ) -> 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_<bot_username>"`. :code:`<bot_username>` is case insensitive. 1-64 characters. :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_<bot_username>"`. :code:`<bot_username>` is case insensitive. 1-64 characters.
:param title: Sticker set title, 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 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 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 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 :param request_timeout: Request timeout
:return: Returns :code:`True` on success. :return: Returns :code:`True` on success.
""" """
@ -1077,9 +1080,9 @@ class Bot:
name=name, name=name,
title=title, title=title,
stickers=stickers, stickers=stickers,
sticker_format=sticker_format,
sticker_type=sticker_type, sticker_type=sticker_type,
needs_repainting=needs_repainting, needs_repainting=needs_repainting,
sticker_format=sticker_format,
) )
return await self(call, request_timeout=request_timeout) return await self(call, request_timeout=request_timeout)
@ -1728,7 +1731,7 @@ class Bot:
Source: https://core.telegram.org/bots/api#getcustomemojistickers 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 :param request_timeout: Request timeout
:return: Returns an Array of :class:`aiogram.types.sticker.Sticker` objects. :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_post_stories: Pass :code:`True` if the administrator can post stories to the chat
:param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users :param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users
:param can_delete_stories: Pass :code:`True` if the administrator can delete 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_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; 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, supergroups 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, 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 :param request_timeout: Request timeout
:return: Returns :code:`True` on success. :return: Returns :code:`True` on success.
""" """
@ -2184,6 +2187,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
animation: Union[InputFile, str], animation: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
width: 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 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 » <sending-files>` :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 » <sending-files>`
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param duration: Duration of sent animation in seconds :param duration: Duration of sent animation in seconds
:param width: Animation width :param width: Animation width
@ -2222,7 +2227,7 @@ class Bot:
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2232,6 +2237,7 @@ class Bot:
call = SendAnimation( call = SendAnimation(
chat_id=chat_id, chat_id=chat_id,
animation=animation, animation=animation,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
duration=duration, duration=duration,
width=width, width=width,
@ -2254,6 +2260,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
audio: Union[InputFile, str], audio: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), 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 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 » <sending-files>` :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 » <sending-files>`
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param caption: Audio caption, 0-1024 characters after entities parsing :param caption: Audio caption, 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the audio caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. :param parse_mode: Mode for parsing entities in the audio caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
@ -2291,7 +2299,7 @@ class Bot:
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2301,6 +2309,7 @@ class Bot:
call = SendAudio( call = SendAudio(
chat_id=chat_id, chat_id=chat_id,
audio=audio, audio=audio,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
caption=caption, caption=caption,
parse_mode=parse_mode, parse_mode=parse_mode,
@ -2322,6 +2331,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
action: str, action: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
request_timeout: Optional[int] = None, request_timeout: Optional[int] = None,
) -> bool: ) -> 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 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 <https://core.telegram.org/bots/api#sendmessage>`_, *upload_photo* for `photos <https://core.telegram.org/bots/api#sendphoto>`_, *record_video* or *upload_video* for `videos <https://core.telegram.org/bots/api#sendvideo>`_, *record_voice* or *upload_voice* for `voice notes <https://core.telegram.org/bots/api#sendvoice>`_, *upload_document* for `general files <https://core.telegram.org/bots/api#senddocument>`_, *choose_sticker* for `stickers <https://core.telegram.org/bots/api#sendsticker>`_, *find_location* for `location data <https://core.telegram.org/bots/api#sendlocation>`_, *record_video_note* or *upload_video_note* for `video notes <https://core.telegram.org/bots/api#sendvideonote>`_. :param action: Type of action to broadcast. Choose one, depending on what the user is about to receive: *typing* for `text messages <https://core.telegram.org/bots/api#sendmessage>`_, *upload_photo* for `photos <https://core.telegram.org/bots/api#sendphoto>`_, *record_video* or *upload_video* for `videos <https://core.telegram.org/bots/api#sendvideo>`_, *record_voice* or *upload_voice* for `voice notes <https://core.telegram.org/bots/api#sendvoice>`_, *upload_document* for `general files <https://core.telegram.org/bots/api#senddocument>`_, *choose_sticker* for `stickers <https://core.telegram.org/bots/api#sendsticker>`_, *find_location* for `location data <https://core.telegram.org/bots/api#sendlocation>`_, *record_video_note* or *upload_video_note* for `video notes <https://core.telegram.org/bots/api#sendvideonote>`_.
: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 :param request_timeout: Request timeout
:return: The user will see a 'sending photo' status for the bot. :return: The user will see a 'sending photo' status for the bot.
""" """
@ -2344,6 +2355,7 @@ class Bot:
call = SendChatAction( call = SendChatAction(
chat_id=chat_id, chat_id=chat_id,
action=action, action=action,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
) )
return await self(call, request_timeout=request_timeout) return await self(call, request_timeout=request_timeout)
@ -2353,6 +2365,7 @@ class Bot:
chat_id: Union[int, str], chat_id: Union[int, str],
phone_number: str, phone_number: str,
first_name: str, first_name: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
last_name: Optional[str] = None, last_name: Optional[str] = None,
vcard: 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 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 phone_number: Contact's phone number
:param first_name: Contact's first name :param first_name: Contact's first name
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param last_name: Contact's last name :param last_name: Contact's last name
:param vcard: Additional data about the contact in the form of a `vCard <https://en.wikipedia.org/wiki/VCard>`_, 0-2048 bytes :param vcard: Additional data about the contact in the form of a `vCard <https://en.wikipedia.org/wiki/VCard>`_, 0-2048 bytes
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2391,6 +2405,7 @@ class Bot:
chat_id=chat_id, chat_id=chat_id,
phone_number=phone_number, phone_number=phone_number,
first_name=first_name, first_name=first_name,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
last_name=last_name, last_name=last_name,
vcard=vcard, vcard=vcard,
@ -2406,6 +2421,7 @@ class Bot:
async def send_dice( async def send_dice(
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
emoji: Optional[str] = None, emoji: Optional[str] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
@ -2424,12 +2440,13 @@ class Bot:
Source: https://core.telegram.org/bots/api#senddice 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 chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of 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 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 <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding :param protect_content: Protects the contents of the sent message from forwarding
:param reply_parameters: Description of the message to reply to :param reply_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2438,6 +2455,7 @@ class Bot:
call = SendDice( call = SendDice(
chat_id=chat_id, chat_id=chat_id,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
emoji=emoji, emoji=emoji,
disable_notification=disable_notification, disable_notification=disable_notification,
@ -2453,6 +2471,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
document: Union[InputFile, str], document: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = 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 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 » <sending-files>` :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 » <sending-files>`
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of 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://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>` :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://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing :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 <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2495,6 +2515,7 @@ class Bot:
call = SendDocument( call = SendDocument(
chat_id=chat_id, chat_id=chat_id,
document=document, document=document,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
thumbnail=thumbnail, thumbnail=thumbnail,
caption=caption, caption=caption,
@ -2514,6 +2535,7 @@ class Bot:
self, self,
chat_id: int, chat_id: int,
game_short_name: str, game_short_name: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[Union[bool, Default]] = Default("protect_content"), 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 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 <https://t.me/botfather>`_. :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather <https://t.me/botfather>`_.
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. 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 <https://core.telegram.org/bots/features#inline-keyboards>`_. 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2544,6 +2567,7 @@ class Bot:
call = SendGame( call = SendGame(
chat_id=chat_id, chat_id=chat_id,
game_short_name=game_short_name, game_short_name=game_short_name,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
disable_notification=disable_notification, disable_notification=disable_notification,
protect_content=protect_content, protect_content=protect_content,
@ -2663,6 +2687,7 @@ class Bot:
chat_id: Union[int, str], chat_id: Union[int, str],
latitude: float, latitude: float,
longitude: float, longitude: float,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
horizontal_accuracy: Optional[float] = None, horizontal_accuracy: Optional[float] = None,
live_period: Optional[int] = 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 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 latitude: Latitude of the location
:param longitude: Longitude of the location :param longitude: Longitude of the location
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500 :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 <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400. :param live_period: Period in seconds for which the location will be updated (see `Live Locations <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400.
@ -2694,7 +2720,7 @@ class Bot:
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2705,6 +2731,7 @@ class Bot:
chat_id=chat_id, chat_id=chat_id,
latitude=latitude, latitude=latitude,
longitude=longitude, longitude=longitude,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
horizontal_accuracy=horizontal_accuracy, horizontal_accuracy=horizontal_accuracy,
live_period=live_period, live_period=live_period,
@ -2723,6 +2750,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[Union[bool, Default]] = Default("protect_content"), 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 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 media: A JSON-serialized array describing messages to be sent, must include 2-10 items
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param disable_notification: Sends messages `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends messages `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent messages from forwarding and saving :param protect_content: Protects the contents of the sent messages from forwarding and saving
@ -2751,6 +2780,7 @@ class Bot:
call = SendMediaGroup( call = SendMediaGroup(
chat_id=chat_id, chat_id=chat_id,
media=media, media=media,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
disable_notification=disable_notification, disable_notification=disable_notification,
protect_content=protect_content, protect_content=protect_content,
@ -2764,6 +2794,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
text: str, text: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
entities: Optional[List[MessageEntity]] = None, 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 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 text: Text of the message to be sent, 1-4096 characters after entities parsing
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param parse_mode: Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. :param parse_mode: Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
:param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* :param 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 <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 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 :param reply_to_message_id: If the message is a reply, ID of the original message
@ -2808,6 +2840,7 @@ class Bot:
call = SendMessage( call = SendMessage(
chat_id=chat_id, chat_id=chat_id,
text=text, text=text,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
parse_mode=parse_mode, parse_mode=parse_mode,
entities=entities, entities=entities,
@ -2826,6 +2859,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
photo: Union[InputFile, str], photo: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), 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 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 » <sending-files>` :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 » <sending-files>`
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of 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 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 <https://core.telegram.org/bots/api#formatting-options>`_ for more details. :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
@ -2856,7 +2891,7 @@ class Bot:
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2866,6 +2901,7 @@ class Bot:
call = SendPhoto( call = SendPhoto(
chat_id=chat_id, chat_id=chat_id,
photo=photo, photo=photo,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
caption=caption, caption=caption,
parse_mode=parse_mode, parse_mode=parse_mode,
@ -2885,6 +2921,7 @@ class Bot:
chat_id: Union[int, str], chat_id: Union[int, str],
question: str, question: str,
options: List[str], options: List[str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
is_anonymous: Optional[bool] = None, is_anonymous: Optional[bool] = None,
type: Optional[str] = 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 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 question: Poll question, 1-300 characters
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each :param options: A JSON-serialized list of 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 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 is_anonymous: :code:`True`, if the poll needs to be anonymous, defaults to :code:`True`
:param type: Poll type, 'quiz' or 'regular', defaults to 'regular' :param type: Poll type, 'quiz' or 'regular', defaults to 'regular'
@ -2928,7 +2966,7 @@ class Bot:
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2939,6 +2977,7 @@ class Bot:
chat_id=chat_id, chat_id=chat_id,
question=question, question=question,
options=options, options=options,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
is_anonymous=is_anonymous, is_anonymous=is_anonymous,
type=type, type=type,
@ -2963,6 +3002,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
sticker: Union[InputFile, str], sticker: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
emoji: Optional[str] = None, emoji: Optional[str] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
@ -2981,13 +3021,14 @@ class Bot:
Source: https://core.telegram.org/bots/api#sendsticker 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 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 » <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 » <sending-files>`. Video and animated stickers can't be sent via an HTTP URL.
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param emoji: Emoji associated with the sticker; only for just uploaded stickers :param emoji: Emoji associated with the sticker; only for just uploaded stickers
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -2997,6 +3038,7 @@ class Bot:
call = SendSticker( call = SendSticker(
chat_id=chat_id, chat_id=chat_id,
sticker=sticker, sticker=sticker,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
emoji=emoji, emoji=emoji,
disable_notification=disable_notification, disable_notification=disable_notification,
@ -3015,6 +3057,7 @@ class Bot:
longitude: float, longitude: float,
title: str, title: str,
address: str, address: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
foursquare_id: Optional[str] = None, foursquare_id: Optional[str] = None,
foursquare_type: Optional[str] = None, foursquare_type: Optional[str] = None,
@ -3040,6 +3083,7 @@ class Bot:
:param longitude: Longitude of the venue :param longitude: Longitude of the venue
:param title: Name of the venue :param title: Name of the venue
:param address: Address of the venue :param address: Address of the venue
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param foursquare_id: Foursquare identifier of the venue :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'.) :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 <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -3061,6 +3105,7 @@ class Bot:
longitude=longitude, longitude=longitude,
title=title, title=title,
address=address, address=address,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
foursquare_id=foursquare_id, foursquare_id=foursquare_id,
foursquare_type=foursquare_type, foursquare_type=foursquare_type,
@ -3079,6 +3124,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
video: Union[InputFile, str], video: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
width: 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 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 » <sending-files>` :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 » <sending-files>`
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param duration: Duration of sent video in seconds :param duration: Duration of sent video in seconds
:param width: Video width :param width: Video width
@ -3119,7 +3166,7 @@ class Bot:
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -3129,6 +3176,7 @@ class Bot:
call = SendVideo( call = SendVideo(
chat_id=chat_id, chat_id=chat_id,
video=video, video=video,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
duration=duration, duration=duration,
width=width, width=width,
@ -3152,6 +3200,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
video_note: Union[InputFile, str], video_note: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
length: 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 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-files>`. Sending video notes by a URL is currently unsupported :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-files>`. Sending video notes by a URL is currently unsupported
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param duration: Duration of sent video in seconds :param duration: Duration of sent video in seconds
:param length: Video width and height, i.e. diameter of the video message :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 <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -3190,6 +3240,7 @@ class Bot:
call = SendVideoNote( call = SendVideoNote(
chat_id=chat_id, chat_id=chat_id,
video_note=video_note, video_note=video_note,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
duration=duration, duration=duration,
length=length, length=length,
@ -3207,6 +3258,7 @@ class Bot:
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
voice: Union[InputFile, str], voice: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), 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 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 » <sending-files>` :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 » <sending-files>`
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param caption: Voice message caption, 0-1024 characters after entities parsing :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 <https://core.telegram.org/bots/api#formatting-options>`_ for more details. :param parse_mode: Mode for parsing entities in the voice message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
@ -3237,7 +3290,7 @@ class Bot:
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving :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_parameters: Description of the message to reply to
:param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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 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 reply_to_message_id: If the message is a reply, ID of the original message
:param request_timeout: Request timeout :param request_timeout: Request timeout
@ -3247,6 +3300,7 @@ class Bot:
call = SendVoice( call = SendVoice(
chat_id=chat_id, chat_id=chat_id,
voice=voice, voice=voice,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
caption=caption, caption=caption,
parse_mode=parse_mode, parse_mode=parse_mode,
@ -3812,7 +3866,7 @@ class Bot:
request_timeout: Optional[int] = None, request_timeout: Optional[int] = None,
) -> File: ) -> 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 Source: https://core.telegram.org/bots/api#uploadstickerfile
@ -4135,6 +4189,7 @@ class Bot:
self, self,
name: str, name: str,
user_id: int, user_id: int,
format: str,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[Union[InputFile, str]] = None,
request_timeout: Optional[int] = None, request_timeout: Optional[int] = None,
) -> bool: ) -> bool:
@ -4145,6 +4200,7 @@ class Bot:
:param name: Sticker set name :param name: Sticker set name
:param user_id: User identifier of the sticker set owner :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>`_`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>`_`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 » <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 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>`_`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>`_`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 » <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 :param request_timeout: Request timeout
:return: Returns :code:`True` on success. :return: Returns :code:`True` on success.
@ -4153,6 +4209,7 @@ class Bot:
call = SetStickerSetThumbnail( call = SetStickerSetThumbnail(
name=name, name=name,
user_id=user_id, user_id=user_id,
format=format,
thumbnail=thumbnail, thumbnail=thumbnail,
) )
return await self(call, request_timeout=request_timeout) 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 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 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 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 <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the messages `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent messages from forwarding and saving :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 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 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 :param request_timeout: Request timeout
:return: Returns :code:`True` on success. :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 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 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 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 <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound. :param disable_notification: Sends the messages `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the forwarded messages from forwarding and saving :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 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 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 is_big: Pass :code:`True` to set the reaction with a big animation
:param request_timeout: Request timeout :param request_timeout: Request timeout
:return: Returns :code:`True` on success. :return: Returns :code:`True` on success.
@ -4390,3 +4447,52 @@ class Bot:
is_big=is_big, is_big=is_big,
) )
return await self(call, request_timeout=request_timeout) 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)

View file

@ -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.dispatcher.middlewares.base import BaseMiddleware
from aiogram.types import Chat, InaccessibleMessage, TelegramObject, Update, User from aiogram.types import Chat, InaccessibleMessage, TelegramObject, Update, User
EVENT_CONTEXT_KEY = "event_context"
EVENT_FROM_USER_KEY = "event_from_user" EVENT_FROM_USER_KEY = "event_from_user"
EVENT_CHAT_KEY = "event_chat" EVENT_CHAT_KEY = "event_chat"
EVENT_THREAD_ID_KEY = "event_thread_id" 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): class UserContextMiddleware(BaseMiddleware):
async def __call__( async def __call__(
self, self,
@ -17,73 +36,114 @@ class UserContextMiddleware(BaseMiddleware):
) -> Any: ) -> Any:
if not isinstance(event, Update): if not isinstance(event, Update):
raise RuntimeError("UserContextMiddleware got an unexpected event type!") raise RuntimeError("UserContextMiddleware got an unexpected event type!")
chat, user, thread_id = self.resolve_event_context(event=event) event_context = data[EVENT_CONTEXT_KEY] = self.resolve_event_context(event=event)
if user is not None:
data[EVENT_FROM_USER_KEY] = user # Backward compatibility
if chat is not None: if event_context.user is not None:
data[EVENT_CHAT_KEY] = chat data[EVENT_FROM_USER_KEY] = event_context.user
if thread_id is not None: if event_context.chat is not None:
data[EVENT_THREAD_ID_KEY] = thread_id 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) return await handler(event, data)
@classmethod @classmethod
def resolve_event_context( def resolve_event_context(cls, event: Update) -> EventContext:
cls, event: Update
) -> Tuple[Optional[Chat], Optional[User], Optional[int]]:
""" """
Resolve chat and user instance from Update object Resolve chat and user instance from Update object
""" """
if event.message: if event.message:
return ( return EventContext(
event.message.chat, chat=event.message.chat,
event.message.from_user, user=event.message.from_user,
event.message.message_thread_id if event.message.is_topic_message else None, thread_id=event.message.message_thread_id
if event.message.is_topic_message
else None,
) )
if event.edited_message: if event.edited_message:
return ( return EventContext(
event.edited_message.chat, chat=event.edited_message.chat,
event.edited_message.from_user, user=event.edited_message.from_user,
event.edited_message.message_thread_id thread_id=event.edited_message.message_thread_id
if event.edited_message.is_topic_message if event.edited_message.is_topic_message
else None, else None,
) )
if event.channel_post: if event.channel_post:
return event.channel_post.chat, None, None return EventContext(chat=event.channel_post.chat)
if event.edited_channel_post: 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: 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: 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:
if event.callback_query.message: if event.callback_query.message:
return ( return EventContext(
event.callback_query.message.chat, chat=event.callback_query.message.chat,
event.callback_query.from_user, user=event.callback_query.from_user,
event.callback_query.message.message_thread_id thread_id=event.callback_query.message.message_thread_id
if not isinstance(event.callback_query.message, InaccessibleMessage) if not isinstance(event.callback_query.message, InaccessibleMessage)
and event.callback_query.message.is_topic_message and event.callback_query.message.is_topic_message
else None, else None,
) )
return None, event.callback_query.from_user, None return EventContext(user=event.callback_query.from_user)
if event.shipping_query: 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: 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: 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: 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: 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: 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: 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: 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: if event.chat_boost:
return event.chat_boost.chat, None, None return EventContext(chat=event.chat_boost.chat)
if event.removed_chat_boost: if event.removed_chat_boost:
return event.removed_chat_boost.chat, None, None return EventContext(chat=event.removed_chat_boost.chat)
return None, None, None 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()

View file

@ -60,6 +60,16 @@ class Router:
self.removed_chat_boost = TelegramEventObserver( self.removed_chat_boost = TelegramEventObserver(
router=self, event_name="removed_chat_boost" 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") self.errors = self.error = TelegramEventObserver(router=self, event_name="error")
@ -85,6 +95,10 @@ class Router:
"message_reaction_count": self.message_reaction_count, "message_reaction_count": self.message_reaction_count,
"chat_boost": self.chat_boost, "chat_boost": self.chat_boost,
"removed_chat_boost": self.removed_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, "error": self.errors,
} }

View file

@ -18,7 +18,6 @@ class ContentType(str, Enum):
VIDEO = "video" VIDEO = "video"
VIDEO_NOTE = "video_note" VIDEO_NOTE = "video_note"
VOICE = "voice" VOICE = "voice"
HAS_MEDIA_SPOILER = "has_media_spoiler"
CONTACT = "contact" CONTACT = "contact"
DICE = "dice" DICE = "dice"
GAME = "game" GAME = "game"

View file

@ -12,6 +12,10 @@ class UpdateType(str, Enum):
EDITED_MESSAGE = "edited_message" EDITED_MESSAGE = "edited_message"
CHANNEL_POST = "channel_post" CHANNEL_POST = "channel_post"
EDITED_CHANNEL_POST = "edited_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 = "message_reaction"
MESSAGE_REACTION_COUNT = "message_reaction_count" MESSAGE_REACTION_COUNT = "message_reaction_count"
INLINE_QUERY = "inline_query" INLINE_QUERY = "inline_query"

View file

@ -2,6 +2,7 @@ from typing import Any, Awaitable, Callable, Dict, Optional, cast
from aiogram import Bot from aiogram import Bot
from aiogram.dispatcher.middlewares.base import BaseMiddleware 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.context import FSMContext
from aiogram.fsm.storage.base import ( from aiogram.fsm.storage.base import (
DEFAULT_DESTINY, DEFAULT_DESTINY,
@ -47,16 +48,13 @@ class FSMContextMiddleware(BaseMiddleware):
data: Dict[str, Any], data: Dict[str, Any],
destiny: str = DEFAULT_DESTINY, destiny: str = DEFAULT_DESTINY,
) -> Optional[FSMContext]: ) -> Optional[FSMContext]:
user = data.get("event_from_user") event_context: EventContext = cast(EventContext, data.get(EVENT_CONTEXT_KEY))
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
return self.resolve_context( return self.resolve_context(
bot=bot, bot=bot,
chat_id=chat_id, chat_id=event_context.chat_id,
user_id=user_id, user_id=event_context.user_id,
thread_id=thread_id, thread_id=event_context.thread_id,
business_connection_id=event_context.business_connection_id,
destiny=destiny, destiny=destiny,
) )
@ -66,6 +64,7 @@ class FSMContextMiddleware(BaseMiddleware):
chat_id: Optional[int], chat_id: Optional[int],
user_id: Optional[int], user_id: Optional[int],
thread_id: Optional[int] = None, thread_id: Optional[int] = None,
business_connection_id: Optional[str] = None,
destiny: str = DEFAULT_DESTINY, destiny: str = DEFAULT_DESTINY,
) -> Optional[FSMContext]: ) -> Optional[FSMContext]:
if chat_id is None: if chat_id is None:
@ -83,6 +82,7 @@ class FSMContextMiddleware(BaseMiddleware):
chat_id=chat_id, chat_id=chat_id,
user_id=user_id, user_id=user_id,
thread_id=thread_id, thread_id=thread_id,
business_connection_id=business_connection_id,
destiny=destiny, destiny=destiny,
) )
return None return None
@ -93,6 +93,7 @@ class FSMContextMiddleware(BaseMiddleware):
chat_id: int, chat_id: int,
user_id: int, user_id: int,
thread_id: Optional[int] = None, thread_id: Optional[int] = None,
business_connection_id: Optional[str] = None,
destiny: str = DEFAULT_DESTINY, destiny: str = DEFAULT_DESTINY,
) -> FSMContext: ) -> FSMContext:
return FSMContext( return FSMContext(
@ -102,6 +103,7 @@ class FSMContextMiddleware(BaseMiddleware):
chat_id=chat_id, chat_id=chat_id,
bot_id=bot.id, bot_id=bot.id,
thread_id=thread_id, thread_id=thread_id,
business_connection_id=business_connection_id,
destiny=destiny, destiny=destiny,
), ),
) )

View file

@ -16,6 +16,7 @@ class StorageKey:
chat_id: int chat_id: int
user_id: int user_id: int
thread_id: Optional[int] = None thread_id: Optional[int] = None
business_connection_id: Optional[str] = None
destiny: str = DEFAULT_DESTINY destiny: str = DEFAULT_DESTINY

View file

@ -44,7 +44,10 @@ class DefaultKeyBuilder(KeyBuilder):
Simple Redis key builder with default prefix. Simple Redis key builder with default prefix.
Generates a colon-joined string with prefix, chat_id, user_id, 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:`<prefix>:<bot_id?>:<business_connection_id?>:<chat_id>:<user_id>:<destiny?>:<field>`
""" """
def __init__( def __init__(
@ -53,23 +56,28 @@ class DefaultKeyBuilder(KeyBuilder):
prefix: str = "fsm", prefix: str = "fsm",
separator: str = ":", separator: str = ":",
with_bot_id: bool = False, with_bot_id: bool = False,
with_business_connection_id: bool = False,
with_destiny: bool = False, with_destiny: bool = False,
) -> None: ) -> None:
""" """
:param prefix: prefix for all records :param prefix: prefix for all records
:param separator: separator :param separator: separator
:param with_bot_id: include Bot id in the key :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.prefix = prefix
self.separator = separator self.separator = separator
self.with_bot_id = with_bot_id self.with_bot_id = with_bot_id
self.with_business_connection_id = with_business_connection_id
self.with_destiny = with_destiny self.with_destiny = with_destiny
def build(self, key: StorageKey, part: Literal["data", "state", "lock"]) -> str: def build(self, key: StorageKey, part: Literal["data", "state", "lock"]) -> str:
parts = [self.prefix] parts = [self.prefix]
if self.with_bot_id: if self.with_bot_id:
parts.append(str(key.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)) parts.append(str(key.chat_id))
if key.thread_id: if key.thread_id:
parts.append(str(key.thread_id)) parts.append(str(key.thread_id))

View file

@ -38,6 +38,7 @@ from .edit_message_text import EditMessageText
from .export_chat_invite_link import ExportChatInviteLink from .export_chat_invite_link import ExportChatInviteLink
from .forward_message import ForwardMessage from .forward_message import ForwardMessage
from .forward_messages import ForwardMessages from .forward_messages import ForwardMessages
from .get_business_connection import GetBusinessConnection
from .get_chat import GetChat from .get_chat import GetChat
from .get_chat_administrators import GetChatAdministrators from .get_chat_administrators import GetChatAdministrators
from .get_chat_member import GetChatMember from .get_chat_member import GetChatMember
@ -65,6 +66,7 @@ from .pin_chat_message import PinChatMessage
from .promote_chat_member import PromoteChatMember from .promote_chat_member import PromoteChatMember
from .reopen_forum_topic import ReopenForumTopic from .reopen_forum_topic import ReopenForumTopic
from .reopen_general_forum_topic import ReopenGeneralForumTopic from .reopen_general_forum_topic import ReopenGeneralForumTopic
from .replace_sticker_in_set import ReplaceStickerInSet
from .restrict_chat_member import RestrictChatMember from .restrict_chat_member import RestrictChatMember
from .revoke_chat_invite_link import RevokeChatInviteLink from .revoke_chat_invite_link import RevokeChatInviteLink
from .send_animation import SendAnimation from .send_animation import SendAnimation
@ -159,6 +161,7 @@ __all__ = (
"ExportChatInviteLink", "ExportChatInviteLink",
"ForwardMessage", "ForwardMessage",
"ForwardMessages", "ForwardMessages",
"GetBusinessConnection",
"GetChat", "GetChat",
"GetChatAdministrators", "GetChatAdministrators",
"GetChatMember", "GetChatMember",
@ -186,6 +189,7 @@ __all__ = (
"PromoteChatMember", "PromoteChatMember",
"ReopenForumTopic", "ReopenForumTopic",
"ReopenGeneralForumTopic", "ReopenGeneralForumTopic",
"ReplaceStickerInSet",
"Request", "Request",
"Response", "Response",
"RestrictChatMember", "RestrictChatMember",

View file

@ -8,7 +8,7 @@ from .base import TelegramMethod
class AddStickerToSet(TelegramMethod[bool]): 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 Source: https://core.telegram.org/bots/api#addstickertoset
""" """

View file

@ -19,7 +19,7 @@ class CopyMessages(TelegramMethod[List[MessageId]]):
from_chat_id: Union[int, str] 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`)""" """Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)"""
message_ids: List[int] message_ids: List[int]
"""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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
disable_notification: Optional[bool] = None disable_notification: Optional[bool] = None

View file

@ -2,6 +2,8 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, List, Optional from typing import TYPE_CHECKING, Any, List, Optional
from pydantic import Field
from ..types import InputSticker from ..types import InputSticker
from .base import TelegramMethod from .base import TelegramMethod
@ -24,12 +26,15 @@ class CreateNewStickerSet(TelegramMethod[bool]):
"""Sticker set title, 1-64 characters""" """Sticker set title, 1-64 characters"""
stickers: List[InputSticker] stickers: List[InputSticker]
"""A JSON-serialized list of 1-50 initial stickers to be added to the sticker set""" """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 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.""" """Type of stickers in the set, pass 'regular', 'mask', or 'custom_emoji'. By default, a regular sticker set is created."""
needs_repainting: Optional[bool] = None needs_repainting: 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""" """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: if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!! # DO NOT EDIT MANUALLY!!!
@ -42,9 +47,9 @@ class CreateNewStickerSet(TelegramMethod[bool]):
name: str, name: str,
title: str, title: str,
stickers: List[InputSticker], stickers: List[InputSticker],
sticker_format: str,
sticker_type: Optional[str] = None, sticker_type: Optional[str] = None,
needs_repainting: Optional[bool] = None, needs_repainting: Optional[bool] = None,
sticker_format: Optional[str] = None,
**__pydantic_kwargs: Any, **__pydantic_kwargs: Any,
) -> None: ) -> None:
# DO NOT EDIT MANUALLY!!! # DO NOT EDIT MANUALLY!!!
@ -56,8 +61,8 @@ class CreateNewStickerSet(TelegramMethod[bool]):
name=name, name=name,
title=title, title=title,
stickers=stickers, stickers=stickers,
sticker_format=sticker_format,
sticker_type=sticker_type, sticker_type=sticker_type,
needs_repainting=needs_repainting, needs_repainting=needs_repainting,
sticker_format=sticker_format,
**__pydantic_kwargs, **__pydantic_kwargs,
) )

View file

@ -16,7 +16,7 @@ class DeleteMessages(TelegramMethod[bool]):
chat_id: Union[int, str] chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
message_ids: List[int] message_ids: List[int]
"""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: if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!! # DO NOT EDIT MANUALLY!!!

View file

@ -19,7 +19,7 @@ class ForwardMessages(TelegramMethod[List[MessageId]]):
from_chat_id: Union[int, str] 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`)""" """Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)"""
message_ids: List[int] message_ids: List[int]
"""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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
disable_notification: Optional[bool] = None disable_notification: Optional[bool] = None

View file

@ -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)

View file

@ -17,7 +17,7 @@ class GetCustomEmojiStickers(TelegramMethod[List[Sticker]]):
__api_method__ = "getCustomEmojiStickers" __api_method__ = "getCustomEmojiStickers"
custom_emoji_ids: List[str] 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: if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!! # DO NOT EDIT MANUALLY!!!

View file

@ -42,13 +42,13 @@ class PromoteChatMember(TelegramMethod[bool]):
can_delete_stories: Optional[bool] = None can_delete_stories: Optional[bool] = None
"""Pass :code:`True` if the administrator can delete stories posted by other users""" """Pass :code:`True` if the administrator can delete stories posted by other users"""
can_post_messages: Optional[bool] = None 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 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 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 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: if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!! # DO NOT EDIT MANUALLY!!!

View file

@ -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,
)

View file

@ -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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
animation: Union[InputFile, str] 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 » <sending-files>`""" """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 » <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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
duration: Optional[int] = None duration: Optional[int] = None
@ -60,7 +62,7 @@ class SendAnimation(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -83,6 +85,7 @@ class SendAnimation(TelegramMethod[Message]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
animation: Union[InputFile, str], animation: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
@ -109,6 +112,7 @@ class SendAnimation(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
animation=animation, animation=animation,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
duration=duration, duration=duration,
width=width, width=width,

View file

@ -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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
audio: Union[InputFile, str] 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 » <sending-files>`""" """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 » <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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
caption: Optional[str] = None caption: Optional[str] = None
@ -58,7 +60,7 @@ class SendAudio(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -81,6 +83,7 @@ class SendAudio(TelegramMethod[Message]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
audio: Union[InputFile, str], audio: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
@ -106,6 +109,7 @@ class SendAudio(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
audio=audio, audio=audio,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
caption=caption, caption=caption,
parse_mode=parse_mode, parse_mode=parse_mode,

View file

@ -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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
action: str action: str
"""Type of action to broadcast. Choose one, depending on what the user is about to receive: *typing* for `text messages <https://core.telegram.org/bots/api#sendmessage>`_, *upload_photo* for `photos <https://core.telegram.org/bots/api#sendphoto>`_, *record_video* or *upload_video* for `videos <https://core.telegram.org/bots/api#sendvideo>`_, *record_voice* or *upload_voice* for `voice notes <https://core.telegram.org/bots/api#sendvoice>`_, *upload_document* for `general files <https://core.telegram.org/bots/api#senddocument>`_, *choose_sticker* for `stickers <https://core.telegram.org/bots/api#sendsticker>`_, *find_location* for `location data <https://core.telegram.org/bots/api#sendlocation>`_, *record_video_note* or *upload_video_note* for `video notes <https://core.telegram.org/bots/api#sendvideonote>`_.""" """Type of action to broadcast. Choose one, depending on what the user is about to receive: *typing* for `text messages <https://core.telegram.org/bots/api#sendmessage>`_, *upload_photo* for `photos <https://core.telegram.org/bots/api#sendphoto>`_, *record_video* or *upload_video* for `videos <https://core.telegram.org/bots/api#sendvideo>`_, *record_voice* or *upload_voice* for `voice notes <https://core.telegram.org/bots/api#sendvoice>`_, *upload_document* for `general files <https://core.telegram.org/bots/api#senddocument>`_, *choose_sticker* for `stickers <https://core.telegram.org/bots/api#sendsticker>`_, *find_location* for `location data <https://core.telegram.org/bots/api#sendlocation>`_, *record_video_note* or *upload_video_note* for `video notes <https://core.telegram.org/bots/api#sendvideonote>`_."""
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 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: if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!! # DO NOT EDIT MANUALLY!!!
@ -35,6 +37,7 @@ class SendChatAction(TelegramMethod[bool]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
action: str, action: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
**__pydantic_kwargs: Any, **__pydantic_kwargs: Any,
) -> None: ) -> None:
@ -45,6 +48,7 @@ class SendChatAction(TelegramMethod[bool]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
action=action, action=action,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
**__pydantic_kwargs, **__pydantic_kwargs,
) )

View file

@ -32,6 +32,8 @@ class SendContact(TelegramMethod[Message]):
"""Contact's phone number""" """Contact's phone number"""
first_name: str first_name: str
"""Contact's first name""" """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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
last_name: Optional[str] = None last_name: Optional[str] = None
@ -47,7 +49,7 @@ class SendContact(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -71,6 +73,7 @@ class SendContact(TelegramMethod[Message]):
chat_id: Union[int, str], chat_id: Union[int, str],
phone_number: str, phone_number: str,
first_name: str, first_name: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
last_name: Optional[str] = None, last_name: Optional[str] = None,
vcard: Optional[str] = None, vcard: Optional[str] = None,
@ -92,6 +95,7 @@ class SendContact(TelegramMethod[Message]):
chat_id=chat_id, chat_id=chat_id,
phone_number=phone_number, phone_number=phone_number,
first_name=first_name, first_name=first_name,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
last_name=last_name, last_name=last_name,
vcard=vcard, vcard=vcard,

View file

@ -28,6 +28,8 @@ class SendDice(TelegramMethod[Message]):
chat_id: Union[int, str] chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" """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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
emoji: Optional[str] = None emoji: Optional[str] = None
@ -41,7 +43,7 @@ class SendDice(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -63,6 +65,7 @@ class SendDice(TelegramMethod[Message]):
__pydantic__self__, __pydantic__self__,
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
emoji: Optional[str] = None, emoji: Optional[str] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
@ -81,6 +84,7 @@ class SendDice(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
emoji=emoji, emoji=emoji,
disable_notification=disable_notification, disable_notification=disable_notification,

View file

@ -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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
document: Union[InputFile, str] 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 » <sending-files>`""" """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 » <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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
thumbnail: Optional[InputFile] = None thumbnail: Optional[InputFile] = None
@ -54,7 +56,7 @@ class SendDocument(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -77,6 +79,7 @@ class SendDocument(TelegramMethod[Message]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
document: Union[InputFile, str], document: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
@ -100,6 +103,7 @@ class SendDocument(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
document=document, document=document,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
thumbnail=thumbnail, thumbnail=thumbnail,
caption=caption, caption=caption,

View file

@ -23,6 +23,8 @@ class SendGame(TelegramMethod[Message]):
"""Unique identifier for the target chat""" """Unique identifier for the target chat"""
game_short_name: str game_short_name: str
"""Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather <https://t.me/botfather>`_.""" """Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather <https://t.me/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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
disable_notification: Optional[bool] = None disable_notification: Optional[bool] = None
@ -32,7 +34,7 @@ class SendGame(TelegramMethod[Message]):
reply_parameters: Optional[ReplyParameters] = None reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to""" """Description of the message to reply to"""
reply_markup: Optional[InlineKeyboardMarkup] = None reply_markup: Optional[InlineKeyboardMarkup] = None
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. 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 <https://core.telegram.org/bots/features#inline-keyboards>`_. 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -55,6 +57,7 @@ class SendGame(TelegramMethod[Message]):
*, *,
chat_id: int, chat_id: int,
game_short_name: str, game_short_name: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[Union[bool, Default]] = Default("protect_content"), protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
@ -71,6 +74,7 @@ class SendGame(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
game_short_name=game_short_name, game_short_name=game_short_name,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
disable_notification=disable_notification, disable_notification=disable_notification,
protect_content=protect_content, protect_content=protect_content,

View file

@ -32,6 +32,8 @@ class SendLocation(TelegramMethod[Message]):
"""Latitude of the location""" """Latitude of the location"""
longitude: float longitude: float
"""Longitude of the location""" """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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
horizontal_accuracy: Optional[float] = None horizontal_accuracy: Optional[float] = None
@ -51,7 +53,7 @@ class SendLocation(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -75,6 +77,7 @@ class SendLocation(TelegramMethod[Message]):
chat_id: Union[int, str], chat_id: Union[int, str],
latitude: float, latitude: float,
longitude: float, longitude: float,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
horizontal_accuracy: Optional[float] = None, horizontal_accuracy: Optional[float] = None,
live_period: Optional[int] = None, live_period: Optional[int] = None,
@ -98,6 +101,7 @@ class SendLocation(TelegramMethod[Message]):
chat_id=chat_id, chat_id=chat_id,
latitude=latitude, latitude=latitude,
longitude=longitude, longitude=longitude,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
horizontal_accuracy=horizontal_accuracy, horizontal_accuracy=horizontal_accuracy,
live_period=live_period, live_period=live_period,

View file

@ -6,11 +6,15 @@ from pydantic import Field
from ..client.default import Default from ..client.default import Default
from ..types import ( from ..types import (
ForceReply,
InlineKeyboardMarkup,
InputMediaAudio, InputMediaAudio,
InputMediaDocument, InputMediaDocument,
InputMediaPhoto, InputMediaPhoto,
InputMediaVideo, InputMediaVideo,
Message, Message,
ReplyKeyboardMarkup,
ReplyKeyboardRemove,
ReplyParameters, ReplyParameters,
) )
from .base import TelegramMethod 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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]] media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]]
"""A JSON-serialized array describing messages to be sent, must include 2-10 items""" """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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
disable_notification: Optional[bool] = None disable_notification: Optional[bool] = None
@ -62,6 +68,7 @@ class SendMediaGroup(TelegramMethod[List[Message]]):
media: List[ media: List[
Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo] Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]
], ],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[Union[bool, Default]] = Default("protect_content"), protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
@ -77,6 +84,7 @@ class SendMediaGroup(TelegramMethod[List[Message]]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
media=media, media=media,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
disable_notification=disable_notification, disable_notification=disable_notification,
protect_content=protect_content, protect_content=protect_content,

View file

@ -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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
text: str text: str
"""Text of the message to be sent, 1-4096 characters after entities parsing""" """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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
parse_mode: Optional[Union[str, Default]] = Default("parse_mode") parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
@ -49,7 +51,7 @@ class SendMessage(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -79,6 +81,7 @@ class SendMessage(TelegramMethod[Message]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
text: str, text: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
entities: Optional[List[MessageEntity]] = None, entities: Optional[List[MessageEntity]] = None,
@ -105,6 +108,7 @@ class SendMessage(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
text=text, text=text,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
parse_mode=parse_mode, parse_mode=parse_mode,
entities=entities, entities=entities,

View file

@ -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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
photo: Union[InputFile, str] 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 » <sending-files>`""" """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 » <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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
caption: Optional[str] = None caption: Optional[str] = None
@ -52,7 +54,7 @@ class SendPhoto(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -75,6 +77,7 @@ class SendPhoto(TelegramMethod[Message]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
photo: Union[InputFile, str], photo: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
@ -97,6 +100,7 @@ class SendPhoto(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
photo=photo, photo=photo,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
caption=caption, caption=caption,
parse_mode=parse_mode, parse_mode=parse_mode,

View file

@ -35,6 +35,8 @@ class SendPoll(TelegramMethod[Message]):
"""Poll question, 1-300 characters""" """Poll question, 1-300 characters"""
options: List[str] options: List[str]
"""A JSON-serialized list of answer options, 2-10 strings 1-100 characters each""" """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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
is_anonymous: Optional[bool] = None is_anonymous: Optional[bool] = None
@ -66,7 +68,7 @@ class SendPoll(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -90,6 +92,7 @@ class SendPoll(TelegramMethod[Message]):
chat_id: Union[int, str], chat_id: Union[int, str],
question: str, question: str,
options: List[str], options: List[str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
is_anonymous: Optional[bool] = None, is_anonymous: Optional[bool] = None,
type: Optional[str] = None, type: Optional[str] = None,
@ -119,6 +122,7 @@ class SendPoll(TelegramMethod[Message]):
chat_id=chat_id, chat_id=chat_id,
question=question, question=question,
options=options, options=options,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
is_anonymous=is_anonymous, is_anonymous=is_anonymous,
type=type, type=type,

View file

@ -30,7 +30,9 @@ class SendSticker(TelegramMethod[Message]):
chat_id: Union[int, str] chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
sticker: Union[InputFile, str] 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 » <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 » <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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
emoji: Optional[str] = None emoji: Optional[str] = None
@ -44,7 +46,7 @@ class SendSticker(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -67,6 +69,7 @@ class SendSticker(TelegramMethod[Message]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
sticker: Union[InputFile, str], sticker: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
emoji: Optional[str] = None, emoji: Optional[str] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
@ -86,6 +89,7 @@ class SendSticker(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
sticker=sticker, sticker=sticker,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
emoji=emoji, emoji=emoji,
disable_notification=disable_notification, disable_notification=disable_notification,

View file

@ -36,6 +36,8 @@ class SendVenue(TelegramMethod[Message]):
"""Name of the venue""" """Name of the venue"""
address: str address: str
"""Address of the venue""" """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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
foursquare_id: Optional[str] = None foursquare_id: Optional[str] = None
@ -55,7 +57,7 @@ class SendVenue(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -81,6 +83,7 @@ class SendVenue(TelegramMethod[Message]):
longitude: float, longitude: float,
title: str, title: str,
address: str, address: str,
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
foursquare_id: Optional[str] = None, foursquare_id: Optional[str] = None,
foursquare_type: Optional[str] = None, foursquare_type: Optional[str] = None,
@ -106,6 +109,7 @@ class SendVenue(TelegramMethod[Message]):
longitude=longitude, longitude=longitude,
title=title, title=title,
address=address, address=address,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
foursquare_id=foursquare_id, foursquare_id=foursquare_id,
foursquare_type=foursquare_type, foursquare_type=foursquare_type,

View file

@ -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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
video: Union[InputFile, str] 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 » <sending-files>`""" """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 » <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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
duration: Optional[int] = None duration: Optional[int] = None
@ -62,7 +64,7 @@ class SendVideo(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -85,6 +87,7 @@ class SendVideo(TelegramMethod[Message]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
video: Union[InputFile, str], video: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
@ -112,6 +115,7 @@ class SendVideo(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
video=video, video=video,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
duration=duration, duration=duration,
width=width, width=width,

View file

@ -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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
video_note: Union[InputFile, str] 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-files>`. Sending video notes by a URL is currently unsupported""" """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-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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
duration: Optional[int] = None duration: Optional[int] = None
@ -48,7 +50,7 @@ class SendVideoNote(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -71,6 +73,7 @@ class SendVideoNote(TelegramMethod[Message]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
video_note: Union[InputFile, str], video_note: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
length: Optional[int] = None, length: Optional[int] = None,
@ -92,6 +95,7 @@ class SendVideoNote(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
video_note=video_note, video_note=video_note,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
duration=duration, duration=duration,
length=length, length=length,

View file

@ -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`)""" """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
voice: Union[InputFile, str] 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 » <sending-files>`""" """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 » <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 message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
caption: Optional[str] = None caption: Optional[str] = None
@ -52,7 +54,7 @@ class SendVoice(TelegramMethod[Message]):
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None ] = None
"""Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove reply keyboard or to force a reply from the user.""" """Additional interface options. A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, 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( allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True} None, json_schema_extra={"deprecated": True}
) )
@ -75,6 +77,7 @@ class SendVoice(TelegramMethod[Message]):
*, *,
chat_id: Union[int, str], chat_id: Union[int, str],
voice: Union[InputFile, str], voice: Union[InputFile, str],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
@ -97,6 +100,7 @@ class SendVoice(TelegramMethod[Message]):
super().__init__( super().__init__(
chat_id=chat_id, chat_id=chat_id,
voice=voice, voice=voice,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id, message_thread_id=message_thread_id,
caption=caption, caption=caption,
parse_mode=parse_mode, parse_mode=parse_mode,

View file

@ -19,7 +19,7 @@ class SetMessageReaction(TelegramMethod[bool]):
message_id: int 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.""" """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 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 is_big: Optional[bool] = None
"""Pass :code:`True` to set the reaction with a big animation""" """Pass :code:`True` to set the reaction with a big animation"""

View file

@ -20,6 +20,8 @@ class SetStickerSetThumbnail(TelegramMethod[bool]):
"""Sticker set name""" """Sticker set name"""
user_id: int user_id: int
"""User identifier of the sticker set owner""" """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 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>`_`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>`_`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 » <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.""" """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>`_`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>`_`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 » <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, name: str,
user_id: int, user_id: int,
format: str,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[Union[InputFile, str]] = None,
**__pydantic_kwargs: Any, **__pydantic_kwargs: Any,
) -> None: ) -> None:
@ -39,4 +42,6 @@ class SetStickerSetThumbnail(TelegramMethod[bool]):
# This method was auto-generated via `butcher` # This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins # 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
)

View file

@ -8,7 +8,7 @@ from .base import TelegramMethod
class UploadStickerFile(TelegramMethod[File]): 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 Source: https://core.telegram.org/bots/api#uploadstickerfile
""" """

View file

@ -3,6 +3,7 @@ from typing import List, Literal, Optional, Union
from .animation import Animation from .animation import Animation
from .audio import Audio from .audio import Audio
from .base import UNSET_PARSE_MODE, TelegramObject from .base import UNSET_PARSE_MODE, TelegramObject
from .birthdate import Birthdate
from .bot_command import BotCommand from .bot_command import BotCommand
from .bot_command_scope import BotCommandScope from .bot_command_scope import BotCommandScope
from .bot_command_scope_all_chat_administrators import ( 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_description import BotDescription
from .bot_name import BotName from .bot_name import BotName
from .bot_short_description import BotShortDescription 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_game import CallbackGame
from .callback_query import CallbackQuery from .callback_query import CallbackQuery
from .chat import Chat from .chat import Chat
@ -165,6 +172,7 @@ from .reply_keyboard_remove import ReplyKeyboardRemove
from .reply_parameters import ReplyParameters from .reply_parameters import ReplyParameters
from .response_parameters import ResponseParameters from .response_parameters import ResponseParameters
from .sent_web_app_message import SentWebAppMessage from .sent_web_app_message import SentWebAppMessage
from .shared_user import SharedUser
from .shipping_address import ShippingAddress from .shipping_address import ShippingAddress
from .shipping_option import ShippingOption from .shipping_option import ShippingOption
from .shipping_query import ShippingQuery from .shipping_query import ShippingQuery
@ -196,6 +204,7 @@ from .write_access_allowed import WriteAccessAllowed
__all__ = ( __all__ = (
"Animation", "Animation",
"Audio", "Audio",
"Birthdate",
"BotCommand", "BotCommand",
"BotCommandScope", "BotCommandScope",
"BotCommandScopeAllChatAdministrators", "BotCommandScopeAllChatAdministrators",
@ -209,6 +218,12 @@ __all__ = (
"BotName", "BotName",
"BotShortDescription", "BotShortDescription",
"BufferedInputFile", "BufferedInputFile",
"BusinessConnection",
"BusinessIntro",
"BusinessLocation",
"BusinessMessagesDeleted",
"BusinessOpeningHours",
"BusinessOpeningHoursInterval",
"CallbackGame", "CallbackGame",
"CallbackQuery", "CallbackQuery",
"Chat", "Chat",
@ -357,6 +372,7 @@ __all__ = (
"ReplyParameters", "ReplyParameters",
"ResponseParameters", "ResponseParameters",
"SentWebAppMessage", "SentWebAppMessage",
"SharedUser",
"ShippingAddress", "ShippingAddress",
"ShippingOption", "ShippingOption",
"ShippingQuery", "ShippingQuery",

View file

@ -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)

Some files were not shown because too many files have changed in this diff Show more