peyk.platforms.telegram.types.sticker

Classes

Sticker(file_id, file_unique_id, type, ...)

This object represents a sticker.

class peyk.platforms.telegram.types.sticker.Sticker(file_id: str, file_unique_id: str, type: str, width: int, height: int, is_animated: bool = False, is_video: bool = False, thumbnail: PhotoSize | None = None, emoji: str | None = None, set_name: str | None = None, premium_animation: File | None = None, mask_position: MaskPosition | None = None, custom_emoji_id: str | None = None, needs_repainting: bool | None = None, file_size: int | None = None)[source]

Bases: object

This object represents a sticker.

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • type (str) – Type of the sticker, currently one of ‘regular’, ‘mask’, ‘custom_emoji’. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.

  • width (int) – Sticker width

  • height (int) – Sticker height

  • is_animated (bool) – True, if the sticker is animated

  • is_video (bool) – True, if the sticker is a video sticker

  • thumbnail (peyk.platforms.telegram.types.photo_size.PhotoSize | None) – Sticker thumbnail in the .WEBP or .JPG format

  • emoji (str | None) – Emoji associated with the sticker

  • set_name (str | None) – Name of the sticker set to which the sticker belongs

  • premium_animation (peyk.platforms.telegram.types.file.File | None) – For premium regular stickers, premium animation for the sticker

  • mask_position (peyk.platforms.telegram.types.mask_position.MaskPosition | None) – For mask stickers, the position where the mask should be placed

  • custom_emoji_id (str | None) – For custom emoji stickers, unique identifier of the custom emoji

  • needs_repainting (bool | None) – 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

  • file_size (int | None) – File size in bytes

file_id: str
file_unique_id: str
type: str
width: int
height: int
is_animated: bool = False
is_video: bool = False
thumbnail: PhotoSize | None = None
emoji: str | None = None
set_name: str | None = None
premium_animation: File | None = None
mask_position: MaskPosition | None = None
custom_emoji_id: str | None = None
needs_repainting: bool | None = None
file_size: int | None = None
classmethod from_dict(data: dict | None) Sticker | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

classmethod list_from(data: List[dict] | None) List[Sticker] | None[source]

Provides the list from operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.