diff --git a/packages/client/src/types/media/sticker.ts b/packages/client/src/types/media/sticker.ts index d008d260..e59957c9 100644 --- a/packages/client/src/types/media/sticker.ts +++ b/packages/client/src/types/media/sticker.ts @@ -5,6 +5,7 @@ import { TelegramClient } from '../../client' import { RawDocument } from './document' import { makeInspectable } from '../utils' import { StickerSet } from '../misc' +import { MtArgumentError } from '../errors' export namespace Sticker { export interface MaskPosition { @@ -141,6 +142,18 @@ export class Sticker extends RawDocument { : false } + /** + * If this is a custom emoji, its unique ID + * that can be used in {@link TelegramClient#getCustomEmojis} + */ + get customEmojiId(): tl.Long { + if (this.attr._ !== 'documentAttributeCustomEmoji') { + throw new MtArgumentError('This is not a custom emoji') + } + + return this.raw.id + } + /** * Type of the sticker */