A sticker

Hierarchy (View Summary)

Constructors

Properties

dcId?: number

DC ID of the file, when available

fileSize?: number

File size in bytes, when available

location:
    | Uint8Array
    | TypeInputFileLocation
    | TypeInputWebFileLocation
    | () => Uint8Array | TypeInputFileLocation | TypeInputWebFileLocation

Location of the file.

Either a TL object declaring remote file location, a Buffer containing actual file content (for stripped thumbnails and vector previews), or a function that will return either of those.

When a function is passed, it will be lazily resolved the first time downloading the file.

type: "sticker" = ...

Type of the media (for use in a tagged union)

Accessors

  • get customEmojiFree(): boolean
  • Whether this custom emoji can be used by non-premium users. false if this is not a custom emoji.

    Not sure if there are any such stickers currently.

    Returns boolean

  • get customEmojiId(): Long
  • If this is a custom emoji, its unique ID that can be used in TelegramClient#getCustomEmojis

    Returns Long

  • get date(): Date
  • Date the document was sent

    Returns Date

  • get emoji(): string
  • Primary emoji associated with this sticker, that is displayed in dialogs list.

    If there is none, empty string is returned.

    Note: This only contains at most one emoji. Some stickers have multiple associated emojis, but only one is returned here. This is Telegram's limitation! Use getAllEmojis instead.

    For custom emojis, this alt should be used as a fallback text that will be "behind" the custom emoji entity.

    Returns string

  • get fileId(): string
  • Get TDLib and Bot API compatible File ID representing this document.

    Returns string

  • get fileName(): null | string
  • Original file name, extracted from the document attributes.

    Returns null | string

  • get hasStickerSet(): boolean
  • Whether this sticker has an associated public sticker set.

    Returns boolean

  • get height(): number
  • Sticker height in pixels

    Returns number

  • get inputDocument(): TypeInputDocument
  • Input document TL object generated from this object, to be used with methods that use it

    Returns TypeInputDocument

  • get inputStickerSet(): null | TypeInputStickerSet
  • Input sticker set that it associated with this sticker, if available.

    Returns null | TypeInputStickerSet

  • get isPremiumSticker(): boolean
  • Whether this sticker is a premium sticker (has premium fullscreen animation)

    Returns boolean

  • get isValidSticker(): boolean
  • Whether this sticker is a valid sticker.

    If it is not, then this is probably a WEBP photo that Telegram treats as a sticker.

    Returns boolean

  • get maskPosition(): null | MaskPosition
  • Position where this mask should be placed

    Returns null | MaskPosition

  • get mimeType(): string
  • File MIME type, as defined by the sender.

    Returns string

  • get stickerType(): StickerType
  • Type of the sticker

    Returns StickerType

  • get thumbnails(): readonly Thumbnail[]
  • Available thumbnails, if any.

    If there are no thumbnails, the array will be empty.

    Returns readonly Thumbnail[]

  • get uniqueFileId(): string
  • Get a unique File ID representing this document.

    Returns string

  • get width(): number
  • Sticker width in pixels

    Returns number

Methods

  • Get a thumbnail by its type.

    Thumbnail types are described in the Telegram docs, and are also available as static members of Thumbnail for convenience.

    Parameters

    • type: string

      Thumbnail type

    Returns null | Thumbnail