Added full support of Bot API 8.2 (#1623)

* Added full support of Bot API 8.2

* Added changelog

* Try to add port

* Add port to the `test_reset_connector`
This commit is contained in:
Alex Root Junior 2025-01-02 02:38:18 +02:00 committed by GitHub
parent 81550997f7
commit afccd8a38f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 811 additions and 85 deletions

View file

@ -38,9 +38,9 @@
{
"type": "Array of String",
"required": false,
"description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.",
"html_description": "<td>A JSON-serialized list of the update types you want your bot to receive. For example, specify <code>[\"message\", \"edited_channel_post\", \"callback_query\"]</code> to only receive updates of these types. See <a href=\"#update\">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br/>\n<br/>\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.</td>",
"rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n",
"description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.",
"html_description": "<td>A JSON-serialized list of the update types you want your bot to receive. For example, specify <code>[\"message\", \"edited_channel_post\", \"callback_query\"]</code> to only receive updates of these types. See <a href=\"#update\">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br/>\n<br/>\nPlease note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.</td>",
"rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.\n",
"name": "allowed_updates"
}
],

View file

@ -0,0 +1,25 @@
{
"meta": {},
"group": {
"title": "Stickers",
"anchor": "stickers"
},
"object": {
"anchor": "removechatverification",
"name": "removeChatVerification",
"description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.",
"html_description": "<p>Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns <em>True</em> on success.</p>",
"rst_description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
"required": true,
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
"name": "chat_id"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,25 @@
{
"meta": {},
"group": {
"title": "Stickers",
"anchor": "stickers"
},
"object": {
"anchor": "removeuserverification",
"name": "removeUserVerification",
"description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.",
"html_description": "<p>Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns <em>True</em> on success.</p>",
"rst_description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the target user",
"html_description": "<td>Unique identifier of the target user</td>",
"rst_description": "Unique identifier of the target user\n",
"name": "user_id"
}
],
"category": "methods"
}
}

View file

@ -27,6 +27,14 @@
"rst_description": "Identifier of the gift\n",
"name": "gift_id"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver",
"html_description": "<td>Pass <em>True</em> to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver</td>",
"rst_description": "Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver\n",
"name": "pay_for_upgrade"
},
{
"type": "String",
"required": false,

View file

@ -30,17 +30,17 @@
{
"type": "InputFile or String",
"required": false,
"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#animation-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-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.",
"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#animation-requirements\"/><a href=\"https://core.telegram.org/stickers#animation-requirements\">https://core.telegram.org/stickers#animation-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-requirements\"/><a href=\"https://core.telegram.org/stickers#video-requirements\">https://core.telegram.org/stickers#video-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#animation-requirements <https://core.telegram.org/stickers#animation-requirements>`_`https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-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-requirements <https://core.telegram.org/stickers#video-requirements>`_`https://core.telegram.org/stickers#video-requirements <https://core.telegram.org/stickers#video-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",
"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#animation-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-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.",
"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#animation-requirements\"/><a href=\"https://core.telegram.org/stickers#animation-requirements\">https://core.telegram.org/stickers#animation-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-requirements\"/><a href=\"https://core.telegram.org/stickers#video-requirements\">https://core.telegram.org/stickers#video-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#animation-requirements <https://core.telegram.org/stickers#animation-requirements>`_`https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-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-requirements <https://core.telegram.org/stickers#video-requirements>`_`https://core.telegram.org/stickers#video-requirements <https://core.telegram.org/stickers#video-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"
},
{
"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",
"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"
}
],

View file

