`. 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"
+ },
+ {
+ "anchor": "setcustomemojistickersetthumbnail",
+ "name": "setCustomEmojiStickerSetThumbnail",
+ "description": "Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.",
+ "html_description": "Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
",
+ "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": "Sticker set name | ",
+ "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": "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. | ",
+ "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"
+ },
+ {
+ "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": "Use this method to delete a sticker set that was created by the bot. Returns True on success.
",
+ "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": "Sticker set name | ",
+ "rst_description": "Sticker set name\n",
+ "name": "name"
}
],
"category": "methods"
@@ -9278,7 +9568,7 @@
"description": "Url of the thumbnail for the result",
"html_description": "Optional. Url of the thumbnail for the result | ",
"rst_description": "*Optional*. Url of the thumbnail for the result\n",
- "name": "thumb_url",
+ "name": "thumbnail_url",
"required": false
},
{
@@ -9286,7 +9576,7 @@
"description": "Thumbnail width",
"html_description": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -9294,7 +9584,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
@@ -9336,7 +9626,7 @@
"description": "URL of the thumbnail for the photo",
"html_description": "URL of the thumbnail for the photo | ",
"rst_description": "URL of the thumbnail for the photo\n",
- "name": "thumb_url",
+ "name": "thumbnail_url",
"required": true
},
{
@@ -9474,7 +9764,7 @@
"description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result",
"html_description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result | ",
"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
},
{
@@ -9482,7 +9772,7 @@
"description": "MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'",
"html_description": "Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” | ",
"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
},
{
@@ -9596,7 +9886,7 @@
"description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result",
"html_description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result | ",
"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
},
{
@@ -9604,7 +9894,7 @@
"description": "MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'",
"html_description": "Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” | ",
"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
},
{
@@ -9702,7 +9992,7 @@
"description": "URL of the thumbnail (JPEG only) for the video",
"html_description": "URL of the thumbnail (JPEG only) for the video | ",
"rst_description": "URL of the thumbnail (JPEG only) for the video\n",
- "name": "thumb_url",
+ "name": "thumbnail_url",
"required": true
},
{
@@ -10076,7 +10366,7 @@
"description": "URL of the thumbnail (JPEG only) for the file",
"html_description": "Optional. URL of the thumbnail (JPEG only) for the file | ",
"rst_description": "*Optional*. URL of the thumbnail (JPEG only) for the file\n",
- "name": "thumb_url",
+ "name": "thumbnail_url",
"required": false
},
{
@@ -10084,7 +10374,7 @@
"description": "Thumbnail width",
"html_description": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -10092,7 +10382,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
@@ -10198,7 +10488,7 @@
"description": "Url of the thumbnail for the result",
"html_description": "Optional. Url of the thumbnail for the result | ",
"rst_description": "*Optional*. Url of the thumbnail for the result\n",
- "name": "thumb_url",
+ "name": "thumbnail_url",
"required": false
},
{
@@ -10206,7 +10496,7 @@
"description": "Thumbnail width",
"html_description": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -10214,7 +10504,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
@@ -10328,7 +10618,7 @@
"description": "Url of the thumbnail for the result",
"html_description": "Optional. Url of the thumbnail for the result | ",
"rst_description": "*Optional*. Url of the thumbnail for the result\n",
- "name": "thumb_url",
+ "name": "thumbnail_url",
"required": false
},
{
@@ -10336,7 +10626,7 @@
"description": "Thumbnail width",
"html_description": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -10344,7 +10634,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
@@ -10426,7 +10716,7 @@
"description": "Url of the thumbnail for the result",
"html_description": "Optional. Url of the thumbnail for the result | ",
"rst_description": "*Optional*. Url of the thumbnail for the result\n",
- "name": "thumb_url",
+ "name": "thumbnail_url",
"required": false
},
{
@@ -10434,7 +10724,7 @@
"description": "Thumbnail width",
"html_description": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -10442,7 +10732,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
diff --git a/.butcher/types/Animation/entity.json b/.butcher/types/Animation/entity.json
index 2de45c1b..db471f53 100644
--- a/.butcher/types/Animation/entity.json
+++ b/.butcher/types/Animation/entity.json
@@ -58,7 +58,7 @@
"description": "Animation thumbnail as defined by sender",
"html_description": "Optional. Animation thumbnail as defined by sender | ",
"rst_description": "*Optional*. Animation thumbnail as defined by sender\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
},
{
diff --git a/.butcher/types/Audio/entity.json b/.butcher/types/Audio/entity.json
index 4b94b3a1..c65b9118 100644
--- a/.butcher/types/Audio/entity.json
+++ b/.butcher/types/Audio/entity.json
@@ -82,7 +82,7 @@
"description": "Thumbnail of the album cover to which the music file belongs",
"html_description": "Optional. Thumbnail of the album cover to which the music file belongs | ",
"rst_description": "*Optional*. Thumbnail of the album cover to which the music file belongs\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
}
],
diff --git a/.butcher/types/BotDescription/entity.json b/.butcher/types/BotDescription/entity.json
new file mode 100644
index 00000000..6d47a69d
--- /dev/null
+++ b/.butcher/types/BotDescription/entity.json
@@ -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": "This object represents the bot's description.
",
+ "rst_description": "This object represents the bot's description.",
+ "annotations": [
+ {
+ "type": "String",
+ "description": "The bot's description",
+ "html_description": "The bot's description | ",
+ "rst_description": "The bot's description\n",
+ "name": "description",
+ "required": true
+ }
+ ],
+ "category": "types"
+ }
+}
diff --git a/.butcher/types/BotShortDescription/entity.json b/.butcher/types/BotShortDescription/entity.json
new file mode 100644
index 00000000..dcd3e80c
--- /dev/null
+++ b/.butcher/types/BotShortDescription/entity.json
@@ -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": "This object represents the bot's short description.
",
+ "rst_description": "This object represents the bot's short description.",
+ "annotations": [
+ {
+ "type": "String",
+ "description": "The bot's short description",
+ "html_description": "The bot's short description | ",
+ "rst_description": "The bot's short description\n",
+ "name": "short_description",
+ "required": true
+ }
+ ],
+ "category": "types"
+ }
+}
diff --git a/.butcher/types/Document/entity.json b/.butcher/types/Document/entity.json
index 65e0386d..036df2c4 100644
--- a/.butcher/types/Document/entity.json
+++ b/.butcher/types/Document/entity.json
@@ -34,7 +34,7 @@
"description": "Document thumbnail as defined by sender",
"html_description": "Optional. Document thumbnail as defined by sender | ",
"rst_description": "*Optional*. Document thumbnail as defined by sender\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
},
{
diff --git a/.butcher/types/InlineQueryResultArticle/entity.json b/.butcher/types/InlineQueryResultArticle/entity.json
index 93c397e7..74b635ff 100644
--- a/.butcher/types/InlineQueryResultArticle/entity.json
+++ b/.butcher/types/InlineQueryResultArticle/entity.json
@@ -82,7 +82,7 @@
"description": "Url of the thumbnail for the result",
"html_description": "Optional. Url of the thumbnail for the result | ",
"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": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -98,7 +98,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
diff --git a/.butcher/types/InlineQueryResultContact/entity.json b/.butcher/types/InlineQueryResultContact/entity.json
index 3b9b65fa..2445e5d7 100644
--- a/.butcher/types/InlineQueryResultContact/entity.json
+++ b/.butcher/types/InlineQueryResultContact/entity.json
@@ -82,7 +82,7 @@
"description": "Url of the thumbnail for the result",
"html_description": "Optional. Url of the thumbnail for the result | ",
"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": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -98,7 +98,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
diff --git a/.butcher/types/InlineQueryResultDocument/entity.json b/.butcher/types/InlineQueryResultDocument/entity.json
index 76a1bb70..1eda8583 100644
--- a/.butcher/types/InlineQueryResultDocument/entity.json
+++ b/.butcher/types/InlineQueryResultDocument/entity.json
@@ -106,7 +106,7 @@
"description": "URL of the thumbnail (JPEG only) for the file",
"html_description": "Optional. URL of the thumbnail (JPEG only) for the file | ",
"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": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -122,7 +122,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
diff --git a/.butcher/types/InlineQueryResultGif/entity.json b/.butcher/types/InlineQueryResultGif/entity.json
index 89f56afc..b6ab8d8f 100644
--- a/.butcher/types/InlineQueryResultGif/entity.json
+++ b/.butcher/types/InlineQueryResultGif/entity.json
@@ -66,7 +66,7 @@
"description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result",
"html_description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result | ",
"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": "Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” | ",
"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
},
{
diff --git a/.butcher/types/InlineQueryResultLocation/entity.json b/.butcher/types/InlineQueryResultLocation/entity.json
index 7f14565f..c4cdf8e7 100644
--- a/.butcher/types/InlineQueryResultLocation/entity.json
+++ b/.butcher/types/InlineQueryResultLocation/entity.json
@@ -106,7 +106,7 @@
"description": "Url of the thumbnail for the result",
"html_description": "Optional. Url of the thumbnail for the result | ",
"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": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -122,7 +122,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
diff --git a/.butcher/types/InlineQueryResultMpeg4Gif/entity.json b/.butcher/types/InlineQueryResultMpeg4Gif/entity.json
index 27ebd1e3..69916a5b 100644
--- a/.butcher/types/InlineQueryResultMpeg4Gif/entity.json
+++ b/.butcher/types/InlineQueryResultMpeg4Gif/entity.json
@@ -66,7 +66,7 @@
"description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result",
"html_description": "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result | ",
"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": "Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” | ",
"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
},
{
diff --git a/.butcher/types/InlineQueryResultPhoto/entity.json b/.butcher/types/InlineQueryResultPhoto/entity.json
index 9aa12a16..a216aacf 100644
--- a/.butcher/types/InlineQueryResultPhoto/entity.json
+++ b/.butcher/types/InlineQueryResultPhoto/entity.json
@@ -42,7 +42,7 @@
"description": "URL of the thumbnail for the photo",
"html_description": "URL of the thumbnail for the photo | ",
"rst_description": "URL of the thumbnail for the photo\n",
- "name": "thumb_url",
+ "name": "thumbnail_url",
"required": true
},
{
diff --git a/.butcher/types/InlineQueryResultVenue/entity.json b/.butcher/types/InlineQueryResultVenue/entity.json
index af6c2d22..3bf6bebe 100644
--- a/.butcher/types/InlineQueryResultVenue/entity.json
+++ b/.butcher/types/InlineQueryResultVenue/entity.json
@@ -114,7 +114,7 @@
"description": "Url of the thumbnail for the result",
"html_description": "Optional. Url of the thumbnail for the result | ",
"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": "Optional. Thumbnail width | ",
"rst_description": "*Optional*. Thumbnail width\n",
- "name": "thumb_width",
+ "name": "thumbnail_width",
"required": false
},
{
@@ -130,7 +130,7 @@
"description": "Thumbnail height",
"html_description": "Optional. Thumbnail height | ",
"rst_description": "*Optional*. Thumbnail height\n",
- "name": "thumb_height",
+ "name": "thumbnail_height",
"required": false
}
],
diff --git a/.butcher/types/InlineQueryResultVideo/entity.json b/.butcher/types/InlineQueryResultVideo/entity.json
index 784a8728..abc82746 100644
--- a/.butcher/types/InlineQueryResultVideo/entity.json
+++ b/.butcher/types/InlineQueryResultVideo/entity.json
@@ -50,7 +50,7 @@
"description": "URL of the thumbnail (JPEG only) for the video",
"html_description": "URL of the thumbnail (JPEG only) for the video | ",
"rst_description": "URL of the thumbnail (JPEG only) for the video\n",
- "name": "thumb_url",
+ "name": "thumbnail_url",
"required": true
},
{
diff --git a/.butcher/types/InputMediaAnimation/entity.json b/.butcher/types/InputMediaAnimation/entity.json
index 80dd5629..4d694d1b 100644
--- a/.butcher/types/InputMediaAnimation/entity.json
+++ b/.butcher/types/InputMediaAnimation/entity.json
@@ -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://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files",
"html_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>. More information on Sending Files » | ",
"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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
},
{
diff --git a/.butcher/types/InputMediaAudio/entity.json b/.butcher/types/InputMediaAudio/entity.json
index 43963950..e16a0a7d 100644
--- a/.butcher/types/InputMediaAudio/entity.json
+++ b/.butcher/types/InputMediaAudio/entity.json
@@ -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://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files",
"html_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>. More information on Sending Files » | ",
"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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
},
{
diff --git a/.butcher/types/InputMediaDocument/entity.json b/.butcher/types/InputMediaDocument/entity.json
index cd51dea9..97bcbcd3 100644
--- a/.butcher/types/InputMediaDocument/entity.json
+++ b/.butcher/types/InputMediaDocument/entity.json
@@ -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://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files",
"html_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>. More information on Sending Files » | ",
"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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
},
{
diff --git a/.butcher/types/InputMediaVideo/entity.json b/.butcher/types/InputMediaVideo/entity.json
index 97ceb6b7..1f5e6487 100644
--- a/.butcher/types/InputMediaVideo/entity.json
+++ b/.butcher/types/InputMediaVideo/entity.json
@@ -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://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files",
"html_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>. More information on Sending Files » | ",
"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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
},
{
diff --git a/.butcher/types/InputSticker/entity.json b/.butcher/types/InputSticker/entity.json
new file mode 100644
index 00000000..819f81f9
--- /dev/null
+++ b/.butcher/types/InputSticker/entity.json
@@ -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": "This object describes a sticker to be added to a sticker set.
",
+ "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": "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 » | ",
+ "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 » `\n",
+ "name": "sticker",
+ "required": true
+ },
+ {
+ "type": "Array of String",
+ "description": "List of 1-20 emoji associated with the sticker",
+ "html_description": "List of 1-20 emoji associated with the sticker | ",
+ "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": "Optional. Position where the mask should be placed on faces. For “mask” stickers only. | ",
+ "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": "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. | ",
+ "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"
+ }
+}
diff --git a/.butcher/types/Sticker/entity.json b/.butcher/types/Sticker/entity.json
index 8d0f1d88..cd3d092b 100644
--- a/.butcher/types/Sticker/entity.json
+++ b/.butcher/types/Sticker/entity.json
@@ -74,7 +74,7 @@
"description": "Sticker thumbnail in the .WEBP or .JPG format",
"html_description": "Optional. Sticker thumbnail in the .WEBP or .JPG format | ",
"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": "Optional. 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 | ",
+ "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",
diff --git a/.butcher/types/StickerSet/entity.json b/.butcher/types/StickerSet/entity.json
index 4e370e93..b766cd7d 100644
--- a/.butcher/types/StickerSet/entity.json
+++ b/.butcher/types/StickerSet/entity.json
@@ -66,7 +66,7 @@
"description": "Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format",
"html_description": "Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format | ",
"rst_description": "*Optional*. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
}
],
diff --git a/.butcher/types/Video/entity.json b/.butcher/types/Video/entity.json
index 65c5594f..52bb1439 100644
--- a/.butcher/types/Video/entity.json
+++ b/.butcher/types/Video/entity.json
@@ -58,7 +58,7 @@
"description": "Video thumbnail",
"html_description": "Optional. Video thumbnail | ",
"rst_description": "*Optional*. Video thumbnail\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
},
{
diff --git a/.butcher/types/VideoNote/entity.json b/.butcher/types/VideoNote/entity.json
index 85dbf566..a27d9a7d 100644
--- a/.butcher/types/VideoNote/entity.json
+++ b/.butcher/types/VideoNote/entity.json
@@ -50,7 +50,7 @@
"description": "Video thumbnail",
"html_description": "Optional. Video thumbnail | ",
"rst_description": "*Optional*. Video thumbnail\n",
- "name": "thumb",
+ "name": "thumbnail",
"required": false
},
{
diff --git a/CHANGES/1139.misc.rst b/CHANGES/1139.misc.rst
new file mode 100644
index 00000000..432607e0
--- /dev/null
+++ b/CHANGES/1139.misc.rst
@@ -0,0 +1,7 @@
+Added full support of `Bot API 6.6 `_
+
+.. 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.
diff --git a/README.rst b/README.rst
index bf5a7d11..3c2297a8 100644
--- a/README.rst
+++ b/README.rst
@@ -63,7 +63,7 @@ Features
- Asynchronous (`asyncio docs `_, :pep:`492`)
- Has type hints (:pep:`484`) and can be used with `mypy `_
- Supports `PyPy `_
-- Supports `Telegram Bot API 6.5 `_ and gets fast updates to the latest versions of the Bot API
+- Supports `Telegram Bot API 6.6 `_ and gets fast updates to the latest versions of the Bot API
- Telegram Bot API integration code was `autogenerated `_ and can be easily re-generated when API gets updated
- Updates router (Blueprints)
- Has Finite State Machine
diff --git a/aiogram/__init__.py b/aiogram/__init__.py
index a703578e..4ed355fc 100644
--- a/aiogram/__init__.py
+++ b/aiogram/__init__.py
@@ -37,5 +37,5 @@ __all__ = (
"flags",
)
-__version__ = "3.0.0b7"
-__api_version__ = "6.5"
+__version__ = "3.0.0b8"
+__api_version__ = "6.6"
diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py
index d9ddc07a..91dd91fa 100644
--- a/aiogram/client/bot.py
+++ b/aiogram/client/bot.py
@@ -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 » `
- :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 `_ 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 `_ 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_"`. :code:`` 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 » `
- :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 `_ 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 `_ 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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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 `_ 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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `
:param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param 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 » `
: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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `
:param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the document caption. See `formatting options `_ for more details.
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
@@ -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 » `
+ :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+ :param emoji: Emoji associated with the sticker; only for just uploaded stickers
:param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param reply_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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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 `_ 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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `
:param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param 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 `_ for animated sticker technical requirements, or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements `_`https://core.telegram.org/stickers#video-sticker-requirements `_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `. Animated 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 » `
+ :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 `_ for technical requirements. :ref:`More information on 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 `_ 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 `_ for animated sticker technical requirements), or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements `_`https://core.telegram.org/stickers#video-sticker-requirements `_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » `. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
+ :param request_timeout: Request timeout
+ :return: Returns :code:`True` on success.
+ """
+
+ 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)
diff --git a/aiogram/client/session/aiohttp.py b/aiogram/client/session/aiohttp.py
index 4d9dff06..3f35a0e0 100644
--- a/aiogram/client/session/aiohttp.py
+++ b/aiogram/client/session/aiohttp.py
@@ -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:
diff --git a/aiogram/enums/__init__.py b/aiogram/enums/__init__.py
index a744ba55..73422378 100644
--- a/aiogram/enums/__init__.py
+++ b/aiogram/enums/__init__.py
@@ -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",
diff --git a/aiogram/enums/inline_query_result_type.py b/aiogram/enums/inline_query_result_type.py
index fa063fcb..771dc498 100644
--- a/aiogram/enums/inline_query_result_type.py
+++ b/aiogram/enums/inline_query_result_type.py
@@ -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"
diff --git a/aiogram/enums/sticker_format.py b/aiogram/enums/sticker_format.py
new file mode 100644
index 00000000..6c9441d9
--- /dev/null
+++ b/aiogram/enums/sticker_format.py
@@ -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"
diff --git a/aiogram/filters/command.py b/aiogram/filters/command.py
index 13997073..85ff4de6 100644
--- a/aiogram/filters/command.py
+++ b/aiogram/filters/command.py
@@ -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:
diff --git a/aiogram/methods/__init__.py b/aiogram/methods/__init__.py
index d50e99a0..5bf0edf5 100644
--- a/aiogram/methods/__init__.py
+++ b/aiogram/methods/__init__.py
@@ -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",
diff --git a/aiogram/methods/add_sticker_to_set.py b/aiogram/methods/add_sticker_to_set.py
index 6fe7b7a1..75b8387a 100644
--- a/aiogram/methods/add_sticker_to_set.py
+++ b/aiogram/methods/add_sticker_to_set.py
@@ -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 » `"""
- 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 `_ 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 `_ 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)
diff --git a/aiogram/methods/base.py b/aiogram/methods/base.py
index 699c10c7..8f9db0d4 100644
--- a/aiogram/methods/base.py
+++ b/aiogram/methods/base.py
@@ -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"]
diff --git a/aiogram/methods/create_new_sticker_set.py b/aiogram/methods/create_new_sticker_set.py
index 00ae4052..651c6672 100644
--- a/aiogram/methods/create_new_sticker_set.py
+++ b/aiogram/methods/create_new_sticker_set.py
@@ -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_"`. :code:`` 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 » `"""
- 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 `_ 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 `_ 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)
diff --git a/aiogram/methods/delete_sticker_set.py b/aiogram/methods/delete_sticker_set.py
new file mode 100644
index 00000000..2ffa48f2
--- /dev/null
+++ b/aiogram/methods/delete_sticker_set.py
@@ -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)
diff --git a/aiogram/methods/get_my_description.py b/aiogram/methods/get_my_description.py
new file mode 100644
index 00000000..770e6263
--- /dev/null
+++ b/aiogram/methods/get_my_description.py
@@ -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)
diff --git a/aiogram/methods/get_my_short_description.py b/aiogram/methods/get_my_short_description.py
new file mode 100644
index 00000000..a38d4ecc
--- /dev/null
+++ b/aiogram/methods/get_my_short_description.py
@@ -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)
diff --git a/aiogram/methods/send_animation.py b/aiogram/methods/send_animation.py
index 3bebdc78..7528d8be 100644
--- a/aiogram/methods/send_animation.py
+++ b/aiogram/methods/send_animation.py
@@ -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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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)
diff --git a/aiogram/methods/send_audio.py b/aiogram/methods/send_audio.py
index 1786f751..6557a5c1 100644
--- a/aiogram/methods/send_audio.py
+++ b/aiogram/methods/send_audio.py
@@ -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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `"""
disable_notification: Optional[bool] = None
"""Sends the message `silently `_. 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)
diff --git a/aiogram/methods/send_document.py b/aiogram/methods/send_document.py
index 6f99e756..9b81b88f 100644
--- a/aiogram/methods/send_document.py
+++ b/aiogram/methods/send_document.py
@@ -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 » `"""
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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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)
diff --git a/aiogram/methods/send_sticker.py b/aiogram/methods/send_sticker.py
index 81ab698d..e707cd2f 100644
--- a/aiogram/methods/send_sticker.py
+++ b/aiogram/methods/send_sticker.py
@@ -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 » `"""
+ """Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » `. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL."""
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 `_. Users will receive a notification with no sound."""
protect_content: Optional[bool] = None
diff --git a/aiogram/methods/send_video.py b/aiogram/methods/send_video.py
index b144d090..8075b1fb 100644
--- a/aiogram/methods/send_video.py
+++ b/aiogram/methods/send_video.py
@@ -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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on 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)
diff --git a/aiogram/methods/send_video_note.py b/aiogram/methods/send_video_note.py
index 19776e62..3db3a142 100644
--- a/aiogram/methods/send_video_note.py
+++ b/aiogram/methods/send_video_note.py
@@ -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://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `"""
disable_notification: Optional[bool] = None
"""Sends the message `silently `_. 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)
diff --git a/aiogram/methods/set_custom_emoji_sticker_set_thumbnail.py b/aiogram/methods/set_custom_emoji_sticker_set_thumbnail.py
new file mode 100644
index 00000000..35b047a2
--- /dev/null
+++ b/aiogram/methods/set_custom_emoji_sticker_set_thumbnail.py
@@ -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)
diff --git a/aiogram/methods/set_my_default_administrator_rights.py b/aiogram/methods/set_my_default_administrator_rights.py
index 84341180..f8177958 100644
--- a/aiogram/methods/set_my_default_administrator_rights.py
+++ b/aiogram/methods/set_my_default_administrator_rights.py
@@ -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
"""
diff --git a/aiogram/methods/set_my_description.py b/aiogram/methods/set_my_description.py
new file mode 100644
index 00000000..a05440ef
--- /dev/null
+++ b/aiogram/methods/set_my_description.py
@@ -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)
diff --git a/aiogram/methods/set_my_short_description.py b/aiogram/methods/set_my_short_description.py
new file mode 100644
index 00000000..c759d1ed
--- /dev/null
+++ b/aiogram/methods/set_my_short_description.py
@@ -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)
diff --git a/aiogram/methods/set_sticker_emoji_list.py b/aiogram/methods/set_sticker_emoji_list.py
new file mode 100644
index 00000000..d6ef31f2
--- /dev/null
+++ b/aiogram/methods/set_sticker_emoji_list.py
@@ -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)
diff --git a/aiogram/methods/set_sticker_keywords.py b/aiogram/methods/set_sticker_keywords.py
new file mode 100644
index 00000000..2fd5b1c4
--- /dev/null
+++ b/aiogram/methods/set_sticker_keywords.py
@@ -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)
diff --git a/aiogram/methods/set_sticker_mask_position.py b/aiogram/methods/set_sticker_mask_position.py
new file mode 100644
index 00000000..95aa8ca3
--- /dev/null
+++ b/aiogram/methods/set_sticker_mask_position.py
@@ -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 `_ 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)
diff --git a/aiogram/methods/set_sticker_set_thumb.py b/aiogram/methods/set_sticker_set_thumb.py
deleted file mode 100644
index cbab57e4..00000000
--- a/aiogram/methods/set_sticker_set_thumb.py
+++ /dev/null
@@ -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