Class Sticker

Hierarchy (view full)

Constructors

Properties

animated: boolean

True, if the sticker is animated

animation?: InputFile

For premium regular stickers, premium animation for the sticker

emoji?: string

Emoji associated with the sticker

emojiId?: string

For custom emoji stickers, unique identifier of the custom emoji

height: number

Sticker height

id: string

The unique identifier for this file

mask?: MaskPosition

For mask stickers, the position where the mask should be placed

path: null | string

The path to the file on the Telegram server, if available

setName?: string

Name of the sticker set to which the sticker belongs

size: null | number

The size of the file in bytes, if available

thumbnail?: Photo

Sticker thumbnail in the .WEBP or .JPG format

type: "regular" | "custom_emoji" | "mask"

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.

uniqueId: string

The unique identifier for this file, which is supposed to be consistent across different bots

video: boolean

True, if the sticker is a video sticker

width: number

Sticker width

Accessors

  • get url(): null | string
  • Gets the URL to access the file on the Telegram server.

    Returns null | string

Methods

  • Protected

    Patches the current instance with new data

    Parameters

    • data: Record<string, any>

      The data to patch the instance with

    Returns Record<string, any>

    The patched data

  • Protected

    Updates the current instance with new data and returns a clone of the updated instance

    Parameters

    • data: Record<string, any>

      The data to update the instance with

    Returns Base

    A clone of the updated instance

  • Downloads the file from the Telegram server.

    Parameters

    • OptionalfilePath: null | string

      The path of the file on the Telegram server.

    Returns Promise<Buffer>

    A promise that resolves with the file data as a Buffer.

  • Writes the file to the specified path.

    Parameters

    • path: string

      The path where the file should be written.

    • OptionalwriteType: "promise"

      The type of write operation.

    • Optionaloptions: {
          encoding?: BufferEncoding;
          flag?: string;
          signal?: AbortSignal;
      }

      Additional options for writing the file.

      • Optionalencoding?: BufferEncoding
      • Optionalflag?: string
      • Optionalsignal?: AbortSignal

    Returns Promise<void>

    A promise that resolves when the file has been written.

  • Writes the file to the specified path.

    Parameters

    • path: string

      The path where the file should be written.

    • writeType: "stream"

      The type of write operation.

    • Optionaloptions: {
          autoClose?: boolean;
          emitClose?: boolean;
          encoding?: BufferEncoding;
          flush?: boolean;
          highWaterMark?: number;
          start?: number;
      }

      Additional options for writing the file.

      • OptionalautoClose?: boolean
      • OptionalemitClose?: boolean
      • Optionalencoding?: BufferEncoding
      • Optionalflush?: boolean
      • OptionalhighWaterMark?: number
      • Optionalstart?: number

    Returns Promise<void>

    A promise that resolves when the file has been written.

  • Writes the file to the specified path.

    Parameters

    • path: string

      The path where the file should be written.

    • OptionalwriteType: "stream" | "promise"

      The type of write operation.

    • Optionaloptions: undefined

      Additional options for writing the file.

    Returns Promise<void>

    A promise that resolves when the file has been written.