@ -7,9 +7,9 @@
"object": {
"anchor": "setwebhook",
"name": "setWebhook",
"description": "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.\nNotes\n1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.\n2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.\n3. Ports currently supported for webhooks: 443, 80, 88, 8443.\nIf you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.",
"html_description": "<p>Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <a href=\"#update\">Update</a>. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns <em>True</em> on success.</p><p>If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header &#8220;X-Telegram-Bot-Api-Secret-Token&#8221; with the secret token as content.</p><blockquote>\n<p><strong>Notes</strong><br/>\n<strong>1.</strong> You will not be able to receive updates using <a href=\"#getupdates\">getUpdates</a> for as long as an outgoing webhook is set up.<br/>\n<strong>2.</strong> To use a self-signed certificate, you need to upload your <a href=\"/bots/self-signed\">public key certificate</a> using <em>certificate</em> parameter. Please upload as InputFile, sending a String will not work.<br/>\n<strong>3.</strong> Ports currently supported <em>for webhooks</em>: <strong>443, 80, 88, 8443</strong>.</p>\n<p>If you're having any trouble setting up webhooks, please check out this <a href=\"/bots/webhooks\">amazing guide to webhooks</a>.</p>\n</blockquote>",
"rst_description": "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns :code:`True` on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter *secret_token*. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.\n\n **Notes**\n \n **1.** You will not be able to receive updates using :class:`aiogram.methods.get_updates.GetUpdates` for as long as an outgoing webhook is set up.\n \n **2.** To use a self-signed certificate, you need to upload your `public key certificate <https://core.telegram.org/bots/self-signed>`_ using *certificate* parameter. Please upload as InputFile, sending a String will not work.\n \n **3.** Ports currently supported *for webhooks*: **443, 80, 88, 8443**.\n If you're having any trouble setting up webhooks, please check out this `amazing guide to webhooks <https://core.telegram.org/bots/webhooks>`_.",
"description": "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.\nNotes\n1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.\n2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.\n3. Ports currently supported for webhooks: 443, 80, 88, 8443.\nIf you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.",
"html_description": "<p>Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <a href=\"#update\">Update</a>. In case of an unsuccessful request (a request with response <a href=\"https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\">HTTP status code</a> different from <code>2XY</code>), we will repeat the request and give up after a reasonable amount of attempts. Returns <em>True</em> on success.</p><p>If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header &#8220;X-Telegram-Bot-Api-Secret-Token&#8221; with the secret token as content.</p><blockquote>\n<p><strong>Notes</strong><br/>\n<strong>1.</strong> You will not be able to receive updates using <a href=\"#getupdates\">getUpdates</a> for as long as an outgoing webhook is set up.<br/>\n<strong>2.</strong> To use a self-signed certificate, you need to upload your <a href=\"/bots/self-signed\">public key certificate</a> using <em>certificate</em> parameter. Please upload as InputFile, sending a String will not work.<br/>\n<strong>3.</strong> Ports currently supported <em>for webhooks</em>: <strong>443, 80, 88, 8443</strong>.</p>\n<p>If you're having any trouble setting up webhooks, please check out this <a href=\"/bots/webhooks\">amazing guide to webhooks</a>.</p>\n</blockquote>",
"rst_description": "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request (a request with response `HTTP status code <https://en.wikipedia.org/wiki/List_of_HTTP_status_codes>`_ different from :code:`2XY`), we will repeat the request and give up after a reasonable amount of attempts. Returns :code:`True` on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter *secret_token*. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.\n\n **Notes**\n \n **1.** You will not be able to receive updates using :class:`aiogram.methods.get_updates.GetUpdates` for as long as an outgoing webhook is set up.\n \n **2.** To use a self-signed certificate, you need to upload your `public key certificate <https://core.telegram.org/bots/self-signed>`_ using *certificate* parameter. Please upload as InputFile, sending a String will not work.\n \n **3.** Ports currently supported *for webhooks*: **443, 80, 88, 8443**.\n If you're having any trouble setting up webhooks, please check out this `amazing guide to webhooks <https://core.telegram.org/bots/webhooks>`_.",
"annotations": [
{
"type": "String",

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Stickers",
"anchor": "stickers"
},
"object": {
"anchor": "verifychat",
"name": "verifyChat",
"description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.",
"html_description": "<p>Verifies a chat on behalf of the organization which is represented by the bot. Returns <em>True</em> on success.</p>",
"rst_description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
"required": true,
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
"name": "chat_id"
},
{
"type": "String",
"required": false,
"description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.",
"html_description": "<td>Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.</td>",
"rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n",
"name": "custom_description"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,33 @@
{
"meta": {},
"group": {
"title": "Stickers",
"anchor": "stickers"
},
"object": {
"anchor": "verifyuser",
"name": "verifyUser",
"description": "Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.",
"html_description": "<p>Verifies a user on behalf of the organization which is represented by the bot. Returns <em>True</em> on success.</p>",
"rst_description": "Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the target user",
"html_description": "<td>Unique identifier of the target user</td>",
"rst_description": "Unique identifier of the target user\n",
"name": "user_id"
},
{
"type": "String",
"required": false,
"description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.",
"html_description": "<td>Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.</td>",
"rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n",
"name": "custom_description"
}
],
"category": "methods"
}
}

View file

@ -1,7 +1,7 @@
{
"api": {
"version": "8.1",
"release_date": "2024-12-04"
"version": "8.2",
"release_date": "2025-01-01"
},
"items": [
{
@ -244,9 +244,9 @@
{
"type": "Array of String",
"required": false,
"description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.",
"html_description": "<td>A JSON-serialized list of the update types you want your bot to receive. For example, specify <code>[\"message\", \"edited_channel_post\", \"callback_query\"]</code> to only receive updates of these types. See <a href=\"#update\">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br/>\n<br/>\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.</td>",
"rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n",
"description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.",
"html_description": "<td>A JSON-serialized list of the update types you want your bot to receive. For example, specify <code>[\"message\", \"edited_channel_post\", \"callback_query\"]</code> to only receive updates of these types. See <a href=\"#update\">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br/>\n<br/>\nPlease note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.</td>",
"rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.\n",
"name": "allowed_updates"
}
],
@ -255,9 +255,9 @@
{
"anchor": "setwebhook",
"name": "setWebhook",
"description": "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.\nNotes\n1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.\n2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.\n3. Ports currently supported for webhooks: 443, 80, 88, 8443.\nIf you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.",
"html_description": "<p>Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <a href=\"#update\">Update</a>. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns <em>True</em> on success.</p><p>If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header &#8220;X-Telegram-Bot-Api-Secret-Token&#8221; with the secret token as content.</p><blockquote>\n<p><strong>Notes</strong><br/>\n<strong>1.</strong> You will not be able to receive updates using <a href=\"#getupdates\">getUpdates</a> for as long as an outgoing webhook is set up.<br/>\n<strong>2.</strong> To use a self-signed certificate, you need to upload your <a href=\"/bots/self-signed\">public key certificate</a> using <em>certificate</em> parameter. Please upload as InputFile, sending a String will not work.<br/>\n<strong>3.</strong> Ports currently supported <em>for webhooks</em>: <strong>443, 80, 88, 8443</strong>.</p>\n<p>If you're having any trouble setting up webhooks, please check out this <a href=\"/bots/webhooks\">amazing guide to webhooks</a>.</p>\n</blockquote>",
"rst_description": "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns :code:`True` on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter *secret_token*. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.\n\n **Notes**\n \n **1.** You will not be able to receive updates using :class:`aiogram.methods.get_updates.GetUpdates` for as long as an outgoing webhook is set up.\n \n **2.** To use a self-signed certificate, you need to upload your `public key certificate <https://core.telegram.org/bots/self-signed>`_ using *certificate* parameter. Please upload as InputFile, sending a String will not work.\n \n **3.** Ports currently supported *for webhooks*: **443, 80, 88, 8443**.\n If you're having any trouble setting up webhooks, please check out this `amazing guide to webhooks <https://core.telegram.org/bots/webhooks>`_.",
"description": "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.\nNotes\n1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.\n2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.\n3. Ports currently supported for webhooks: 443, 80, 88, 8443.\nIf you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.",
"html_description": "<p>Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <a href=\"#update\">Update</a>. In case of an unsuccessful request (a request with response <a href=\"https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\">HTTP status code</a> different from <code>2XY</code>), we will repeat the request and give up after a reasonable amount of attempts. Returns <em>True</em> on success.</p><p>If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header &#8220;X-Telegram-Bot-Api-Secret-Token&#8221; with the secret token as content.</p><blockquote>\n<p><strong>Notes</strong><br/>\n<strong>1.</strong> You will not be able to receive updates using <a href=\"#getupdates\">getUpdates</a> for as long as an outgoing webhook is set up.<br/>\n<strong>2.</strong> To use a self-signed certificate, you need to upload your <a href=\"/bots/self-signed\">public key certificate</a> using <em>certificate</em> parameter. Please upload as InputFile, sending a String will not work.<br/>\n<strong>3.</strong> Ports currently supported <em>for webhooks</em>: <strong>443, 80, 88, 8443</strong>.</p>\n<p>If you're having any trouble setting up webhooks, please check out this <a href=\"/bots/webhooks\">amazing guide to webhooks</a>.</p>\n</blockquote>",
"rst_description": "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request (a request with response `HTTP status code <https://en.wikipedia.org/wiki/List_of_HTTP_status_codes>`_ different from :code:`2XY`), we will repeat the request and give up after a reasonable amount of attempts. Returns :code:`True` on success.\nIf you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter *secret_token*. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.\n\n **Notes**\n \n **1.** You will not be able to receive updates using :class:`aiogram.methods.get_updates.GetUpdates` for as long as an outgoing webhook is set up.\n \n **2.** To use a self-signed certificate, you need to upload your `public key certificate <https://core.telegram.org/bots/self-signed>`_ using *certificate* parameter. Please upload as InputFile, sending a String will not work.\n \n **3.** Ports currently supported *for webhooks*: **443, 80, 88, 8443**.\n If you're having any trouble setting up webhooks, please check out this `amazing guide to webhooks <https://core.telegram.org/bots/webhooks>`_.",
"annotations": [
{
"type": "String",
@ -3616,9 +3616,9 @@
{
"anchor": "backgroundtypepattern",
"name": "BackgroundTypePattern",
"description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
"html_description": "<p>The background is a PNG or TGV (gzipped subset of SVG with MIME type &#8220;application/x-tgwallpattern&#8221;) pattern to be combined with the background fill chosen by the user.</p>",
"rst_description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
"description": "The background is a .PNG or .TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
"html_description": "<p>The background is a .PNG or .TGV (gzipped subset of SVG with MIME type &#8220;application/x-tgwallpattern&#8221;) pattern to be combined with the background fill chosen by the user.</p>",
"rst_description": "The background is a .PNG or .TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
"annotations": [
{
"type": "String",
@ -12658,9 +12658,9 @@
},
{
"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",
"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
},
@ -13167,17 +13167,17 @@
{
"type": "InputFile or String",
"required": false,
"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#animation-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-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.",
"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#animation-requirements\"/><a href=\"https://core.telegram.org/stickers#animation-requirements\">https://core.telegram.org/stickers#animation-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-requirements\"/><a href=\"https://core.telegram.org/stickers#video-requirements\">https://core.telegram.org/stickers#video-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#animation-requirements <https://core.telegram.org/stickers#animation-requirements>`_`https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-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-requirements <https://core.telegram.org/stickers#video-requirements>`_`https://core.telegram.org/stickers#video-requirements <https://core.telegram.org/stickers#video-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",
"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#animation-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-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.",
"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#animation-requirements\"/><a href=\"https://core.telegram.org/stickers#animation-requirements\">https://core.telegram.org/stickers#animation-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-requirements\"/><a href=\"https://core.telegram.org/stickers#video-requirements\">https://core.telegram.org/stickers#video-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#animation-requirements <https://core.telegram.org/stickers#animation-requirements>`_`https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-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-requirements <https://core.telegram.org/stickers#video-requirements>`_`https://core.telegram.org/stickers#video-requirements <https://core.telegram.org/stickers#video-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"
},
{
"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",
"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"
}
],
@ -13258,6 +13258,14 @@
"name": "star_count",
"required": true
},
{
"type": "Integer",
"description": "The number of Telegram Stars that must be paid to upgrade the gift to a unique one",
"html_description": "<td><em>Optional</em>. The number of Telegram Stars that must be paid to upgrade the gift to a unique one</td>",
"rst_description": "*Optional*. The number of Telegram Stars that must be paid to upgrade the gift to a unique one\n",
"name": "upgrade_star_count",
"required": false
},
{
"type": "Integer",
"description": "The total number of the gifts of this type that can be sent; for limited gifts only",
@ -13327,6 +13335,14 @@
"rst_description": "Identifier of the gift\n",
"name": "gift_id"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver",
"html_description": "<td>Pass <em>True</em> to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver</td>",
"rst_description": "Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver\n",
"name": "pay_for_upgrade"
},
{
"type": "String",
"required": false,
@ -13353,6 +13369,94 @@
}
],
"category": "methods"
},
{
"anchor": "verifyuser",
"name": "verifyUser",
"description": "Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.",
"html_description": "<p>Verifies a user on behalf of the organization which is represented by the bot. Returns <em>True</em> on success.</p>",
"rst_description": "Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the target user",
"html_description": "<td>Unique identifier of the target user</td>",
"rst_description": "Unique identifier of the target user\n",
"name": "user_id"
},
{
"type": "String",
"required": false,
"description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.",
"html_description": "<td>Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.</td>",
"rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n",
"name": "custom_description"
}
],
"category": "methods"
},
{
"anchor": "verifychat",
"name": "verifyChat",
"description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.",
"html_description": "<p>Verifies a chat on behalf of the organization which is represented by the bot. Returns <em>True</em> on success.</p>",
"rst_description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
"required": true,
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
"name": "chat_id"
},
{
"type": "String",
"required": false,
"description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.",
"html_description": "<td>Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.</td>",
"rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n",
"name": "custom_description"
}
],
"category": "methods"
},
{
"anchor": "removeuserverification",
"name": "removeUserVerification",
"description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.",
"html_description": "<p>Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns <em>True</em> on success.</p>",
"rst_description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the target user",
"html_description": "<td>Unique identifier of the target user</td>",
"rst_description": "Unique identifier of the target user\n",
"name": "user_id"
}
],
"category": "methods"
},
{
"anchor": "removechatverification",
"name": "removeChatVerification",
"description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.",
"html_description": "<p>Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns <em>True</em> on success.</p>",
"rst_description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer or String",
"required": true,
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
"name": "chat_id"
}
],
"category": "methods"
}
],
"description": "The following methods and objects allow your bot to handle stickers and sticker sets."
@ -13575,14 +13679,6 @@
"name": "url",
"required": false
},
{
"type": "Boolean",
"description": "Pass True if you don't want the URL to be shown in the message",
"html_description": "<td><em>Optional</em>. Pass <em>True</em> if you don't want the URL to be shown in the message</td>",
"rst_description": "*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message\n",
"name": "hide_url",
"required": false
},
{
"type": "String",
"description": "Short description of the result",
@ -13765,9 +13861,9 @@
},
{
"type": "String",
"description": "A valid URL for the GIF file. File size must not exceed 1MB",
"html_description": "<td>A valid URL for the GIF file. File size must not exceed 1MB</td>",
"rst_description": "A valid URL for the GIF file. File size must not exceed 1MB\n",
"description": "A valid URL for the GIF file",
"html_description": "<td>A valid URL for the GIF file</td>",
"rst_description": "A valid URL for the GIF file\n",
"name": "gif_url",
"required": true
},
@ -13895,9 +13991,9 @@
},
{
"type": "String",
"description": "A valid URL for the MPEG4 file. File size must not exceed 1MB",
"html_description": "<td>A valid URL for the MPEG4 file. File size must not exceed 1MB</td>",
"rst_description": "A valid URL for the MPEG4 file. File size must not exceed 1MB\n",
"description": "A valid URL for the MPEG4 file",
"html_description": "<td>A valid URL for the MPEG4 file</td>",
"rst_description": "A valid URL for the MPEG4 file\n",
"name": "mpeg4_url",
"required": true
},

