telegramsjs
    Preparing search index...

    Class Sticker

    Hierarchy (View Summary)

    Index

    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: string | null

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

    setName?: string

    Name of the sticker set to which the sticker belongs

    size: number | null

    The size of the file in bytes, if available

    thumbnail?: Photo

    Sticker thumbnail in the .WEBP or .JPG format

    type: "custom_emoji" | "regular" | "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(): string | null

      Gets the URL to access the file on the Telegram server.

      Returns string | null

    Methods

    • Protected

      Creates a clone of the current instance

      Returns Base

      A clone of the current instance

    • 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.

      Returns Promise<Buffer<ArrayBufferLike>>

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

    • Flatten an object. Any properties that are collections will get converted to an array of keys.

      Parameters

      • OptionalpropsRecursive: boolean

        Optional. If true, calls toJSON method on nested objects.

      • ...props: Record<string, string | boolean>[]

        Optional. Specific properties to include/exclude, or rename.

      Returns Record<string, any>

      Flattened object.

    • Returns the id instance Chat, User, ChatMember and other

      Returns string | null

    • 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.

      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.

      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.