Hide navigation sidebar
Hide table of contents sidebar
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
Back to top
Toggle table of contents sidebar

# InputSticker

class telegram.InputSticker(sticker, emoji_list, mask_position=None, keywords=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object describes a sticker to be added to a sticker set.

  Use In

  - `telegram.Bot.add_sticker_to_set()`

  - `telegram.Bot.create_new_sticker_set()`

  New in version 20.2.

  Parameters:

    - sticker (`str` | file object | `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 in `local_mode`, passing the path of the file (as string or `pathlib.Path` object) is supported as well. Animated and video stickers can’t be uploaded via HTTP URL.

    - emoji_list (Sequence[`str`]) – Sequence of `1` - `20` emoji 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-`20` search keywords for the sticker with the total length of up to `64` characters. For “`'regular'`” and “`'custom_emoji'`” stickers only.

  sticker

    The added sticker.

    Type:

      `str` | `telegram.InputFile`

  emoji_list

    Tuple of `1` - `20` emoji associated with the sticker.

    Type:

      Tuple[`str`]

  mask_position

    Optional. Position where the mask should be placed on faces. For “`'mask'`” stickers only.

    Type:

      `telegram.MaskPosition`

  keywords

    Optional. Tuple of 0-`20` search keywords for the sticker with the total length of up to `64` characters. For “`'regular'`” and “`'custom_emoji'`” stickers only.

    Type:

      Tuple[`str`]