View file

@ -7,9 +7,9 @@
"object": {
"anchor": "backgroundtypepattern",
"name": "BackgroundTypePattern",
"description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
"html_description": "<p>The background is a PNG or TGV (gzipped subset of SVG with MIME type &#8220;application/x-tgwallpattern&#8221;) pattern to be combined with the background fill chosen by the user.</p>",
"rst_description": "The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
"description": "The background is a .PNG or .TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
"html_description": "<p>The background is a .PNG or .TGV (gzipped subset of SVG with MIME type &#8220;application/x-tgwallpattern&#8221;) pattern to be combined with the background fill chosen by the user.</p>",
"rst_description": "The background is a .PNG or .TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.",
"annotations": [
{
"type": "String",

View file

@ -35,6 +35,14 @@
"name": "star_count",
"required": true
},
{
"type": "Integer",
"description": "The number of Telegram Stars that must be paid to upgrade the gift to a unique one",
"html_description": "<td><em>Optional</em>. The number of Telegram Stars that must be paid to upgrade the gift to a unique one</td>",
"rst_description": "*Optional*. The number of Telegram Stars that must be paid to upgrade the gift to a unique one\n",
"name": "upgrade_star_count",
"required": false
},
{
"type": "Integer",
"description": "The total number of the gifts of this type that can be sent; for limited gifts only",

View file

@ -59,14 +59,6 @@
"name": "url",
"required": false
},
{
"type": "Boolean",
"description": "Pass True if you don't want the URL to be shown in the message",
"html_description": "<td><em>Optional</em>. Pass <em>True</em> if you don't want the URL to be shown in the message</td>",
"rst_description": "*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message\n",
"name": "hide_url",
"required": false
},
{
"type": "String",
"description": "Short description of the result",
@ -98,6 +90,18 @@
"rst_description": "*Optional*. Thumbnail height\n",
"name": "thumbnail_height",
"required": false
},
{
"type": "Boolean",
"description": "Pass True if you don't want the URL to be shown in the message",
"html_description": "<td><em>Optional</em>. Pass <em>True</em> if you don't want the URL to be shown in the message</td>",
"rst_description": "*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message\n",
"name": "hide_url",
"required": false,
"deprecated": {
"version": "8.2",
"release_date": "2025-01-01"
}
}
],
"category": "types"

View file

@ -29,9 +29,9 @@
},
{
"type": "String",
"description": "A valid URL for the GIF file. File size must not exceed 1MB",
"html_description": "<td>A valid URL for the GIF file. File size must not exceed 1MB</td>",
"rst_description": "A valid URL for the GIF file. File size must not exceed 1MB\n",
"description": "A valid URL for the GIF file",
"html_description": "<td>A valid URL for the GIF file</td>",
"rst_description": "A valid URL for the GIF file\n",
"name": "gif_url",
"required": true
},

