InputSticker¶
- class telegram.InputSticker(sticker, emoji_list, format, mask_position=None, keywords=None, *, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObjectThis object describes a sticker to be added to a sticker set.
Use In
Added in version 20.2.
Changed in version 21.1: As of Bot API 7.2, the new argument
formatis a required argument, and thus the order of the arguments has changed.- Parameters:
sticker (
str| file object |InputFile|bytes|pathlib.Path) – The added sticker. To upload a file, you can either pass a file object (e.g.open("filename", "rb")) or the file contents as bytes. If the bot is running inlocal_mode, passing the path of the file (as string orpathlib.Pathobject) is supported as well. Animated and video stickers can’t be uploaded via HTTP URL.emoji_list (Sequence[
str]) – Sequence of1-20emoji associated with the sticker.mask_position (
telegram.MaskPosition, optional) – Position where the mask should be placed on faces. For “'mask'” stickers only.keywords (Sequence[
str], optional) – Sequence of 0-20search keywords for the sticker with the total length of up to64characters. For “'regular'” and “'custom_emoji'” stickers only.format (
str) –Format of the added sticker, must be one of
'static'for a.WEBPor.PNGimage,'animated'for a.TGSanimation,'video'for a WEBM video.Added in version 21.1.
- sticker[source]¶
The added sticker.
- Type:
str|telegram.InputFile
- mask_position[source]¶
Optional. Position where the mask should be placed on faces. For “
'mask'” stickers only.- Type:
- keywords[source]¶
Optional. Tuple of 0-
20search keywords for the sticker with the total length of up to64characters. For “'regular'” and “'custom_emoji'” stickers only. “'custom_emoji'” stickers only.- Type:
tuple[
str]
- format[source]¶
Format of the added sticker, must be one of
'static'for a.WEBPor.PNGimage,'animated'for a.TGSanimation,'video'for a WEBM video.Added in version 21.1.
- Type:
str