Skip to content

GramIO API Reference / @gramio/contexts/dist / StickerAttachment

Class: StickerAttachment ​

Defined in: contexts/index.d.ts:767

This object represents a sticker.

Extends ​

Constructors ​

Constructor ​

new StickerAttachment(payload): StickerAttachment

Defined in: contexts/index.d.ts:425

Parameters ​

ParameterType
payloadTelegramSticker

Returns ​

StickerAttachment

Inherited from ​

FileAttachment.constructor

Properties ​

PropertyModifierTypeDescriptionOverridesInherited fromDefined in
attachmentTypepublicAttachmentTypeReturns attachment's type (e.g. 'audio', 'photo')FileAttachment.attachmentType-contexts/index.d.ts:768
payloadprotectedTelegramSticker--FileAttachment.payloadcontexts/index.d.ts:422

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

Defined in: contexts/index.d.ts:412

MDN

Returns ​

string

Inherited from ​

FileAttachment.[toStringTag]


customEmojiId ​

Get Signature ​

get customEmojiId(): string

Defined in: contexts/index.d.ts:796

For custom emoji stickers, unique identifier of the custom emoji

Returns ​

string


emoji ​

Get Signature ​

get emoji(): string

Defined in: contexts/index.d.ts:786

Emoji associated with the sticker

Returns ​

string


fileId ​

Get Signature ​

get fileId(): string

Defined in: contexts/index.d.ts:427

Identifier for this file, which can be used to download or reuse the file

Returns ​

string

Inherited from ​

FileAttachment.fileId


fileSize ​

Get Signature ​

get fileSize(): number

Defined in: contexts/index.d.ts:800

File size

Returns ​

number


fileUniqueId ​

Get Signature ​

get fileUniqueId(): string

Defined in: contexts/index.d.ts:432

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.

Returns ​

string

Inherited from ​

FileAttachment.fileUniqueId


height ​

Get Signature ​

get height(): number

Defined in: contexts/index.d.ts:778

Sticker height

Returns ​

number


maskPosition ​

Get Signature ​

get maskPosition(): MaskPosition

Defined in: contexts/index.d.ts:794

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

Returns ​

MaskPosition


needs_repainting ​

Get Signature ​

get needs_repainting(): true

Defined in: contexts/index.d.ts:798

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

Returns ​

true


premiumAnimation ​

Get Signature ​

get premiumAnimation(): File

Defined in: contexts/index.d.ts:792

Premium animation for the sticker, if the sticker is premium

Returns ​

File


setName ​

Get Signature ​

get setName(): string

Defined in: contexts/index.d.ts:788

Name of the sticker set to which the sticker belongs

Returns ​

string


thumbnail ​

Get Signature ​

get thumbnail(): PhotoSize

Defined in: contexts/index.d.ts:784

Sticker thumbnail in the .WEBP or .JPG format

Returns ​

PhotoSize


type ​

Get Signature ​

get type(): TelegramStickerType

Defined in: contexts/index.d.ts:774

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.

Returns ​

TelegramStickerType


width ​

Get Signature ​

get width(): number

Defined in: contexts/index.d.ts:776

Sticker width

Returns ​

number

Methods ​

isAnimated() ​

isAnimated(): boolean

Defined in: contexts/index.d.ts:780

true, if the sticker is animated

Returns ​

boolean


isPremium() ​

isPremium(): this is Require<StickerAttachment, "premiumAnimation">

Defined in: contexts/index.d.ts:790

Is this sticker a premium one?

Returns ​

this is Require<StickerAttachment, "premiumAnimation">


isVideo() ​

isVideo(): boolean

Defined in: contexts/index.d.ts:782

true, if the sticker is a video sticker

Returns ​

boolean