View file

@ -29,9 +29,9 @@
},
{
"type": "String",
"description": "A valid URL for the MPEG4 file. File size must not exceed 1MB",
"html_description": "<td>A valid URL for the MPEG4 file. File size must not exceed 1MB</td>",
"rst_description": "A valid URL for the MPEG4 file. File size must not exceed 1MB\n",
"description": "A valid URL for the MPEG4 file",
"html_description": "<td>A valid URL for the MPEG4 file</td>",
"rst_description": "A valid URL for the MPEG4 file\n",
"name": "mpeg4_url",
"required": true
},

View file

@ -21,9 +21,9 @@
},
{
"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",
"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
},

6
CHANGES/1623.feature.rst Normal file
View file

@ -0,0 +1,6 @@
Added full support of the `Bot API 8.2 <https://core.telegram.org/bots/api-changelog#january-1-2025>`_
- Added the methods :class:`aiogram.methods.verify_user.VerifyUser`, :class:`aiogram.methods.verify_chat.VerifyChat`, :class:`aiogram.methods.remove_user_verification.RemoveUserVerification` and :class:`aiogram.methods.remove_chat_verification.RemoveChatVerification`, allowing bots to manage verifications on behalf of an organization.
- Added the field :code:`upgrade_star_count` to the class :class:`aiogram.types.gift.Gift`.
- Added the parameter :code:`pay_for_upgrade` to the method :class:`aiogram.methods.send_gift.SendGift`.
- Removed the field :code:`hide_url` from the class :class:`aiogram.types.inline_query_result_article.InlineQueryResultArticle`. Pass an empty string as :code:`url` instead.

