feat(client): export customEmojiId in Sticker
This commit is contained in:
parent
eaa517a5c3
commit
b08ec342e5
1 changed files with 13 additions and 0 deletions
|
@ -5,6 +5,7 @@ import { TelegramClient } from '../../client'
|
||||||
import { RawDocument } from './document'
|
import { RawDocument } from './document'
|
||||||
import { makeInspectable } from '../utils'
|
import { makeInspectable } from '../utils'
|
||||||
import { StickerSet } from '../misc'
|
import { StickerSet } from '../misc'
|
||||||
|
import { MtArgumentError } from '../errors'
|
||||||
|
|
||||||
export namespace Sticker {
|
export namespace Sticker {
|
||||||
export interface MaskPosition {
|
export interface MaskPosition {
|
||||||
|
@ -141,6 +142,18 @@ export class Sticker extends RawDocument {
|
||||||
: false
|
: 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
|
* Type of the sticker
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue