2023-09-24 03:37:34 +03:00
|
|
|
import { tl } from '@mtcute/core'
|
2021-08-05 20:38:24 +03:00
|
|
|
import { fileIdToInputDocument, tdFileId } from '@mtcute/file-id'
|
2021-05-05 23:26:28 +03:00
|
|
|
|
2022-06-30 16:32:56 +03:00
|
|
|
import { TelegramClient } from '../../client'
|
|
|
|
import { StickerSet } from '../../types'
|
|
|
|
|
2021-05-05 23:26:28 +03:00
|
|
|
/**
|
|
|
|
* Delete a sticker from a sticker set
|
|
|
|
*
|
|
|
|
* Only for bots, and the sticker set must
|
|
|
|
* have been created by this bot.
|
|
|
|
*
|
|
|
|
* @param sticker
|
|
|
|
* TDLib and Bot API compatible File ID, or a
|
|
|
|
* TL object representing a sticker to be removed
|
|
|
|
* @returns Modfiied sticker set
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
export async function deleteStickerFromSet(
|
|
|
|
this: TelegramClient,
|
2023-06-05 03:30:48 +03:00
|
|
|
sticker: string | tdFileId.RawFullRemoteFileLocation | tl.TypeInputDocument,
|
2021-05-05 23:26:28 +03:00
|
|
|
): Promise<StickerSet> {
|
|
|
|
if (tdFileId.isFileIdLike(sticker)) {
|
|
|
|
sticker = fileIdToInputDocument(sticker)
|
|
|
|
}
|
|
|
|
|
|
|
|
const res = await this.call({
|
|
|
|
_: 'stickers.removeStickerFromSet',
|
2021-06-06 15:20:41 +03:00
|
|
|
sticker,
|
2021-05-05 23:26:28 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
return new StickerSet(this, res)
|
|
|
|
}
|