feat(client): export customEmojiId in Sticker

This commit is contained in:
teidesu 2022-08-18 21:34:35 +03:00
parent eaa517a5c3
commit b08ec342e5

View file

@ -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
*/