View file

@ -93,6 +93,8 @@ from ..methods import (
PinChatMessage,
PromoteChatMember,
RefundStarPayment,
RemoveChatVerification,
RemoveUserVerification,
ReopenForumTopic,
ReopenGeneralForumTopic,
ReplaceStickerInSet,
@ -154,6 +156,8 @@ from ..methods import (
UnpinAllGeneralForumTopicMessages,
UnpinChatMessage,
UploadStickerFile,
VerifyChat,
VerifyUser,
)
from ..types import (
BotCommand,
@ -3816,7 +3820,7 @@ class Bot:
request_timeout: Optional[int] = None,
) -> bool:
"""
Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns :code:`True` on success.
Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request (a request with response `HTTP status code <https://en.wikipedia.org/wiki/List_of_HTTP_status_codes>`_ different from :code:`2XY`), we will repeat the request and give up after a reasonable amount of attempts. Returns :code:`True` on success.
If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter *secret_token*. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.
**Notes**
@ -4373,8 +4377,8 @@ class Bot:
:param name: Sticker set name
:param user_id: User identifier of the sticker set owner
:param format: Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **WEBM** video
:param thumbnail: A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-requirements>`_`https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-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-requirements <https://core.telegram.org/stickers#video-requirements>`_`https://core.telegram.org/stickers#video-requirements <https://core.telegram.org/stickers#video-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 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#animation-requirements <https://core.telegram.org/stickers#animation-requirements>`_`https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-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-requirements <https://core.telegram.org/stickers#video-requirements>`_`https://core.telegram.org/stickers#video-requirements <https://core.telegram.org/stickers#video-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
:return: Returns :code:`True` on success.
"""
@ -4936,6 +4940,7 @@ class Bot:
self,
user_id: int,
gift_id: str,
pay_for_upgrade: Optional[bool] = None,
text: Optional[str] = None,
text_parse_mode: Optional[str] = None,
text_entities: Optional[list[MessageEntity]] = None,
@ -4948,6 +4953,7 @@ class Bot:
:param user_id: Unique identifier of the target user that will receive the gift
:param gift_id: Identifier of the gift
:param pay_for_upgrade: Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
:param text: Text that will be shown along with the gift; 0-255 characters
:param text_parse_mode: Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
@ -4958,6 +4964,7 @@ class Bot:
call = SendGift(
user_id=user_id,
gift_id=gift_id,
pay_for_upgrade=pay_for_upgrade,
text=text,
text_parse_mode=text_parse_mode,
text_entities=text_entities,
@ -4991,3 +4998,89 @@ class Bot:
emoji_status_expiration_date=emoji_status_expiration_date,
)
return await self(call, request_timeout=request_timeout)
async def remove_chat_verification(
self,
chat_id: Union[int, str],
request_timeout: Optional[int] = None,
) -> bool:
"""
Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#removechatverification
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = RemoveChatVerification(
chat_id=chat_id,
)
return await self(call, request_timeout=request_timeout)
async def remove_user_verification(
self,
user_id: int,
request_timeout: Optional[int] = None,
) -> bool:
"""
Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#removeuserverification
:param user_id: Unique identifier of the target user
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = RemoveUserVerification(
user_id=user_id,
)
return await self(call, request_timeout=request_timeout)
async def verify_chat(
self,
chat_id: Union[int, str],
custom_description: Optional[str] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#verifychat
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = VerifyChat(
chat_id=chat_id,
custom_description=custom_description,
)
return await self(call, request_timeout=request_timeout)
async def verify_user(
self,
user_id: int,
custom_description: Optional[str] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#verifyuser
:param user_id: Unique identifier of the target user
:param custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
:param request_timeout: Request timeout
:return: Returns :code:`True` on success.
"""
call = VerifyUser(
user_id=user_id,
custom_description=custom_description,
)
return await self(call, request_timeout=request_timeout)

View file

@ -70,6 +70,8 @@ from .log_out import LogOut
from .pin_chat_message import PinChatMessage
from .promote_chat_member import PromoteChatMember
from .refund_star_payment import RefundStarPayment
from .remove_chat_verification import RemoveChatVerification
from .remove_user_verification import RemoveUserVerification
from .reopen_forum_topic import ReopenForumTopic
from .reopen_general_forum_topic import ReopenGeneralForumTopic
from .replace_sticker_in_set import ReplaceStickerInSet
@ -130,6 +132,8 @@ from .unpin_all_forum_topic_messages import UnpinAllForumTopicMessages
from .unpin_all_general_forum_topic_messages import UnpinAllGeneralForumTopicMessages
from .unpin_chat_message import UnpinChatMessage
from .upload_sticker_file import UploadStickerFile
from .verify_chat import VerifyChat
from .verify_user import VerifyUser
__all__ = (
"AddStickerToSet",
@ -203,6 +207,8 @@ __all__ = (
"PinChatMessage",
"PromoteChatMember",
"RefundStarPayment",
"RemoveChatVerification",
"RemoveUserVerification",
"ReopenForumTopic",
"ReopenGeneralForumTopic",
"ReplaceStickerInSet",
@ -266,4 +272,6 @@ __all__ = (
"UnpinAllGeneralForumTopicMessages",
"UnpinChatMessage",
"UploadStickerFile",
"VerifyChat",
"VerifyUser",
)

View file

@ -0,0 +1,32 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Union
from .base import TelegramMethod
class RemoveChatVerification(TelegramMethod[bool]):
"""
Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#removechatverification
"""
__returning__ = bool
__api_method__ = "removeChatVerification"
chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__, *, chat_id: Union[int, 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__(chat_id=chat_id, **__pydantic_kwargs)

View file

@ -0,0 +1,30 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from .base import TelegramMethod
class RemoveUserVerification(TelegramMethod[bool]):
"""
Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#removeuserverification
"""
__returning__ = bool
__api_method__ = "removeUserVerification"
user_id: int
"""Unique identifier of the target user"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(__pydantic__self__, *, user_id: int, **__pydantic_kwargs: Any) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(user_id=user_id, **__pydantic_kwargs)

View file

@ -20,6 +20,8 @@ class SendGift(TelegramMethod[bool]):
"""Unique identifier of the target user that will receive the gift"""
gift_id: str
"""Identifier of the gift"""
pay_for_upgrade: Optional[bool] = None
"""Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver"""
text: Optional[str] = None
"""Text that will be shown along with the gift; 0-255 characters"""
text_parse_mode: Optional[str] = None
@ -36,6 +38,7 @@ class SendGift(TelegramMethod[bool]):
*,
user_id: int,
gift_id: str,
pay_for_upgrade: Optional[bool] = None,
text: Optional[str] = None,
text_parse_mode: Optional[str] = None,
text_entities: Optional[list[MessageEntity]] = None,
@ -48,6 +51,7 @@ class SendGift(TelegramMethod[bool]):
super().__init__(
user_id=user_id,
gift_id=gift_id,
pay_for_upgrade=pay_for_upgrade,
text=text,
text_parse_mode=text_parse_mode,
text_entities=text_entities,

View file

@ -21,9 +21,9 @@ class SetStickerSetThumbnail(TelegramMethod[bool]):
user_id: int
"""User identifier of the sticker set owner"""
format: str
"""Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **WEBM** video"""
"""Format of the thumbnail, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, or 'video' for a **.WEBM** video"""
thumbnail: Optional[Union[InputFile, str]] = None
"""A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-requirements>`_`https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-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-requirements <https://core.telegram.org/stickers#video-requirements>`_`https://core.telegram.org/stickers#video-requirements <https://core.telegram.org/stickers#video-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#animation-requirements <https://core.telegram.org/stickers#animation-requirements>`_`https://core.telegram.org/stickers#animation-requirements <https://core.telegram.org/stickers#animation-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-requirements <https://core.telegram.org/stickers#video-requirements>`_`https://core.telegram.org/stickers#video-requirements <https://core.telegram.org/stickers#video-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."""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!

View file

@ -8,7 +8,7 @@ from .base import TelegramMethod
class SetWebhook(TelegramMethod[bool]):
"""
Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns :code:`True` on success.
Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request (a request with response `HTTP status code <https://en.wikipedia.org/wiki/List_of_HTTP_status_codes>`_ different from :code:`2XY`), we will repeat the request and give up after a reasonable amount of attempts. Returns :code:`True` on success.
If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter *secret_token*. If specified, the request will contain a header 'X-Telegram-Bot-Api-Secret-Token' with the secret token as content.
**Notes**

View file

@ -0,0 +1,40 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional, Union
from .base import TelegramMethod
class VerifyChat(TelegramMethod[bool]):
"""
Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#verifychat
"""
__returning__ = bool
__api_method__ = "verifyChat"
chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
custom_description: Optional[str] = None
"""Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description."""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
chat_id: Union[int, str],
custom_description: Optional[str] = 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__(
chat_id=chat_id, custom_description=custom_description, **__pydantic_kwargs
)

View file

@ -0,0 +1,40 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from .base import TelegramMethod
class VerifyUser(TelegramMethod[bool]):
"""
Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success.
Source: https://core.telegram.org/bots/api#verifyuser
"""
__returning__ = bool
__api_method__ = "verifyUser"
user_id: int
"""Unique identifier of the target user"""
custom_description: Optional[str] = None
"""Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description."""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
user_id: int,
custom_description: Optional[str] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(
user_id=user_id, custom_description=custom_description, **__pydantic_kwargs
)

View file

@ -13,7 +13,7 @@ if TYPE_CHECKING:
class BackgroundTypePattern(BackgroundType):
"""
The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.
The background is a .PNG or .TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.
Source: https://core.telegram.org/bots/api#backgroundtypepattern
"""

View file

@ -21,6 +21,8 @@ class Gift(TelegramObject):
"""The sticker that represents the gift"""
star_count: int
"""The number of Telegram Stars that must be paid to send the sticker"""
upgrade_star_count: Optional[int] = None
"""*Optional*. The number of Telegram Stars that must be paid to upgrade the gift to a unique one"""
total_count: Optional[int] = None
"""*Optional*. The total number of the gifts of this type that can be sent; for limited gifts only"""
remaining_count: Optional[int] = None
@ -36,6 +38,7 @@ class Gift(TelegramObject):
id: str,
sticker: Sticker,
star_count: int,
upgrade_star_count: Optional[int] = None,
total_count: Optional[int] = None,
remaining_count: Optional[int] = None,
**__pydantic_kwargs: Any,
@ -48,6 +51,7 @@ class Gift(TelegramObject):
id=id,
sticker=sticker,
star_count=star_count,
upgrade_star_count=upgrade_star_count,
total_count=total_count,
remaining_count=remaining_count,
**__pydantic_kwargs,

View file

@ -2,6 +2,8 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
from pydantic import Field
from ..enums import InlineQueryResultType
from .inline_query_result import InlineQueryResult
@ -39,8 +41,6 @@ class InlineQueryResultArticle(InlineQueryResult):
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
url: Optional[str] = None
"""*Optional*. URL of the result"""
hide_url: Optional[bool] = None
"""*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message"""
description: Optional[str] = None
"""*Optional*. Short description of the result"""
thumbnail_url: Optional[str] = None
@ -49,6 +49,11 @@ class InlineQueryResultArticle(InlineQueryResult):
"""*Optional*. Thumbnail width"""
thumbnail_height: Optional[int] = None
"""*Optional*. Thumbnail height"""
hide_url: Optional[bool] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message
.. deprecated:: API:8.2
https://core.telegram.org/bots/api-changelog#january-1-2025"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
@ -69,11 +74,11 @@ class InlineQueryResultArticle(InlineQueryResult):
],
reply_markup: Optional[InlineKeyboardMarkup] = None,
url: Optional[str] = None,
hide_url: Optional[bool] = None,
description: Optional[str] = None,
thumbnail_url: Optional[str] = None,
thumbnail_width: Optional[int] = None,
thumbnail_height: Optional[int] = None,
hide_url: Optional[bool] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
@ -87,10 +92,10 @@ class InlineQueryResultArticle(InlineQueryResult):
input_message_content=input_message_content,
reply_markup=reply_markup,
url=url,
hide_url=hide_url,
description=description,
thumbnail_url=thumbnail_url,
thumbnail_width=thumbnail_width,
thumbnail_height=thumbnail_height,
hide_url=hide_url,
**__pydantic_kwargs,
)

View file

@ -28,7 +28,7 @@ class InlineQueryResultGif(InlineQueryResult):
id: str
"""Unique identifier for this result, 1-64 bytes"""
gif_url: str
"""A valid URL for the GIF file. File size must not exceed 1MB"""
"""A valid URL for the GIF file"""
thumbnail_url: str
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
gif_width: Optional[int] = None

View file

@ -28,7 +28,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
id: str
"""Unique identifier for this result, 1-64 bytes"""
mpeg4_url: str
"""A valid URL for the MPEG4 file. File size must not exceed 1MB"""
"""A valid URL for the MPEG4 file"""
thumbnail_url: str
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
mpeg4_width: Optional[int] = None

View file

@ -19,7 +19,7 @@ class InputSticker(TelegramObject):
sticker: Union[InputFile, str]
"""The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » <sending-files>`"""
format: str
"""Format of the added sticker, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, 'video' for a **WEBM** video"""
"""Format of the added sticker, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, 'video' for a **.WEBM** video"""
emoji_list: list[str]
"""List of 1-20 emoji associated with the sticker"""
mask_position: Optional[MaskPosition] = None

View file

@ -18,6 +18,8 @@ Stickers
get_available_gifts
get_custom_emoji_stickers
get_sticker_set
remove_chat_verification
remove_user_verification
replace_sticker_in_set
send_gift
send_sticker
@ -29,6 +31,8 @@ Stickers
set_sticker_set_thumbnail
set_sticker_set_title
upload_sticker_file
verify_chat
verify_user
Available methods
=================

View file

@ -0,0 +1,45 @@
######################
removeChatVerification
######################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.remove_chat_verification
:members:
:member-order: bysource
:undoc-members: True
:exclude-members: model_config,model_fields
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.remove_chat_verification(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.remove_chat_verification import RemoveChatVerification`
- alias: :code:`from aiogram.methods import RemoveChatVerification`
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(RemoveChatVerification(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return RemoveChatVerification(...)

View file

@ -0,0 +1,45 @@
######################
removeUserVerification
######################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.remove_user_verification
:members:
:member-order: bysource
:undoc-members: True
:exclude-members: model_config,model_fields
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.remove_user_verification(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.remove_user_verification import RemoveUserVerification`
- alias: :code:`from aiogram.methods import RemoveUserVerification`
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(RemoveUserVerification(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return RemoveUserVerification(...)

View file

@ -0,0 +1,45 @@
##########
verifyChat
##########
Returns: :obj:`bool`
.. automodule:: aiogram.methods.verify_chat
:members:
:member-order: bysource
:undoc-members: True
:exclude-members: model_config,model_fields
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.verify_chat(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.verify_chat import VerifyChat`
- alias: :code:`from aiogram.methods import VerifyChat`
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(VerifyChat(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return VerifyChat(...)

View file

@ -0,0 +1,45 @@
##########
verifyUser
##########
Returns: :obj:`bool`
.. automodule:: aiogram.methods.verify_user
:members:
:member-order: bysource
:undoc-members: True
:exclude-members: model_config,model_fields
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.verify_user(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.verify_user import VerifyUser`
- alias: :code:`from aiogram.methods import VerifyUser`
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(VerifyUser(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return VerifyUser(...)

View file

@ -41,7 +41,7 @@ class TestAiohttpSession:
async def test_create_proxy_session(self):
auth = aiohttp.BasicAuth("login", "password", "encoding")
async with AiohttpSession(proxy=("socks5://proxy.url/", auth)) as session:
async with AiohttpSession(proxy=("socks5://proxy.url:1080/", auth)) as session:
assert session._connector_type == aiohttp_socks.ProxyConnector
assert isinstance(session._connector_init, dict)
@ -51,7 +51,7 @@ class TestAiohttpSession:
assert isinstance(aiohttp_session.connector, aiohttp_socks.ProxyConnector)
async def test_create_proxy_session_proxy_url(self):
async with AiohttpSession(proxy="socks4://proxy.url/") as session:
async with AiohttpSession(proxy="socks4://proxy.url:1080/") as session:
assert isinstance(session.proxy, str)
assert isinstance(session._connector_init, dict)
@ -62,8 +62,8 @@ class TestAiohttpSession:
async def test_create_proxy_session_chained_proxies(self):
proxy_chain = [
"socks4://proxy.url/",
"socks5://proxy.url/",
"socks4://proxy.url:1080/",
"socks5://proxy.url:1080/",
"http://user:password@127.0.0.1:3128",
]
async with AiohttpSession(proxy=proxy_chain) as session:
@ -90,7 +90,7 @@ class TestAiohttpSession:
assert session._should_reset_connector is False
assert session.proxy is None
session.proxy = "socks5://auth:auth@proxy.url/"
session.proxy = "socks5://auth:auth@proxy.url:1080/"
assert session._should_reset_connector
await session.create_session()
assert session._should_reset_connector is False

View file

@ -0,0 +1,12 @@
from aiogram.methods import RemoveChatVerification, VerifyChat
from aiogram.types import Poll
from tests.mocked_bot import MockedBot
class TestRemoveChatVerification:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(RemoveChatVerification, ok=True, result=True)
response: bool = await bot.remove_chat_verification(chat_id=42)
request = bot.get_request()
assert response == prepare_result.result

View file

@ -0,0 +1,12 @@
from aiogram.methods import RemoveUserVerification, VerifyChat
from aiogram.types import Poll
from tests.mocked_bot import MockedBot
class TestRemoveUserVerification:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(RemoveUserVerification, ok=True, result=True)
response: bool = await bot.remove_user_verification(user_id=42)
request = bot.get_request()
assert response == prepare_result.result

View file

@ -0,0 +1,12 @@
from aiogram.methods import VerifyChat
from aiogram.types import Poll
from tests.mocked_bot import MockedBot
class TestVerifyChat:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(VerifyChat, ok=True, result=True)
response: bool = await bot.verify_chat(chat_id=42)
request = bot.get_request()
assert response == prepare_result.result

View file

@ -0,0 +1,12 @@
from aiogram.methods import VerifyChat, VerifyUser
from aiogram.types import Poll
from tests.mocked_bot import MockedBot
class TestVerifyUser:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(VerifyUser, ok=True, result=True)
response: bool = await bot.verify_user(user_id=42)
request = bot.get_request()
assert response == prepare_result.result