mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 16:15:51 +00:00
Bot API 6.6 (#1139)
* Added basic support of Bot API 6.6 * Update descriptions * Added StickerFormat enum * Bump version * Refresh from docs * Fixed CommandStart * Fixed files uploading * Cover new functionality * Added changelog * Update texts
This commit is contained in:
parent
5adaf7a567
commit
6570d0bab1
218 changed files with 7687 additions and 1741 deletions
|
|
@ -1 +1 @@
|
|||
6.5
|
||||
6.6
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
name: InlineQueryResultType
|
||||
description: |
|
||||
The part of the face relative to which the mask should be placed.
|
||||
Type of inline query result
|
||||
|
||||
Source: https://core.telegram.org/bots/api#maskposition
|
||||
Source: https://core.telegram.org/bots/api#inlinequeryresult
|
||||
multi_parse:
|
||||
attribute: type
|
||||
regexp: "must be ([a-z_]+)"
|
||||
|
|
|
|||
10
.butcher/enums/StickerFormat.yml
Normal file
10
.butcher/enums/StickerFormat.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
name: StickerFormat
|
||||
description: |
|
||||
Format of the sticker
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createnewstickerset
|
||||
parse:
|
||||
category: methods
|
||||
entity: createNewStickerSet
|
||||
attribute: sticker_format
|
||||
regexp: "'([a-z_]+)'"
|
||||
|
|
@ -9,9 +9,9 @@
|
|||
"object": {
|
||||
"anchor": "addstickertoset",
|
||||
"name": "addStickerToSet",
|
||||
"description": "Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker, tgs_sticker, or webm_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.",
|
||||
"html_description": "<p>Use this method to add a new sticker to a set created by the bot. You <strong>must</strong> use exactly one of the fields <em>png_sticker</em>, <em>tgs_sticker</em>, or <em>webm_sticker</em>. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to add a new sticker to a set created by the bot. You **must** use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success.",
|
||||
"description": "Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.",
|
||||
"html_description": "<p>Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
|
|
@ -30,44 +30,12 @@
|
|||
"name": "name"
|
||||
},
|
||||
{
|
||||
"type": "InputFile or String",
|
||||
"required": false,
|
||||
"description": "PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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",
|
||||
"html_description": "<td><strong>PNG</strong> image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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 »</a></td>",
|
||||
"rst_description": "**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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>`\n",
|
||||
"name": "png_sticker"
|
||||
},
|
||||
{
|
||||
"type": "InputFile",
|
||||
"required": false,
|
||||
"description": "TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#animated-sticker-requirements for technical requirements",
|
||||
"html_description": "<td><strong>TGS</strong> animation with the sticker, uploaded using multipart/form-data. See <a href=\"/stickers#animated-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#animated-sticker-requirements\">https://core.telegram.org/stickers#animated-sticker-requirements</a> for technical requirements</td>",
|
||||
"rst_description": "**TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for technical requirements\n",
|
||||
"name": "tgs_sticker"
|
||||
},
|
||||
{
|
||||
"type": "InputFile",
|
||||
"required": false,
|
||||
"description": "WEBM video with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#video-sticker-requirements for technical requirements",
|
||||
"html_description": "<td><strong>WEBM</strong> video with the sticker, uploaded using multipart/form-data. See <a href=\"/stickers#video-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#video-sticker-requirements\">https://core.telegram.org/stickers#video-sticker-requirements</a> for technical requirements</td>",
|
||||
"rst_description": "**WEBM** video with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for technical requirements\n",
|
||||
"name": "webm_sticker"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"type": "InputSticker",
|
||||
"required": true,
|
||||
"description": "One or more emoji corresponding to the sticker",
|
||||
"html_description": "<td>One or more emoji corresponding to the sticker</td>",
|
||||
"rst_description": "One or more emoji corresponding to the sticker\n",
|
||||
"name": "emojis"
|
||||
},
|
||||
{
|
||||
"type": "MaskPosition",
|
||||
"required": false,
|
||||
"description": "A JSON-serialized object for position where the mask should be placed on faces",
|
||||
"html_description": "<td>A JSON-serialized object for position where the mask should be placed on faces</td>",
|
||||
"rst_description": "A JSON-serialized object for position where the mask should be placed on faces\n",
|
||||
"name": "mask_position"
|
||||
"description": "A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.",
|
||||
"html_description": "<td>A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.</td>",
|
||||
"rst_description": "A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.\n",
|
||||
"name": "sticker"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
"object": {
|
||||
"anchor": "createnewstickerset",
|
||||
"name": "createNewStickerSet",
|
||||
"description": "Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker, tgs_sticker, or webm_sticker. Returns True on success.",
|
||||
"html_description": "<p>Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You <strong>must</strong> use exactly one of the fields <em>png_sticker</em>, <em>tgs_sticker</em>, or <em>webm_sticker</em>. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You **must** use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*. Returns :code:`True` on success.",
|
||||
"description": "Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns True on success.",
|
||||
"html_description": "<p>Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
|
|
@ -38,52 +38,36 @@
|
|||
"name": "title"
|
||||
},
|
||||
{
|
||||
"type": "InputFile or String",
|
||||
"required": false,
|
||||
"description": "PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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",
|
||||
"html_description": "<td><strong>PNG</strong> image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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 »</a></td>",
|
||||
"rst_description": "**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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>`\n",
|
||||
"name": "png_sticker"
|
||||
},
|
||||
{
|
||||
"type": "InputFile",
|
||||
"required": false,
|
||||
"description": "TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#animated-sticker-requirements for technical requirements",
|
||||
"html_description": "<td><strong>TGS</strong> animation with the sticker, uploaded using multipart/form-data. See <a href=\"/stickers#animated-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#animated-sticker-requirements\">https://core.telegram.org/stickers#animated-sticker-requirements</a> for technical requirements</td>",
|
||||
"rst_description": "**TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for technical requirements\n",
|
||||
"name": "tgs_sticker"
|
||||
},
|
||||
{
|
||||
"type": "InputFile",
|
||||
"required": false,
|
||||
"description": "WEBM video with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#video-sticker-requirements for technical requirements",
|
||||
"html_description": "<td><strong>WEBM</strong> video with the sticker, uploaded using multipart/form-data. See <a href=\"/stickers#video-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#video-sticker-requirements\">https://core.telegram.org/stickers#video-sticker-requirements</a> for technical requirements</td>",
|
||||
"rst_description": "**WEBM** video with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for technical requirements\n",
|
||||
"name": "webm_sticker"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "Type of stickers in the set, pass 'regular' or 'mask'. Custom emoji sticker sets can't be created via the Bot API at the moment. By default, a regular sticker set is created.",
|
||||
"html_description": "<td>Type of stickers in the set, pass “regular” or “mask”. Custom emoji sticker sets can't be created via the Bot API at the moment. By default, a regular sticker set is created.</td>",
|
||||
"rst_description": "Type of stickers in the set, pass 'regular' or 'mask'. Custom emoji sticker sets can't be created via the Bot API at the moment. By default, a regular sticker set is created.\n",
|
||||
"name": "sticker_type"
|
||||
"type": "Array of InputSticker",
|
||||
"required": true,
|
||||
"description": "A JSON-serialized list of 1-50 initial stickers to be added to the sticker set",
|
||||
"html_description": "<td>A JSON-serialized list of 1-50 initial stickers to be added to the sticker set</td>",
|
||||
"rst_description": "A JSON-serialized list of 1-50 initial stickers to be added to the sticker set\n",
|
||||
"name": "stickers"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "One or more emoji corresponding to the sticker",
|
||||
"html_description": "<td>One or more emoji corresponding to the sticker</td>",
|
||||
"rst_description": "One or more emoji corresponding to the sticker\n",
|
||||
"name": "emojis"
|
||||
"description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'",
|
||||
"html_description": "<td>Format of stickers in the set, must be one of “static”, “animated”, “video”</td>",
|
||||
"rst_description": "Format of stickers in the set, must be one of 'static', 'animated', 'video'\n",
|
||||
"name": "sticker_format"
|
||||
},
|
||||
{
|
||||
"type": "MaskPosition",
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "A JSON-serialized object for position where the mask should be placed on faces",
|
||||
"html_description": "<td>A JSON-serialized object for position where the mask should be placed on faces</td>",
|
||||
"rst_description": "A JSON-serialized object for position where the mask should be placed on faces\n",
|
||||
"name": "mask_position"
|
||||
"description": "Type of stickers in the set, pass 'regular', 'mask', or 'custom_emoji'. By default, a regular sticker set is created.",
|
||||
"html_description": "<td>Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created.</td>",
|
||||
"rst_description": "Type of stickers in the set, pass 'regular', 'mask', or 'custom_emoji'. By default, a regular sticker set is created.\n",
|
||||
"name": "sticker_type"
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"required": false,
|
||||
"description": "Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only",
|
||||
"html_description": "<td>Pass <em>True</em> if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only</td>",
|
||||
"rst_description": "Pass :code:`True` if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only\n",
|
||||
"name": "needs_repainting"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
|
|
|
|||
27
.butcher/methods/deleteStickerSet/entity.json
Normal file
27
.butcher/methods/deleteStickerSet/entity.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Stickers",
|
||||
"anchor": "stickers"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "deletestickerset",
|
||||
"name": "deleteStickerSet",
|
||||
"description": "Use this method to delete a sticker set that was created by the bot. Returns True on success.",
|
||||
"html_description": "<p>Use this method to delete a sticker set that was created by the bot. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to delete a sticker set that was created by the bot. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "Sticker set name",
|
||||
"html_description": "<td>Sticker set name</td>",
|
||||
"rst_description": "Sticker set name\n",
|
||||
"name": "name"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available methods",
|
||||
"anchor": "available-methods"
|
||||
"title": "Updating messages",
|
||||
"anchor": "updating-messages"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "editmessagelivelocation",
|
||||
|
|
|
|||
27
.butcher/methods/getMyDescription/entity.json
Normal file
27
.butcher/methods/getMyDescription/entity.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available methods",
|
||||
"anchor": "available-methods"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "getmydescription",
|
||||
"name": "getMyDescription",
|
||||
"description": "Use this method to get the current bot description for the given user language. Returns BotDescription on success.",
|
||||
"html_description": "<p>Use this method to get the current bot description for the given user language. Returns <a href=\"#botdescription\">BotDescription</a> on success.</p>",
|
||||
"rst_description": "Use this method to get the current bot description for the given user language. Returns :class:`aiogram.types.bot_description.BotDescription` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "A two-letter ISO 639-1 language code or an empty string",
|
||||
"html_description": "<td>A two-letter ISO 639-1 language code or an empty string</td>",
|
||||
"rst_description": "A two-letter ISO 639-1 language code or an empty string\n",
|
||||
"name": "language_code"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
27
.butcher/methods/getMyShortDescription/entity.json
Normal file
27
.butcher/methods/getMyShortDescription/entity.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available methods",
|
||||
"anchor": "available-methods"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "getmyshortdescription",
|
||||
"name": "getMyShortDescription",
|
||||
"description": "Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.",
|
||||
"html_description": "<p>Use this method to get the current bot short description for the given user language. Returns <a href=\"#botshortdescription\">BotShortDescription</a> on success.</p>",
|
||||
"rst_description": "Use this method to get the current bot short description for the given user language. Returns :class:`aiogram.types.bot_short_description.BotShortDescription` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "A two-letter ISO 639-1 language code or an empty string",
|
||||
"html_description": "<td>A two-letter ISO 639-1 language code or an empty string</td>",
|
||||
"rst_description": "A two-letter ISO 639-1 language code or an empty string\n",
|
||||
"name": "language_code"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
"description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
|
||||
"html_description": "<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "thumb"
|
||||
"name": "thumbnail"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
"description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
|
||||
"html_description": "<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "thumb"
|
||||
"name": "thumbnail"
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
"description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
|
||||
"html_description": "<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "thumb"
|
||||
"name": "thumbnail"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -32,11 +32,19 @@
|
|||
{
|
||||
"type": "InputFile or String",
|
||||
"required": true,
|
||||
"description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files",
|
||||
"html_description": "<td>Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. More information on Sending Files. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.",
|
||||
"html_description": "<td>Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. <a href=\"#sending-files\">More information on Sending Files »</a>. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.</td>",
|
||||
"rst_description": "Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.\n",
|
||||
"name": "sticker"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "Emoji associated with the sticker; only for just uploaded stickers",
|
||||
"html_description": "<td>Emoji associated with the sticker; only for just uploaded stickers</td>",
|
||||
"rst_description": "Emoji associated with the sticker; only for just uploaded stickers\n",
|
||||
"name": "emoji"
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
"required": false,
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
"description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
|
||||
"html_description": "<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "thumb"
|
||||
"name": "thumbnail"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
"description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
|
||||
"html_description": "<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "thumb"
|
||||
"name": "thumbnail"
|
||||
},
|
||||
{
|
||||
"type": "Boolean",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Stickers",
|
||||
"anchor": "stickers"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "setcustomemojistickersetthumbnail",
|
||||
"name": "setCustomEmojiStickerSetThumbnail",
|
||||
"description": "Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.",
|
||||
"html_description": "<p>Use this method to set the thumbnail of a custom emoji sticker set. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to set the thumbnail of a custom emoji sticker set. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "Sticker set name",
|
||||
"html_description": "<td>Sticker set name</td>",
|
||||
"rst_description": "Sticker set name\n",
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.",
|
||||
"html_description": "<td>Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.</td>",
|
||||
"rst_description": "Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.\n",
|
||||
"name": "custom_emoji_id"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
|
|
@ -9,9 +9,9 @@
|
|||
"object": {
|
||||
"anchor": "setmydefaultadministratorrights",
|
||||
"name": "setMyDefaultAdministratorRights",
|
||||
"description": "Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns True on success.",
|
||||
"html_description": "<p>Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns :code:`True` on success.",
|
||||
"description": "Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success.",
|
||||
"html_description": "<p>Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "ChatAdministratorRights",
|
||||
|
|
|
|||
35
.butcher/methods/setMyDescription/entity.json
Normal file
35
.butcher/methods/setMyDescription/entity.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available methods",
|
||||
"anchor": "available-methods"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "setmydescription",
|
||||
"name": "setMyDescription",
|
||||
"description": "Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success.",
|
||||
"html_description": "<p>Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.",
|
||||
"html_description": "<td>New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.</td>",
|
||||
"rst_description": "New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.\n",
|
||||
"name": "description"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.",
|
||||
"html_description": "<td>A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.</td>",
|
||||
"rst_description": "A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.\n",
|
||||
"name": "language_code"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
35
.butcher/methods/setMyShortDescription/entity.json
Normal file
35
.butcher/methods/setMyShortDescription/entity.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available methods",
|
||||
"anchor": "available-methods"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "setmyshortdescription",
|
||||
"name": "setMyShortDescription",
|
||||
"description": "Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success.",
|
||||
"html_description": "<p>Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.",
|
||||
"html_description": "<td>New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.</td>",
|
||||
"rst_description": "New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.\n",
|
||||
"name": "short_description"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.",
|
||||
"html_description": "<td>A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.</td>",
|
||||
"rst_description": "A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.\n",
|
||||
"name": "language_code"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
35
.butcher/methods/setStickerEmojiList/entity.json
Normal file
35
.butcher/methods/setStickerEmojiList/entity.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Stickers",
|
||||
"anchor": "stickers"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "setstickeremojilist",
|
||||
"name": "setStickerEmojiList",
|
||||
"description": "Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.",
|
||||
"html_description": "<p>Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "File identifier of the sticker",
|
||||
"html_description": "<td>File identifier of the sticker</td>",
|
||||
"rst_description": "File identifier of the sticker\n",
|
||||
"name": "sticker"
|
||||
},
|
||||
{
|
||||
"type": "Array of String",
|
||||
"required": true,
|
||||
"description": "A JSON-serialized list of 1-20 emoji associated with the sticker",
|
||||
"html_description": "<td>A JSON-serialized list of 1-20 emoji associated with the sticker</td>",
|
||||
"rst_description": "A JSON-serialized list of 1-20 emoji associated with the sticker\n",
|
||||
"name": "emoji_list"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
35
.butcher/methods/setStickerKeywords/entity.json
Normal file
35
.butcher/methods/setStickerKeywords/entity.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Stickers",
|
||||
"anchor": "stickers"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "setstickerkeywords",
|
||||
"name": "setStickerKeywords",
|
||||
"description": "Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.",
|
||||
"html_description": "<p>Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "File identifier of the sticker",
|
||||
"html_description": "<td>File identifier of the sticker</td>",
|
||||
"rst_description": "File identifier of the sticker\n",
|
||||
"name": "sticker"
|
||||
},
|
||||
{
|
||||
"type": "Array of String",
|
||||
"required": false,
|
||||
"description": "A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters",
|
||||
"html_description": "<td>A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters</td>",
|
||||
"rst_description": "A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters\n",
|
||||
"name": "keywords"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
35
.butcher/methods/setStickerMaskPosition/entity.json
Normal file
35
.butcher/methods/setStickerMaskPosition/entity.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Stickers",
|
||||
"anchor": "stickers"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "setstickermaskposition",
|
||||
"name": "setStickerMaskPosition",
|
||||
"description": "Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns True on success.",
|
||||
"html_description": "<p>Use this method to change the <a href=\"#maskposition\">mask position</a> of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to change the `mask position <https://core.telegram.org/bots/api#maskposition>`_ of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "File identifier of the sticker",
|
||||
"html_description": "<td>File identifier of the sticker</td>",
|
||||
"rst_description": "File identifier of the sticker\n",
|
||||
"name": "sticker"
|
||||
},
|
||||
{
|
||||
"type": "MaskPosition",
|
||||
"required": false,
|
||||
"description": "A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position.",
|
||||
"html_description": "<td>A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position.</td>",
|
||||
"rst_description": "A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position.\n",
|
||||
"name": "mask_position"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Stickers",
|
||||
"anchor": "stickers"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "setstickersetthumb",
|
||||
"name": "setStickerSetThumb",
|
||||
"description": "Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only. Returns True on success.",
|
||||
"html_description": "<p>Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "Sticker set name",
|
||||
"html_description": "<td>Sticker set name</td>",
|
||||
"rst_description": "Sticker set name\n",
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"required": true,
|
||||
"description": "User identifier of the sticker set owner",
|
||||
"html_description": "<td>User identifier of the sticker set owner</td>",
|
||||
"rst_description": "User identifier of the sticker set owner\n",
|
||||
"name": "user_id"
|
||||
},
|
||||
{
|
||||
"type": "InputFile or String",
|
||||
"required": false,
|
||||
"description": "A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements, or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files. Animated sticker set thumbnails can't be uploaded via HTTP URL.",
|
||||
"html_description": "<td>A <strong>PNG</strong> image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a <strong>TGS</strong> animation with the thumbnail up to 32 kilobytes in size; see <a href=\"/stickers#animated-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#animated-sticker-requirements\">https://core.telegram.org/stickers#animated-sticker-requirements</a> for animated sticker technical requirements, or a <strong>WEBM</strong> video with the thumbnail up to 32 kilobytes in size; see <a href=\"/stickers#video-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#video-sticker-requirements\">https://core.telegram.org/stickers#video-sticker-requirements</a> for video sticker technical requirements. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href=\"#sending-files\">More information on Sending Files »</a>. Animated sticker set thumbnails can't be uploaded via HTTP URL.</td>",
|
||||
"rst_description": "A **PNG** image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a **TGS** animation with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for animated sticker technical requirements, or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Animated sticker set thumbnails can't be uploaded via HTTP URL.\n",
|
||||
"name": "thumb"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
43
.butcher/methods/setStickerSetThumbnail/entity.json
Normal file
43
.butcher/methods/setStickerSetThumbnail/entity.json
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Stickers",
|
||||
"anchor": "stickers"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "setstickersetthumbnail",
|
||||
"name": "setStickerSetThumbnail",
|
||||
"description": "Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns True on success.",
|
||||
"html_description": "<p>Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "Sticker set name",
|
||||
"html_description": "<td>Sticker set name</td>",
|
||||
"rst_description": "Sticker set name\n",
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"required": true,
|
||||
"description": "User identifier of the sticker set owner",
|
||||
"html_description": "<td>User identifier of the sticker set owner</td>",
|
||||
"rst_description": "User identifier of the sticker set owner\n",
|
||||
"name": "user_id"
|
||||
},
|
||||
{
|
||||
"type": "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#animated-sticker-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.",
|
||||
"html_description": "<td>A <strong>.WEBP</strong> or <strong>.PNG</strong> image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a <strong>.TGS</strong> animation with a thumbnail up to 32 kilobytes in size (see <a href=\"/stickers#animated-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#animated-sticker-requirements\">https://core.telegram.org/stickers#animated-sticker-requirements</a> for animated sticker technical requirements), or a <strong>WEBM</strong> video with the thumbnail up to 32 kilobytes in size; see <a href=\"/stickers#video-sticker-requirements\"/><a href=\"https://core.telegram.org/stickers#video-sticker-requirements\">https://core.telegram.org/stickers#video-sticker-requirements</a> for video sticker technical requirements. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href=\"#sending-files\">More information on Sending Files »</a>. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.</td>",
|
||||
"rst_description": "A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for animated sticker technical requirements), or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.\n",
|
||||
"name": "thumbnail"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
35
.butcher/methods/setStickerSetTitle/entity.json
Normal file
35
.butcher/methods/setStickerSetTitle/entity.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Stickers",
|
||||
"anchor": "stickers"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "setstickersettitle",
|
||||
"name": "setStickerSetTitle",
|
||||
"description": "Use this method to set the title of a created sticker set. Returns True on success.",
|
||||
"html_description": "<p>Use this method to set the title of a created sticker set. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to set the title of a created sticker set. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "Sticker set name",
|
||||
"html_description": "<td>Sticker set name</td>",
|
||||
"rst_description": "Sticker set name\n",
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "Sticker set title, 1-64 characters",
|
||||
"html_description": "<td>Sticker set title, 1-64 characters</td>",
|
||||
"rst_description": "Sticker set title, 1-64 characters\n",
|
||||
"name": "title"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available methods",
|
||||
"anchor": "available-methods"
|
||||
"title": "Updating messages",
|
||||
"anchor": "updating-messages"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "stopmessagelivelocation",
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
"object": {
|
||||
"anchor": "uploadstickerfile",
|
||||
"name": "uploadStickerFile",
|
||||
"description": "Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.",
|
||||
"html_description": "<p>Use this method to upload a .PNG file with a sticker for later use in <em>createNewStickerSet</em> and <em>addStickerToSet</em> methods (can be used multiple times). Returns the uploaded <a href=\"#file\">File</a> on success.</p>",
|
||||
"rst_description": "Use this method to upload a .PNG file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.",
|
||||
"description": "Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times). Returns the uploaded File on success.",
|
||||
"html_description": "<p>Use this method to upload a file with a sticker for later use in the <a href=\"#createnewstickerset\">createNewStickerSet</a> and <a href=\"#addstickertoset\">addStickerToSet</a> methods (the file can be used multiple times). Returns the uploaded <a href=\"#file\">File</a> on success.</p>",
|
||||
"rst_description": "Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet` and :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
|
|
@ -24,10 +24,18 @@
|
|||
{
|
||||
"type": "InputFile",
|
||||
"required": true,
|
||||
"description": "PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. More information on Sending Files",
|
||||
"html_description": "<td><strong>PNG</strong> image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "png_sticker"
|
||||
"description": "A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. More information on Sending Files",
|
||||
"html_description": "<td>A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See <a href=\"/stickers\"/><a href=\"https://core.telegram.org/stickers\">https://core.telegram.org/stickers</a> for technical requirements. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See `https://core.telegram.org/stickers <https://core.telegram.org/stickers>`_`https://core.telegram.org/stickers <https://core.telegram.org/stickers>`_ for technical requirements. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "sticker"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "Format of the sticker, must be one of 'static', 'animated', 'video'",
|
||||
"html_description": "<td>Format of the sticker, must be one of “static”, “animated”, “video”</td>",
|
||||
"rst_description": "Format of the sticker, must be one of 'static', 'animated', 'video'\n",
|
||||
"name": "sticker_format"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -58,7 +58,7 @@
|
|||
"description": "Animation thumbnail as defined by sender",
|
||||
"html_description": "<td><em>Optional</em>. Animation thumbnail as defined by sender</td>",
|
||||
"rst_description": "*Optional*. Animation thumbnail as defined by sender\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
"description": "Thumbnail of the album cover to which the music file belongs",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail of the album cover to which the music file belongs</td>",
|
||||
"rst_description": "*Optional*. Thumbnail of the album cover to which the music file belongs\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
|
|
|
|||
27
.butcher/types/BotDescription/entity.json
Normal file
27
.butcher/types/BotDescription/entity.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available types",
|
||||
"anchor": "available-types"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "botdescription",
|
||||
"name": "BotDescription",
|
||||
"description": "This object represents the bot's description.",
|
||||
"html_description": "<p>This object represents the bot's description.</p>",
|
||||
"rst_description": "This object represents the bot's description.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"description": "The bot's description",
|
||||
"html_description": "<td>The bot's description</td>",
|
||||
"rst_description": "The bot's description\n",
|
||||
"name": "description",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
}
|
||||
}
|
||||
27
.butcher/types/BotShortDescription/entity.json
Normal file
27
.butcher/types/BotShortDescription/entity.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available types",
|
||||
"anchor": "available-types"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "botshortdescription",
|
||||
"name": "BotShortDescription",
|
||||
"description": "This object represents the bot's short description.",
|
||||
"html_description": "<p>This object represents the bot's short description.</p>",
|
||||
"rst_description": "This object represents the bot's short description.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"description": "The bot's short description",
|
||||
"html_description": "<td>The bot's short description</td>",
|
||||
"rst_description": "The bot's short description\n",
|
||||
"name": "short_description",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
}
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
"description": "Document thumbnail as defined by sender",
|
||||
"html_description": "<td><em>Optional</em>. Document thumbnail as defined by sender</td>",
|
||||
"rst_description": "*Optional*. Document thumbnail as defined by sender\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
"description": "Url of the thumbnail for the result",
|
||||
"html_description": "<td><em>Optional</em>. Url of the thumbnail for the result</td>",
|
||||
"rst_description": "*Optional*. Url of the thumbnail for the result\n",
|
||||
"name": "thumb_url",
|
||||
"name": "thumbnail_url",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
"description": "Thumbnail width",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail width</td>",
|
||||
"rst_description": "*Optional*. Thumbnail width\n",
|
||||
"name": "thumb_width",
|
||||
"name": "thumbnail_width",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
"description": "Thumbnail height",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail height</td>",
|
||||
"rst_description": "*Optional*. Thumbnail height\n",
|
||||
"name": "thumb_height",
|
||||
"name": "thumbnail_height",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
"description": "Url of the thumbnail for the result",
|
||||
"html_description": "<td><em>Optional</em>. Url of the thumbnail for the result</td>",
|
||||
"rst_description": "*Optional*. Url of the thumbnail for the result\n",
|
||||
"name": "thumb_url",
|
||||
"name": "thumbnail_url",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
"description": "Thumbnail width",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail width</td>",
|
||||
"rst_description": "*Optional*. Thumbnail width\n",
|
||||
"name": "thumb_width",
|
||||
"name": "thumbnail_width",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
"description": "Thumbnail height",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail height</td>",
|
||||
"rst_description": "*Optional*. Thumbnail height\n",
|
||||
"name": "thumb_height",
|
||||
"name": "thumbnail_height",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@
|
|||
"description": "URL of the thumbnail (JPEG only) for the file",
|
||||
"html_description": "<td><em>Optional</em>. URL of the thumbnail (JPEG only) for the file</td>",
|
||||
"rst_description": "*Optional*. URL of the thumbnail (JPEG only) for the file\n",
|
||||
"name": "thumb_url",
|
||||
"name": "thumbnail_url",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
"description": "Thumbnail width",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail width</td>",
|
||||
"rst_description": "*Optional*. Thumbnail width\n",
|
||||
"name": "thumb_width",
|
||||
"name": "thumbnail_width",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
"description": "Thumbnail height",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail height</td>",
|
||||
"rst_description": "*Optional*. Thumbnail height\n",
|
||||
"name": "thumb_height",
|
||||
"name": "thumbnail_height",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
"description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result",
|
||||
"html_description": "<td>URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result</td>",
|
||||
"rst_description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result\n",
|
||||
"name": "thumb_url",
|
||||
"name": "thumbnail_url",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
"description": "MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'",
|
||||
"html_description": "<td><em>Optional</em>. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”</td>",
|
||||
"rst_description": "*Optional*. MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'\n",
|
||||
"name": "thumb_mime_type",
|
||||
"name": "thumbnail_mime_type",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@
|
|||
"description": "Url of the thumbnail for the result",
|
||||
"html_description": "<td><em>Optional</em>. Url of the thumbnail for the result</td>",
|
||||
"rst_description": "*Optional*. Url of the thumbnail for the result\n",
|
||||
"name": "thumb_url",
|
||||
"name": "thumbnail_url",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
"description": "Thumbnail width",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail width</td>",
|
||||
"rst_description": "*Optional*. Thumbnail width\n",
|
||||
"name": "thumb_width",
|
||||
"name": "thumbnail_width",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
"description": "Thumbnail height",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail height</td>",
|
||||
"rst_description": "*Optional*. Thumbnail height\n",
|
||||
"name": "thumb_height",
|
||||
"name": "thumbnail_height",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
"description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result",
|
||||
"html_description": "<td>URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result</td>",
|
||||
"rst_description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result\n",
|
||||
"name": "thumb_url",
|
||||
"name": "thumbnail_url",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
"description": "MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'",
|
||||
"html_description": "<td><em>Optional</em>. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”</td>",
|
||||
"rst_description": "*Optional*. MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'\n",
|
||||
"name": "thumb_mime_type",
|
||||
"name": "thumbnail_mime_type",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
"description": "URL of the thumbnail for the photo",
|
||||
"html_description": "<td>URL of the thumbnail for the photo</td>",
|
||||
"rst_description": "URL of the thumbnail for the photo\n",
|
||||
"name": "thumb_url",
|
||||
"name": "thumbnail_url",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@
|
|||
"description": "Url of the thumbnail for the result",
|
||||
"html_description": "<td><em>Optional</em>. Url of the thumbnail for the result</td>",
|
||||
"rst_description": "*Optional*. Url of the thumbnail for the result\n",
|
||||
"name": "thumb_url",
|
||||
"name": "thumbnail_url",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
"description": "Thumbnail width",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail width</td>",
|
||||
"rst_description": "*Optional*. Thumbnail width\n",
|
||||
"name": "thumb_width",
|
||||
"name": "thumbnail_width",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -130,7 +130,7 @@
|
|||
"description": "Thumbnail height",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail height</td>",
|
||||
"rst_description": "*Optional*. Thumbnail height\n",
|
||||
"name": "thumb_height",
|
||||
"name": "thumbnail_height",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
"description": "URL of the thumbnail (JPEG only) for the video",
|
||||
"html_description": "<td>URL of the thumbnail (JPEG only) for the video</td>",
|
||||
"rst_description": "URL of the thumbnail (JPEG only) for the video\n",
|
||||
"name": "thumb_url",
|
||||
"name": "thumbnail_url",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
"description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
"description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
"description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
"description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files",
|
||||
"html_description": "<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
51
.butcher/types/InputSticker/entity.json
Normal file
51
.butcher/types/InputSticker/entity.json
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Stickers",
|
||||
"anchor": "stickers"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "inputsticker",
|
||||
"name": "InputSticker",
|
||||
"description": "This object describes a sticker to be added to a sticker set.",
|
||||
"html_description": "<p>This object describes a sticker to be added to a sticker set.</p>",
|
||||
"rst_description": "This object describes a sticker to be added to a sticker set.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "InputFile or String",
|
||||
"description": "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, or upload a new one using multipart/form-data. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files",
|
||||
"html_description": "<td>The added sticker. 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. Animated and video stickers can't be uploaded via HTTP URL. <a href=\"#sending-files\">More information on Sending Files »</a></td>",
|
||||
"rst_description": "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, or upload a new one using multipart/form-data. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » <sending-files>`\n",
|
||||
"name": "sticker",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Array of String",
|
||||
"description": "List of 1-20 emoji associated with the sticker",
|
||||
"html_description": "<td>List of 1-20 emoji associated with the sticker</td>",
|
||||
"rst_description": "List of 1-20 emoji associated with the sticker\n",
|
||||
"name": "emoji_list",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "MaskPosition",
|
||||
"description": "Position where the mask should be placed on faces. For 'mask' stickers only.",
|
||||
"html_description": "<td><em>Optional</em>. Position where the mask should be placed on faces. For “mask” stickers only.</td>",
|
||||
"rst_description": "*Optional*. Position where the mask should be placed on faces. For 'mask' stickers only.\n",
|
||||
"name": "mask_position",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Array of String",
|
||||
"description": "List of 0-20 search keywords for the sticker with total length of up to 64 characters. For 'regular' and 'custom_emoji' stickers only.",
|
||||
"html_description": "<td><em>Optional</em>. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.</td>",
|
||||
"rst_description": "*Optional*. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For 'regular' and 'custom_emoji' stickers only.\n",
|
||||
"name": "keywords",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
}
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
"description": "Sticker thumbnail in the .WEBP or .JPG format",
|
||||
"html_description": "<td><em>Optional</em>. Sticker thumbnail in the .WEBP or .JPG format</td>",
|
||||
"rst_description": "*Optional*. Sticker thumbnail in the .WEBP or .JPG format\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
@ -117,6 +117,14 @@
|
|||
"name": "custom_emoji_id",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "True",
|
||||
"description": "True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places\n",
|
||||
"name": "needs_repainting",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "File size in bytes",
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
"description": "Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format",
|
||||
"html_description": "<td><em>Optional</em>. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format</td>",
|
||||
"rst_description": "*Optional*. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
"description": "Video thumbnail",
|
||||
"html_description": "<td><em>Optional</em>. Video thumbnail</td>",
|
||||
"rst_description": "*Optional*. Video thumbnail\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
"description": "Video thumbnail",
|
||||
"html_description": "<td><em>Optional</em>. Video thumbnail</td>",
|
||||
"rst_description": "*Optional*. Video thumbnail\n",
|
||||
"name": "thumb",
|
||||
"name": "thumbnail",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
7
CHANGES/1139.misc.rst
Normal file
7
CHANGES/1139.misc.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
Added full support of `Bot API 6.6 <https://core.telegram.org/bots/api-changelog#march-9-2023>`_
|
||||
|
||||
.. danger::
|
||||
|
||||
Note that this issue has breaking changes described in in the Bot API changelog,
|
||||
this changes is not breaking in the API but breaking inside aiogram because
|
||||
Beta stage is not finished.
|
||||
|
|
@ -63,7 +63,7 @@ Features
|
|||
- Asynchronous (`asyncio docs <https://docs.python.org/3/library/asyncio.html>`_, :pep:`492`)
|
||||
- Has type hints (:pep:`484`) and can be used with `mypy <http://mypy-lang.org/>`_
|
||||
- Supports `PyPy <https://www.pypy.org/>`_
|
||||
- Supports `Telegram Bot API 6.5 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API
|
||||
- Supports `Telegram Bot API 6.6 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API
|
||||
- Telegram Bot API integration code was `autogenerated <https://github.com/aiogram/tg-codegen>`_ and can be easily re-generated when API gets updated
|
||||
- Updates router (Blueprints)
|
||||
- Has Finite State Machine
|
||||
|
|
|
|||
|
|
@ -37,5 +37,5 @@ __all__ = (
|
|||
"flags",
|
||||
)
|
||||
|
||||
__version__ = "3.0.0b7"
|
||||
__api_version__ = "6.5"
|
||||
__version__ = "3.0.0b8"
|
||||
__api_version__ = "6.6"
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ from ..methods import (
|
|||
DeleteMessage,
|
||||
DeleteMyCommands,
|
||||
DeleteStickerFromSet,
|
||||
DeleteStickerSet,
|
||||
DeleteWebhook,
|
||||
EditChatInviteLink,
|
||||
EditForumTopic,
|
||||
|
|
@ -69,6 +70,8 @@ from ..methods import (
|
|||
GetMe,
|
||||
GetMyCommands,
|
||||
GetMyDefaultAdministratorRights,
|
||||
GetMyDescription,
|
||||
GetMyShortDescription,
|
||||
GetStickerSet,
|
||||
GetUpdates,
|
||||
GetUserProfilePhotos,
|
||||
|
|
@ -107,12 +110,19 @@ from ..methods import (
|
|||
SetChatPhoto,
|
||||
SetChatStickerSet,
|
||||
SetChatTitle,
|
||||
SetCustomEmojiStickerSetThumbnail,
|
||||
SetGameScore,
|
||||
SetMyCommands,
|
||||
SetMyDefaultAdministratorRights,
|
||||
SetMyDescription,
|
||||
SetMyShortDescription,
|
||||
SetPassportDataErrors,
|
||||
SetStickerEmojiList,
|
||||
SetStickerKeywords,
|
||||
SetStickerMaskPosition,
|
||||
SetStickerPositionInSet,
|
||||
SetStickerSetThumb,
|
||||
SetStickerSetThumbnail,
|
||||
SetStickerSetTitle,
|
||||
SetWebhook,
|
||||
StopMessageLiveLocation,
|
||||
StopPoll,
|
||||
|
|
@ -129,6 +139,8 @@ from ..types import (
|
|||
UNSET,
|
||||
BotCommand,
|
||||
BotCommandScope,
|
||||
BotDescription,
|
||||
BotShortDescription,
|
||||
Chat,
|
||||
ChatAdministratorRights,
|
||||
ChatInviteLink,
|
||||
|
|
@ -152,6 +164,7 @@ from ..types import (
|
|||
InputMediaDocument,
|
||||
InputMediaPhoto,
|
||||
InputMediaVideo,
|
||||
InputSticker,
|
||||
LabeledPrice,
|
||||
MaskPosition,
|
||||
MenuButtonCommands,
|
||||
|
|
@ -396,25 +409,17 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
self,
|
||||
user_id: int,
|
||||
name: str,
|
||||
emojis: str,
|
||||
png_sticker: Optional[Union[InputFile, str]] = None,
|
||||
tgs_sticker: Optional[InputFile] = None,
|
||||
webm_sticker: Optional[InputFile] = None,
|
||||
mask_position: Optional[MaskPosition] = None,
|
||||
sticker: InputSticker,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to add a new sticker to a set created by the bot. You **must** use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success.
|
||||
Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#addstickertoset
|
||||
|
||||
:param user_id: User identifier of sticker set owner
|
||||
:param name: Sticker set name
|
||||
:param emojis: One or more emoji corresponding to the sticker
|
||||
:param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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>`
|
||||
:param tgs_sticker: **TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for technical requirements
|
||||
:param webm_sticker: **WEBM** video with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for technical requirements
|
||||
:param mask_position: A JSON-serialized object for position where the mask should be placed on faces
|
||||
:param sticker: A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
|
@ -422,11 +427,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
call = AddStickerToSet(
|
||||
user_id=user_id,
|
||||
name=name,
|
||||
emojis=emojis,
|
||||
png_sticker=png_sticker,
|
||||
tgs_sticker=tgs_sticker,
|
||||
webm_sticker=webm_sticker,
|
||||
mask_position=mask_position,
|
||||
sticker=sticker,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
|
|
@ -894,28 +895,24 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
user_id: int,
|
||||
name: str,
|
||||
title: str,
|
||||
emojis: str,
|
||||
png_sticker: Optional[Union[InputFile, str]] = None,
|
||||
tgs_sticker: Optional[InputFile] = None,
|
||||
webm_sticker: Optional[InputFile] = None,
|
||||
stickers: List[InputSticker],
|
||||
sticker_format: str,
|
||||
sticker_type: Optional[str] = None,
|
||||
mask_position: Optional[MaskPosition] = None,
|
||||
needs_repainting: Optional[bool] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You **must** use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*. Returns :code:`True` on success.
|
||||
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createnewstickerset
|
||||
|
||||
:param user_id: User identifier of created sticker set owner
|
||||
:param name: Short name of sticker set, to be used in :code:`t.me/addstickers/` URLs (e.g., *animals*). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in :code:`"_by_<bot_username>"`. :code:`<bot_username>` is case insensitive. 1-64 characters.
|
||||
:param title: Sticker set title, 1-64 characters
|
||||
:param emojis: One or more emoji corresponding to the sticker
|
||||
:param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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>`
|
||||
:param tgs_sticker: **TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for technical requirements
|
||||
:param webm_sticker: **WEBM** video with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for technical requirements
|
||||
:param sticker_type: Type of stickers in the set, pass 'regular' or 'mask'. Custom emoji sticker sets can't be created via the Bot API at the moment. By default, a regular sticker set is created.
|
||||
:param mask_position: A JSON-serialized object for position where the mask should be placed on faces
|
||||
:param stickers: A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
|
||||
:param sticker_format: Format of stickers in the set, must be one of 'static', 'animated', 'video'
|
||||
:param sticker_type: Type of stickers in the set, pass 'regular', 'mask', or 'custom_emoji'. By default, a regular sticker set is created.
|
||||
:param needs_repainting: Pass :code:`True` if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
|
@ -924,12 +921,10 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
user_id=user_id,
|
||||
name=name,
|
||||
title=title,
|
||||
emojis=emojis,
|
||||
png_sticker=png_sticker,
|
||||
tgs_sticker=tgs_sticker,
|
||||
webm_sticker=webm_sticker,
|
||||
stickers=stickers,
|
||||
sticker_format=sticker_format,
|
||||
sticker_type=sticker_type,
|
||||
mask_position=mask_position,
|
||||
needs_repainting=needs_repainting,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
|
|
@ -1998,7 +1993,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
duration: Optional[int] = None,
|
||||
width: Optional[int] = None,
|
||||
height: Optional[int] = None,
|
||||
thumb: Optional[Union[InputFile, str]] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -2023,7 +2018,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param duration: Duration of sent animation in seconds
|
||||
:param width: Animation width
|
||||
:param height: Animation height
|
||||
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing
|
||||
:param parse_mode: Mode for parsing entities in the animation caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||
|
|
@ -2044,7 +2039,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
duration=duration,
|
||||
width=width,
|
||||
height=height,
|
||||
thumb=thumb,
|
||||
thumbnail=thumbnail,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
@ -2068,7 +2063,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
thumb: Optional[Union[InputFile, str]] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -2093,7 +2088,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param duration: Duration of the audio in seconds
|
||||
:param performer: Performer
|
||||
:param title: Track name
|
||||
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||
|
|
@ -2113,7 +2108,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
duration=duration,
|
||||
performer=performer,
|
||||
title=title,
|
||||
thumb=thumb,
|
||||
thumbnail=thumbnail,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
|
|
@ -2252,7 +2247,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id: Union[int, str],
|
||||
document: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
thumb: Optional[Union[InputFile, str]] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -2274,7 +2269,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing
|
||||
:param parse_mode: Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||
|
|
@ -2292,7 +2287,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id=chat_id,
|
||||
document=document,
|
||||
message_thread_id=message_thread_id,
|
||||
thumb=thumb,
|
||||
thumbnail=thumbnail,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
@ -2731,6 +2726,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id: Union[int, str],
|
||||
sticker: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -2746,8 +2742,9 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
Source: https://core.telegram.org/bots/api#sendsticker
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.
|
||||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param emoji: Emoji associated with the sticker; only for just uploaded stickers
|
||||
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||
|
|
@ -2761,6 +2758,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id=chat_id,
|
||||
sticker=sticker,
|
||||
message_thread_id=message_thread_id,
|
||||
emoji=emoji,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
|
|
@ -2841,7 +2839,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
duration: Optional[int] = None,
|
||||
width: Optional[int] = None,
|
||||
height: Optional[int] = None,
|
||||
thumb: Optional[Union[InputFile, str]] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -2867,7 +2865,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param duration: Duration of sent video in seconds
|
||||
:param width: Video width
|
||||
:param height: Video height
|
||||
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing
|
||||
:param parse_mode: Mode for parsing entities in the video caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
|
||||
|
|
@ -2889,7 +2887,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
duration=duration,
|
||||
width=width,
|
||||
height=height,
|
||||
thumb=thumb,
|
||||
thumbnail=thumbnail,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
@ -2910,7 +2908,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
message_thread_id: Optional[int] = None,
|
||||
duration: Optional[int] = None,
|
||||
length: Optional[int] = None,
|
||||
thumb: Optional[Union[InputFile, str]] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -2930,7 +2928,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||
:param duration: Duration of sent video in seconds
|
||||
:param length: Video width and height, i.e. diameter of the video message
|
||||
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
|
||||
:param protect_content: Protects the contents of the sent message from forwarding and saving
|
||||
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||
|
|
@ -2946,7 +2944,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
message_thread_id=message_thread_id,
|
||||
duration=duration,
|
||||
length=length,
|
||||
thumb=thumb,
|
||||
thumbnail=thumbnail,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
|
|
@ -3250,7 +3248,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns :code:`True` on success.
|
||||
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmydefaultadministratorrights
|
||||
|
||||
|
|
@ -3313,32 +3311,6 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_sticker_set_thumb(
|
||||
self,
|
||||
name: str,
|
||||
user_id: int,
|
||||
thumb: Optional[Union[InputFile, str]] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickersetthumb
|
||||
|
||||
:param name: Sticker set name
|
||||
:param user_id: User identifier of the sticker set owner
|
||||
:param thumb: A **PNG** image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a **TGS** animation with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for animated sticker technical requirements, or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Animated sticker set thumbnails can't be uploaded via HTTP URL.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = SetStickerSetThumb(
|
||||
name=name,
|
||||
user_id=user_id,
|
||||
thumb=thumb,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_webhook(
|
||||
self,
|
||||
url: str,
|
||||
|
|
@ -3560,23 +3532,26 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
async def upload_sticker_file(
|
||||
self,
|
||||
user_id: int,
|
||||
png_sticker: InputFile,
|
||||
sticker: InputFile,
|
||||
sticker_format: str,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> File:
|
||||
"""
|
||||
Use this method to upload a .PNG file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.
|
||||
Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet` and :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#uploadstickerfile
|
||||
|
||||
:param user_id: User identifier of sticker file owner
|
||||
:param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param sticker: A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See `https://core.telegram.org/stickers <https://core.telegram.org/stickers>`_`https://core.telegram.org/stickers <https://core.telegram.org/stickers>`_ for technical requirements. :ref:`More information on Sending Files » <sending-files>`
|
||||
:param sticker_format: Format of the sticker, must be one of 'static', 'animated', 'video'
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns the uploaded :class:`aiogram.types.file.File` on success.
|
||||
"""
|
||||
|
||||
call = UploadStickerFile(
|
||||
user_id=user_id,
|
||||
png_sticker=png_sticker,
|
||||
sticker=sticker,
|
||||
sticker_format=sticker_format,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
|
|
@ -3682,3 +3657,250 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
chat_id=chat_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def delete_sticker_set(
|
||||
self,
|
||||
name: str,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to delete a sticker set that was created by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deletestickerset
|
||||
|
||||
:param name: Sticker set name
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = DeleteStickerSet(
|
||||
name=name,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def get_my_description(
|
||||
self,
|
||||
language_code: Optional[str] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> BotDescription:
|
||||
"""
|
||||
Use this method to get the current bot description for the given user language. Returns :class:`aiogram.types.bot_description.BotDescription` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getmydescription
|
||||
|
||||
:param language_code: A two-letter ISO 639-1 language code or an empty string
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :class:`aiogram.types.bot_description.BotDescription` on success.
|
||||
"""
|
||||
|
||||
call = GetMyDescription(
|
||||
language_code=language_code,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def get_my_short_description(
|
||||
self,
|
||||
language_code: Optional[str] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> BotShortDescription:
|
||||
"""
|
||||
Use this method to get the current bot short description for the given user language. Returns :class:`aiogram.types.bot_short_description.BotShortDescription` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getmyshortdescription
|
||||
|
||||
:param language_code: A two-letter ISO 639-1 language code or an empty string
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :class:`aiogram.types.bot_short_description.BotShortDescription` on success.
|
||||
"""
|
||||
|
||||
call = GetMyShortDescription(
|
||||
language_code=language_code,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_custom_emoji_sticker_set_thumbnail(
|
||||
self,
|
||||
name: str,
|
||||
custom_emoji_id: Optional[str] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to set the thumbnail of a custom emoji sticker set. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
|
||||
|
||||
:param name: Sticker set name
|
||||
:param custom_emoji_id: Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = SetCustomEmojiStickerSetThumbnail(
|
||||
name=name,
|
||||
custom_emoji_id=custom_emoji_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_my_description(
|
||||
self,
|
||||
description: Optional[str] = None,
|
||||
language_code: Optional[str] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmydescription
|
||||
|
||||
:param description: New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
|
||||
:param language_code: A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = SetMyDescription(
|
||||
description=description,
|
||||
language_code=language_code,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_my_short_description(
|
||||
self,
|
||||
short_description: Optional[str] = None,
|
||||
language_code: Optional[str] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmyshortdescription
|
||||
|
||||
:param short_description: New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
|
||||
:param language_code: A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = SetMyShortDescription(
|
||||
short_description=short_description,
|
||||
language_code=language_code,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_sticker_emoji_list(
|
||||
self,
|
||||
sticker: str,
|
||||
emoji_list: List[str],
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickeremojilist
|
||||
|
||||
:param sticker: File identifier of the sticker
|
||||
:param emoji_list: A JSON-serialized list of 1-20 emoji associated with the sticker
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = SetStickerEmojiList(
|
||||
sticker=sticker,
|
||||
emoji_list=emoji_list,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_sticker_keywords(
|
||||
self,
|
||||
sticker: str,
|
||||
keywords: Optional[List[str]] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickerkeywords
|
||||
|
||||
:param sticker: File identifier of the sticker
|
||||
:param keywords: A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = SetStickerKeywords(
|
||||
sticker=sticker,
|
||||
keywords=keywords,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_sticker_mask_position(
|
||||
self,
|
||||
sticker: str,
|
||||
mask_position: Optional[MaskPosition] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to change the `mask position <https://core.telegram.org/bots/api#maskposition>`_ of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickermaskposition
|
||||
|
||||
:param sticker: File identifier of the sticker
|
||||
:param mask_position: A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = SetStickerMaskPosition(
|
||||
sticker=sticker,
|
||||
mask_position=mask_position,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_sticker_set_thumbnail(
|
||||
self,
|
||||
name: str,
|
||||
user_id: int,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickersetthumbnail
|
||||
|
||||
:param name: Sticker set name
|
||||
:param user_id: User identifier of the sticker set owner
|
||||
:param thumbnail: A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for animated sticker technical requirements), or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = SetStickerSetThumbnail(
|
||||
name=name,
|
||||
user_id=user_id,
|
||||
thumbnail=thumbnail,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def set_sticker_set_title(
|
||||
self,
|
||||
name: str,
|
||||
title: str,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to set the title of a created sticker set. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickersettitle
|
||||
|
||||
:param name: Sticker set name
|
||||
:param title: Sticker set title, 1-64 characters
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
||||
call = SetStickerSetTitle(
|
||||
name=name,
|
||||
title=title,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ from aiogram.methods import Request, TelegramMethod
|
|||
|
||||
from ...exceptions import TelegramNetworkError
|
||||
from ...methods.base import TelegramType
|
||||
from ...types import InputFile
|
||||
from .base import UNSET, BaseSession
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from .menu_button_type import MenuButtonType
|
|||
from .message_entity_type import MessageEntityType
|
||||
from .parse_mode import ParseMode
|
||||
from .poll_type import PollType
|
||||
from .sticker_format import StickerFormat
|
||||
from .sticker_type import StickerType
|
||||
from .topic_icon_color import TopicIconColor
|
||||
from .update_type import UpdateType
|
||||
|
|
@ -29,6 +30,7 @@ __all__ = (
|
|||
"MessageEntityType",
|
||||
"ParseMode",
|
||||
"PollType",
|
||||
"StickerFormat",
|
||||
"StickerType",
|
||||
"TopicIconColor",
|
||||
"UpdateType",
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ from enum import Enum
|
|||
|
||||
class InlineQueryResultType(str, Enum):
|
||||
"""
|
||||
The part of the face relative to which the mask should be placed.
|
||||
Type of inline query result
|
||||
|
||||
Source: https://core.telegram.org/bots/api#maskposition
|
||||
Source: https://core.telegram.org/bots/api#inlinequeryresult
|
||||
"""
|
||||
|
||||
AUDIO = "audio"
|
||||
|
|
|
|||
13
aiogram/enums/sticker_format.py
Normal file
13
aiogram/enums/sticker_format.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
from enum import Enum
|
||||
|
||||
|
||||
class StickerFormat(str, Enum):
|
||||
"""
|
||||
Format of the sticker
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createnewstickerset
|
||||
"""
|
||||
|
||||
STATIC = "static"
|
||||
ANIMATED = "animated"
|
||||
VIDEO = "video"
|
||||
|
|
@ -279,8 +279,8 @@ class CommandStart(Command):
|
|||
await self.validate_mention(bot=bot, command=command)
|
||||
command = self.validate_command(command)
|
||||
command = self.validate_deeplink(command=command)
|
||||
self.do_magic(command=command)
|
||||
return command
|
||||
command = self.do_magic(command=command)
|
||||
return command # noqa: RET504
|
||||
|
||||
def validate_deeplink(self, command: CommandObject) -> CommandObject:
|
||||
if not self.deep_link:
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ from .delete_forum_topic import DeleteForumTopic
|
|||
from .delete_message import DeleteMessage
|
||||
from .delete_my_commands import DeleteMyCommands
|
||||
from .delete_sticker_from_set import DeleteStickerFromSet
|
||||
from .delete_sticker_set import DeleteStickerSet
|
||||
from .delete_webhook import DeleteWebhook
|
||||
from .edit_chat_invite_link import EditChatInviteLink
|
||||
from .edit_forum_topic import EditForumTopic
|
||||
|
|
@ -46,6 +47,8 @@ from .get_game_high_scores import GetGameHighScores
|
|||
from .get_me import GetMe
|
||||
from .get_my_commands import GetMyCommands
|
||||
from .get_my_default_administrator_rights import GetMyDefaultAdministratorRights
|
||||
from .get_my_description import GetMyDescription
|
||||
from .get_my_short_description import GetMyShortDescription
|
||||
from .get_sticker_set import GetStickerSet
|
||||
from .get_updates import GetUpdates
|
||||
from .get_user_profile_photos import GetUserProfilePhotos
|
||||
|
|
@ -84,12 +87,19 @@ from .set_chat_permissions import SetChatPermissions
|
|||
from .set_chat_photo import SetChatPhoto
|
||||
from .set_chat_sticker_set import SetChatStickerSet
|
||||
from .set_chat_title import SetChatTitle
|
||||
from .set_custom_emoji_sticker_set_thumbnail import SetCustomEmojiStickerSetThumbnail
|
||||
from .set_game_score import SetGameScore
|
||||
from .set_my_commands import SetMyCommands
|
||||
from .set_my_default_administrator_rights import SetMyDefaultAdministratorRights
|
||||
from .set_my_description import SetMyDescription
|
||||
from .set_my_short_description import SetMyShortDescription
|
||||
from .set_passport_data_errors import SetPassportDataErrors
|
||||
from .set_sticker_emoji_list import SetStickerEmojiList
|
||||
from .set_sticker_keywords import SetStickerKeywords
|
||||
from .set_sticker_mask_position import SetStickerMaskPosition
|
||||
from .set_sticker_position_in_set import SetStickerPositionInSet
|
||||
from .set_sticker_set_thumb import SetStickerSetThumb
|
||||
from .set_sticker_set_thumbnail import SetStickerSetThumbnail
|
||||
from .set_sticker_set_title import SetStickerSetTitle
|
||||
from .set_webhook import SetWebhook
|
||||
from .stop_message_live_location import StopMessageLiveLocation
|
||||
from .stop_poll import StopPoll
|
||||
|
|
@ -126,6 +136,7 @@ __all__ = (
|
|||
"DeleteMessage",
|
||||
"DeleteMyCommands",
|
||||
"DeleteStickerFromSet",
|
||||
"DeleteStickerSet",
|
||||
"DeleteWebhook",
|
||||
"EditChatInviteLink",
|
||||
"EditForumTopic",
|
||||
|
|
@ -149,6 +160,8 @@ __all__ = (
|
|||
"GetMe",
|
||||
"GetMyCommands",
|
||||
"GetMyDefaultAdministratorRights",
|
||||
"GetMyDescription",
|
||||
"GetMyShortDescription",
|
||||
"GetStickerSet",
|
||||
"GetUpdates",
|
||||
"GetUserProfilePhotos",
|
||||
|
|
@ -189,12 +202,19 @@ __all__ = (
|
|||
"SetChatPhoto",
|
||||
"SetChatStickerSet",
|
||||
"SetChatTitle",
|
||||
"SetCustomEmojiStickerSetThumbnail",
|
||||
"SetGameScore",
|
||||
"SetMyCommands",
|
||||
"SetMyDefaultAdministratorRights",
|
||||
"SetMyDescription",
|
||||
"SetMyShortDescription",
|
||||
"SetPassportDataErrors",
|
||||
"SetStickerEmojiList",
|
||||
"SetStickerKeywords",
|
||||
"SetStickerMaskPosition",
|
||||
"SetStickerPositionInSet",
|
||||
"SetStickerSetThumb",
|
||||
"SetStickerSetThumbnail",
|
||||
"SetStickerSetTitle",
|
||||
"SetWebhook",
|
||||
"StopMessageLiveLocation",
|
||||
"StopPoll",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, Dict
|
||||
|
||||
from ..types import InputFile, MaskPosition
|
||||
from .base import Request, TelegramMethod, prepare_file
|
||||
from ..types import InputFile, InputSticker
|
||||
from .base import Request, TelegramMethod, prepare_input_sticker
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class AddStickerToSet(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to add a new sticker to a set created by the bot. You **must** use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success.
|
||||
Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#addstickertoset
|
||||
"""
|
||||
|
|
@ -22,23 +22,13 @@ class AddStickerToSet(TelegramMethod[bool]):
|
|||
"""User identifier of sticker set owner"""
|
||||
name: str
|
||||
"""Sticker set name"""
|
||||
emojis: str
|
||||
"""One or more emoji corresponding to the sticker"""
|
||||
png_sticker: Optional[Union[InputFile, str]] = None
|
||||
"""**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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>`"""
|
||||
tgs_sticker: Optional[InputFile] = None
|
||||
"""**TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for technical requirements"""
|
||||
webm_sticker: Optional[InputFile] = None
|
||||
"""**WEBM** video with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for technical requirements"""
|
||||
mask_position: Optional[MaskPosition] = None
|
||||
"""A JSON-serialized object for position where the mask should be placed on faces"""
|
||||
sticker: InputSticker
|
||||
"""A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"png_sticker", "tgs_sticker", "webm_sticker"})
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file(data=data, files=files, name="png_sticker", value=self.png_sticker)
|
||||
prepare_file(data=data, files=files, name="tgs_sticker", value=self.tgs_sticker)
|
||||
prepare_file(data=data, files=files, name="webm_sticker", value=self.webm_sticker)
|
||||
prepare_input_sticker(input_sticker=data["sticker"], files=files)
|
||||
|
||||
return Request(method="addStickerToSet", data=data, files=files)
|
||||
|
|
|
|||
|
|
@ -100,10 +100,10 @@ class TelegramMethod(abc.ABC, BaseModel, Generic[TelegramType]):
|
|||
def prepare_file(name: str, value: Any, data: Dict[str, Any], files: Dict[str, Any]) -> None:
|
||||
if not value:
|
||||
return
|
||||
if name == "thumb":
|
||||
if name == "thumbnail":
|
||||
tag = secrets.token_urlsafe(10)
|
||||
files[tag] = value
|
||||
data["thumb"] = f"attach://{tag}"
|
||||
data["thumbnail"] = f"attach://{tag}"
|
||||
elif isinstance(value, InputFile):
|
||||
files[name] = value
|
||||
else:
|
||||
|
|
@ -122,6 +122,22 @@ def prepare_input_media(data: Dict[str, Any], files: Dict[str, InputFile]) -> No
|
|||
input_media["media"] = f"attach://{tag}"
|
||||
|
||||
|
||||
def prepare_input_sticker(input_sticker: Dict[str, Any], files: Dict[str, InputFile]) -> None:
|
||||
if (
|
||||
"sticker" in input_sticker
|
||||
and input_sticker["sticker"]
|
||||
and isinstance(input_sticker["sticker"], InputFile)
|
||||
):
|
||||
tag = secrets.token_urlsafe(10)
|
||||
files[tag] = input_sticker.pop("sticker")
|
||||
input_sticker["sticker"] = f"attach://{tag}"
|
||||
|
||||
|
||||
def prepare_input_stickers(data: Dict[str, Any], files: Dict[str, InputFile]) -> None:
|
||||
for input_sticker in data["stickers"]:
|
||||
prepare_input_sticker(input_sticker, files=files)
|
||||
|
||||
|
||||
def prepare_media_file(data: Dict[str, Any], files: Dict[str, InputFile]) -> None:
|
||||
if (
|
||||
data["media"]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
||||
|
||||
from ..types import InputFile, MaskPosition
|
||||
from .base import Request, TelegramMethod, prepare_file
|
||||
from ..types import InputFile, InputSticker
|
||||
from .base import Request, TelegramMethod, prepare_input_sticker, prepare_input_stickers
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class CreateNewStickerSet(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You **must** use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*. Returns :code:`True` on success.
|
||||
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createnewstickerset
|
||||
"""
|
||||
|
|
@ -24,25 +24,19 @@ class CreateNewStickerSet(TelegramMethod[bool]):
|
|||
"""Short name of sticker set, to be used in :code:`t.me/addstickers/` URLs (e.g., *animals*). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in :code:`"_by_<bot_username>"`. :code:`<bot_username>` is case insensitive. 1-64 characters."""
|
||||
title: str
|
||||
"""Sticker set title, 1-64 characters"""
|
||||
emojis: str
|
||||
"""One or more emoji corresponding to the sticker"""
|
||||
png_sticker: Optional[Union[InputFile, str]] = None
|
||||
"""**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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>`"""
|
||||
tgs_sticker: Optional[InputFile] = None
|
||||
"""**TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for technical requirements"""
|
||||
webm_sticker: Optional[InputFile] = None
|
||||
"""**WEBM** video with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for technical requirements"""
|
||||
stickers: List[InputSticker]
|
||||
"""A JSON-serialized list of 1-50 initial stickers to be added to the sticker set"""
|
||||
sticker_format: str
|
||||
"""Format of stickers in the set, must be one of 'static', 'animated', 'video'"""
|
||||
sticker_type: Optional[str] = None
|
||||
"""Type of stickers in the set, pass 'regular' or 'mask'. Custom emoji sticker sets can't be created via the Bot API at the moment. By default, a regular sticker set is created."""
|
||||
mask_position: Optional[MaskPosition] = None
|
||||
"""A JSON-serialized object for position where the mask should be placed on faces"""
|
||||
"""Type of stickers in the set, pass 'regular', 'mask', or 'custom_emoji'. By default, a regular sticker set is created."""
|
||||
needs_repainting: Optional[bool] = None
|
||||
"""Pass :code:`True` if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"png_sticker", "tgs_sticker", "webm_sticker"})
|
||||
|
||||
data: Dict[str, Any] = self.dict()
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file(data=data, files=files, name="png_sticker", value=self.png_sticker)
|
||||
prepare_file(data=data, files=files, name="tgs_sticker", value=self.tgs_sticker)
|
||||
prepare_file(data=data, files=files, name="webm_sticker", value=self.webm_sticker)
|
||||
|
||||
prepare_input_stickers(data=data, files=files)
|
||||
|
||||
return Request(method="createNewStickerSet", data=data, files=files)
|
||||
|
|
|
|||
26
aiogram/methods/delete_sticker_set.py
Normal file
26
aiogram/methods/delete_sticker_set.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class DeleteStickerSet(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to delete a sticker set that was created by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#deletestickerset
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
name: str
|
||||
"""Sticker set name"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="deleteStickerSet", data=data)
|
||||
27
aiogram/methods/get_my_description.py
Normal file
27
aiogram/methods/get_my_description.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional
|
||||
|
||||
from ..types import BotDescription
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class GetMyDescription(TelegramMethod[BotDescription]):
|
||||
"""
|
||||
Use this method to get the current bot description for the given user language. Returns :class:`aiogram.types.bot_description.BotDescription` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getmydescription
|
||||
"""
|
||||
|
||||
__returning__ = BotDescription
|
||||
|
||||
language_code: Optional[str] = None
|
||||
"""A two-letter ISO 639-1 language code or an empty string"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="getMyDescription", data=data)
|
||||
27
aiogram/methods/get_my_short_description.py
Normal file
27
aiogram/methods/get_my_short_description.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional
|
||||
|
||||
from ..types import BotShortDescription
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class GetMyShortDescription(TelegramMethod[BotShortDescription]):
|
||||
"""
|
||||
Use this method to get the current bot short description for the given user language. Returns :class:`aiogram.types.bot_short_description.BotShortDescription` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getmyshortdescription
|
||||
"""
|
||||
|
||||
__returning__ = BotShortDescription
|
||||
|
||||
language_code: Optional[str] = None
|
||||
"""A two-letter ISO 639-1 language code or an empty string"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="getMyShortDescription", data=data)
|
||||
|
|
@ -39,7 +39,7 @@ class SendAnimation(TelegramMethod[Message]):
|
|||
"""Animation width"""
|
||||
height: Optional[int] = None
|
||||
"""Animation height"""
|
||||
thumb: Optional[Union[InputFile, str]] = None
|
||||
thumbnail: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing"""
|
||||
|
|
@ -71,6 +71,6 @@ class SendAnimation(TelegramMethod[Message]):
|
|||
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file(data=data, files=files, name="animation", value=self.animation)
|
||||
prepare_file(data=data, files=files, name="thumb", value=self.thumb)
|
||||
prepare_file(data=data, files=files, name="thumbnail", value=self.thumbnail)
|
||||
|
||||
return Request(method="sendAnimation", data=data, files=files)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class SendAudio(TelegramMethod[Message]):
|
|||
"""Performer"""
|
||||
title: Optional[str] = None
|
||||
"""Track name"""
|
||||
thumb: Optional[Union[InputFile, str]] = None
|
||||
thumbnail: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
|
|
@ -70,6 +70,6 @@ class SendAudio(TelegramMethod[Message]):
|
|||
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file(data=data, files=files, name="audio", value=self.audio)
|
||||
prepare_file(data=data, files=files, name="thumb", value=self.thumb)
|
||||
prepare_file(data=data, files=files, name="thumbnail", value=self.thumbnail)
|
||||
|
||||
return Request(method="sendAudio", data=data, files=files)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class SendDocument(TelegramMethod[Message]):
|
|||
"""File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
thumb: Optional[Union[InputFile, str]] = None
|
||||
thumbnail: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing"""
|
||||
|
|
@ -65,6 +65,6 @@ class SendDocument(TelegramMethod[Message]):
|
|||
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file(data=data, files=files, name="document", value=self.document)
|
||||
prepare_file(data=data, files=files, name="thumb", value=self.thumb)
|
||||
prepare_file(data=data, files=files, name="thumbnail", value=self.thumbnail)
|
||||
|
||||
return Request(method="sendDocument", data=data, files=files)
|
||||
|
|
|
|||
|
|
@ -28,9 +28,11 @@ class SendSticker(TelegramMethod[Message]):
|
|||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
sticker: Union[InputFile, str]
|
||||
"""Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
"""Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL."""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
emoji: Optional[str] = None
|
||||
"""Emoji associated with the sticker; only for just uploaded stickers"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class SendVideo(TelegramMethod[Message]):
|
|||
"""Video width"""
|
||||
height: Optional[int] = None
|
||||
"""Video height"""
|
||||
thumb: Optional[Union[InputFile, str]] = None
|
||||
thumbnail: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing"""
|
||||
|
|
@ -73,6 +73,6 @@ class SendVideo(TelegramMethod[Message]):
|
|||
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file(data=data, files=files, name="video", value=self.video)
|
||||
prepare_file(data=data, files=files, name="thumb", value=self.thumb)
|
||||
prepare_file(data=data, files=files, name="thumbnail", value=self.thumbnail)
|
||||
|
||||
return Request(method="sendVideo", data=data, files=files)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class SendVideoNote(TelegramMethod[Message]):
|
|||
"""Duration of sent video in seconds"""
|
||||
length: Optional[int] = None
|
||||
"""Video width and height, i.e. diameter of the video message"""
|
||||
thumb: Optional[Union[InputFile, str]] = None
|
||||
thumbnail: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
|
|
@ -55,6 +55,6 @@ class SendVideoNote(TelegramMethod[Message]):
|
|||
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file(data=data, files=files, name="video_note", value=self.video_note)
|
||||
prepare_file(data=data, files=files, name="thumb", value=self.thumb)
|
||||
prepare_file(data=data, files=files, name="thumbnail", value=self.thumbnail)
|
||||
|
||||
return Request(method="sendVideoNote", data=data, files=files)
|
||||
|
|
|
|||
28
aiogram/methods/set_custom_emoji_sticker_set_thumbnail.py
Normal file
28
aiogram/methods/set_custom_emoji_sticker_set_thumbnail.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class SetCustomEmojiStickerSetThumbnail(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to set the thumbnail of a custom emoji sticker set. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
name: str
|
||||
"""Sticker set name"""
|
||||
custom_emoji_id: Optional[str] = None
|
||||
"""Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="setCustomEmojiStickerSetThumbnail", data=data)
|
||||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class SetMyDefaultAdministratorRights(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns :code:`True` on success.
|
||||
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmydefaultadministratorrights
|
||||
"""
|
||||
|
|
|
|||
28
aiogram/methods/set_my_description.py
Normal file
28
aiogram/methods/set_my_description.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class SetMyDescription(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmydescription
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
description: Optional[str] = None
|
||||
"""New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language."""
|
||||
language_code: Optional[str] = None
|
||||
"""A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="setMyDescription", data=data)
|
||||
28
aiogram/methods/set_my_short_description.py
Normal file
28
aiogram/methods/set_my_short_description.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class SetMyShortDescription(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmyshortdescription
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
short_description: Optional[str] = None
|
||||
"""New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language."""
|
||||
language_code: Optional[str] = None
|
||||
"""A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="setMyShortDescription", data=data)
|
||||
28
aiogram/methods/set_sticker_emoji_list.py
Normal file
28
aiogram/methods/set_sticker_emoji_list.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, List
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class SetStickerEmojiList(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickeremojilist
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
sticker: str
|
||||
"""File identifier of the sticker"""
|
||||
emoji_list: List[str]
|
||||
"""A JSON-serialized list of 1-20 emoji associated with the sticker"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="setStickerEmojiList", data=data)
|
||||
28
aiogram/methods/set_sticker_keywords.py
Normal file
28
aiogram/methods/set_sticker_keywords.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class SetStickerKeywords(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickerkeywords
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
sticker: str
|
||||
"""File identifier of the sticker"""
|
||||
keywords: Optional[List[str]] = None
|
||||
"""A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="setStickerKeywords", data=data)
|
||||
29
aiogram/methods/set_sticker_mask_position.py
Normal file
29
aiogram/methods/set_sticker_mask_position.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional
|
||||
|
||||
from ..types import MaskPosition
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class SetStickerMaskPosition(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to change the `mask position <https://core.telegram.org/bots/api#maskposition>`_ of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickermaskposition
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
sticker: str
|
||||
"""File identifier of the sticker"""
|
||||
mask_position: Optional[MaskPosition] = None
|
||||
"""A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="setStickerMaskPosition", data=data)
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
||||
|
||||
from ..types import InputFile
|
||||
from .base import Request, TelegramMethod, prepare_file
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class SetStickerSetThumb(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickersetthumb
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
name: str
|
||||
"""Sticker set name"""
|
||||
user_id: int
|
||||
"""User identifier of the sticker set owner"""
|
||||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""A **PNG** image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a **TGS** animation with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for animated sticker technical requirements, or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Animated sticker set thumbnails can't be uploaded via HTTP URL."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"thumb"})
|
||||
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file(data=data, files=files, name="thumb", value=self.thumb)
|
||||
|
||||
return Request(method="setStickerSetThumb", data=data, files=files)
|
||||
34
aiogram/methods/set_sticker_set_thumbnail.py
Normal file
34
aiogram/methods/set_sticker_set_thumbnail.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
||||
|
||||
from ..types import InputFile
|
||||
from .base import Request, TelegramMethod, prepare_file
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class SetStickerSetThumbnail(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickersetthumbnail
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
name: str
|
||||
"""Sticker set name"""
|
||||
user_id: int
|
||||
"""User identifier of the sticker set owner"""
|
||||
thumbnail: Optional[Union[InputFile, str]] = None
|
||||
"""A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for animated sticker technical requirements), or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file("thumbnail", value=self.thumbnail, data=data, files=files)
|
||||
|
||||
return Request(method="setStickerSetThumbnail", data=data)
|
||||
28
aiogram/methods/set_sticker_set_title.py
Normal file
28
aiogram/methods/set_sticker_set_title.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict
|
||||
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class SetStickerSetTitle(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to set the title of a created sticker set. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setstickersettitle
|
||||
"""
|
||||
|
||||
__returning__ = bool
|
||||
|
||||
name: str
|
||||
"""Sticker set name"""
|
||||
title: str
|
||||
"""Sticker set title, 1-64 characters"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="setStickerSetTitle", data=data)
|
||||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class UploadStickerFile(TelegramMethod[File]):
|
||||
"""
|
||||
Use this method to upload a .PNG file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.
|
||||
Use this method to upload a file with a sticker for later use in the :class:`aiogram.methods.create_new_sticker_set.CreateNewStickerSet` and :class:`aiogram.methods.add_sticker_to_set.AddStickerToSet` methods (the file can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#uploadstickerfile
|
||||
"""
|
||||
|
|
@ -20,13 +20,15 @@ class UploadStickerFile(TelegramMethod[File]):
|
|||
|
||||
user_id: int
|
||||
"""User identifier of sticker file owner"""
|
||||
png_sticker: InputFile
|
||||
"""**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
sticker: InputFile
|
||||
"""A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See `https://core.telegram.org/stickers <https://core.telegram.org/stickers>`_`https://core.telegram.org/stickers <https://core.telegram.org/stickers>`_ for technical requirements. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
sticker_format: str
|
||||
"""Format of the sticker, must be one of 'static', 'animated', 'video'"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict(exclude={"png_sticker"})
|
||||
data: Dict[str, Any] = self.dict(exclude={"sticker"})
|
||||
|
||||
files: Dict[str, InputFile] = {}
|
||||
prepare_file(data=data, files=files, name="png_sticker", value=self.png_sticker)
|
||||
prepare_file(data=data, files=files, name="sticker", value=self.sticker)
|
||||
|
||||
return Request(method="uploadStickerFile", data=data, files=files)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ from .bot_command_scope_chat import BotCommandScopeChat
|
|||
from .bot_command_scope_chat_administrators import BotCommandScopeChatAdministrators
|
||||
from .bot_command_scope_chat_member import BotCommandScopeChatMember
|
||||
from .bot_command_scope_default import BotCommandScopeDefault
|
||||
from .bot_description import BotDescription
|
||||
from .bot_short_description import BotShortDescription
|
||||
from .callback_game import CallbackGame
|
||||
from .callback_query import CallbackQuery
|
||||
from .chat import Chat
|
||||
|
|
@ -86,6 +88,7 @@ from .input_media_document import InputMediaDocument
|
|||
from .input_media_photo import InputMediaPhoto
|
||||
from .input_media_video import InputMediaVideo
|
||||
from .input_message_content import InputMessageContent
|
||||
from .input_sticker import InputSticker
|
||||
from .input_text_message_content import InputTextMessageContent
|
||||
from .input_venue_message_content import InputVenueMessageContent
|
||||
from .invoice import Invoice
|
||||
|
|
@ -165,6 +168,8 @@ __all__ = (
|
|||
"BotCommandScopeChatAdministrators",
|
||||
"BotCommandScopeChatMember",
|
||||
"BotCommandScopeDefault",
|
||||
"BotDescription",
|
||||
"BotShortDescription",
|
||||
"BufferedInputFile",
|
||||
"CallbackGame",
|
||||
"CallbackQuery",
|
||||
|
|
@ -240,6 +245,7 @@ __all__ = (
|
|||
"InputMediaPhoto",
|
||||
"InputMediaVideo",
|
||||
"InputMessageContent",
|
||||
"InputSticker",
|
||||
"InputTextMessageContent",
|
||||
"InputVenueMessageContent",
|
||||
"Invoice",
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class Animation(TelegramObject):
|
|||
"""Video height as defined by sender"""
|
||||
duration: int
|
||||
"""Duration of the video in seconds as defined by sender"""
|
||||
thumb: Optional[PhotoSize] = None
|
||||
thumbnail: Optional[PhotoSize] = None
|
||||
"""*Optional*. Animation thumbnail as defined by sender"""
|
||||
file_name: Optional[str] = None
|
||||
"""*Optional*. Original animation filename as defined by sender"""
|
||||
|
|
|
|||
|
|
@ -31,5 +31,5 @@ class Audio(TelegramObject):
|
|||
"""*Optional*. MIME type of the file as defined by sender"""
|
||||
file_size: Optional[int] = None
|
||||
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||
thumb: Optional[PhotoSize] = None
|
||||
thumbnail: Optional[PhotoSize] = None
|
||||
"""*Optional*. Thumbnail of the album cover to which the music file belongs"""
|
||||
|
|
|
|||
12
aiogram/types/bot_description.py
Normal file
12
aiogram/types/bot_description.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from aiogram.types import TelegramObject
|
||||
|
||||
|
||||
class BotDescription(TelegramObject):
|
||||
"""
|
||||
This object represents the bot's description.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#botdescription
|
||||
"""
|
||||
|
||||
description: str
|
||||
"""The bot's description"""
|
||||
12
aiogram/types/bot_short_description.py
Normal file
12
aiogram/types/bot_short_description.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from aiogram.types import TelegramObject
|
||||
|
||||
|
||||
class BotShortDescription(TelegramObject):
|
||||
"""
|
||||
This object represents the bot's short description.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#botshortdescription
|
||||
"""
|
||||
|
||||
short_description: str
|
||||
"""The bot's short description"""
|
||||
|
|
@ -19,7 +19,7 @@ class Document(TelegramObject):
|
|||
"""Identifier for this file, which can be used to download or reuse the file"""
|
||||
file_unique_id: str
|
||||
"""Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."""
|
||||
thumb: Optional[PhotoSize] = None
|
||||
thumbnail: Optional[PhotoSize] = None
|
||||
"""*Optional*. Document thumbnail as defined by sender"""
|
||||
file_name: Optional[str] = None
|
||||
"""*Optional*. Original filename as defined by sender"""
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ class InlineQueryResultArticle(InlineQueryResult):
|
|||
"""*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"""
|
||||
thumb_url: Optional[str] = None
|
||||
thumbnail_url: Optional[str] = None
|
||||
"""*Optional*. Url of the thumbnail for the result"""
|
||||
thumb_width: Optional[int] = None
|
||||
thumbnail_width: Optional[int] = None
|
||||
"""*Optional*. Thumbnail width"""
|
||||
thumb_height: Optional[int] = None
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ class InlineQueryResultContact(InlineQueryResult):
|
|||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the contact"""
|
||||
thumb_url: Optional[str] = None
|
||||
thumbnail_url: Optional[str] = None
|
||||
"""*Optional*. Url of the thumbnail for the result"""
|
||||
thumb_width: Optional[int] = None
|
||||
thumbnail_width: Optional[int] = None
|
||||
"""*Optional*. Thumbnail width"""
|
||||
thumb_height: Optional[int] = None
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
|
|
|||
|
|
@ -44,9 +44,9 @@ class InlineQueryResultDocument(InlineQueryResult):
|
|||
"""*Optional*. Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the file"""
|
||||
thumb_url: Optional[str] = None
|
||||
thumbnail_url: Optional[str] = None
|
||||
"""*Optional*. URL of the thumbnail (JPEG only) for the file"""
|
||||
thumb_width: Optional[int] = None
|
||||
thumbnail_width: Optional[int] = None
|
||||
"""*Optional*. Thumbnail width"""
|
||||
thumb_height: Optional[int] = None
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class InlineQueryResultGif(InlineQueryResult):
|
|||
"""Unique identifier for this result, 1-64 bytes"""
|
||||
gif_url: str
|
||||
"""A valid URL for the GIF file. File size must not exceed 1MB"""
|
||||
thumb_url: str
|
||||
thumbnail_url: str
|
||||
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
|
||||
gif_width: Optional[int] = None
|
||||
"""*Optional*. Width of the GIF"""
|
||||
|
|
@ -35,7 +35,7 @@ class InlineQueryResultGif(InlineQueryResult):
|
|||
"""*Optional*. Height of the GIF"""
|
||||
gif_duration: Optional[int] = None
|
||||
"""*Optional*. Duration of the GIF in seconds"""
|
||||
thumb_mime_type: Optional[str] = None
|
||||
thumbnail_mime_type: Optional[str] = None
|
||||
"""*Optional*. MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'"""
|
||||
title: Optional[str] = None
|
||||
"""*Optional*. Title for the result"""
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ class InlineQueryResultLocation(InlineQueryResult):
|
|||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the location"""
|
||||
thumb_url: Optional[str] = None
|
||||
thumbnail_url: Optional[str] = None
|
||||
"""*Optional*. Url of the thumbnail for the result"""
|
||||
thumb_width: Optional[int] = None
|
||||
thumbnail_width: Optional[int] = None
|
||||
"""*Optional*. Thumbnail width"""
|
||||
thumb_height: Optional[int] = None
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
|||
"""Unique identifier for this result, 1-64 bytes"""
|
||||
mpeg4_url: str
|
||||
"""A valid URL for the MPEG4 file. File size must not exceed 1MB"""
|
||||
thumb_url: str
|
||||
thumbnail_url: str
|
||||
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
|
||||
mpeg4_width: Optional[int] = None
|
||||
"""*Optional*. Video width"""
|
||||
|
|
@ -35,7 +35,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
|||
"""*Optional*. Video height"""
|
||||
mpeg4_duration: Optional[int] = None
|
||||
"""*Optional*. Video duration in seconds"""
|
||||
thumb_mime_type: Optional[str] = None
|
||||
thumbnail_mime_type: Optional[str] = None
|
||||
"""*Optional*. MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'"""
|
||||
title: Optional[str] = None
|
||||
"""*Optional*. Title for the result"""
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||
"""Unique identifier for this result, 1-64 bytes"""
|
||||
photo_url: str
|
||||
"""A valid URL of the photo. Photo must be in **JPEG** format. Photo size must not exceed 5MB"""
|
||||
thumb_url: str
|
||||
thumbnail_url: str
|
||||
"""URL of the thumbnail for the photo"""
|
||||
photo_width: Optional[int] = None
|
||||
"""*Optional*. Width of the photo"""
|
||||
|
|
|
|||
|
|
@ -44,9 +44,9 @@ class InlineQueryResultVenue(InlineQueryResult):
|
|||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the venue"""
|
||||
thumb_url: Optional[str] = None
|
||||
thumbnail_url: Optional[str] = None
|
||||
"""*Optional*. Url of the thumbnail for the result"""
|
||||
thumb_width: Optional[int] = None
|
||||
thumbnail_width: Optional[int] = None
|
||||
"""*Optional*. Thumbnail width"""
|
||||
thumb_height: Optional[int] = None
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class InlineQueryResultVideo(InlineQueryResult):
|
|||
"""A valid URL for the embedded video player or video file"""
|
||||
mime_type: str
|
||||
"""MIME type of the content of the video URL, 'text/html' or 'video/mp4'"""
|
||||
thumb_url: str
|
||||
thumbnail_url: str
|
||||
"""URL of the thumbnail (JPEG only) for the video"""
|
||||
title: str
|
||||
"""Title for the result"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class InputMediaAnimation(InputMedia):
|
|||
"""Type of the result, must be *animation*"""
|
||||
media: Union[str, InputFile]
|
||||
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
thumb: Optional[Union[InputFile, str]] = None
|
||||
thumbnail: Optional[Union[InputFile, str]] = None
|
||||
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the animation to be sent, 0-1024 characters after entities parsing"""
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue