Add missing `getCustomEmojiStickers` method from API v6.2

pull/20/head
Valeriy Selitskiy 2024-03-15 21:28:47 +01:00
parent eced2e4efa
commit 5f429897bc
1 changed files with 14 additions and 1 deletions

15
bot.go
View File

@ -640,7 +640,20 @@ func (bot *BotAPI) GetStickerSet(config GetStickerSetConfig) (StickerSet, error)
return StickerSet{}, err
}
var stickers StickerSet
var stickerSet StickerSet
err = json.Unmarshal(resp.Result, &stickerSet)
return stickerSet, err
}
// GetCustomEmojiStickers returns a slice of Sticker objects.
func (bot *BotAPI) GetCustomEmojiStickers(config GetCustomEmojiStickersConfig) ([]Sticker, error) {
resp, err := bot.Request(config)
if err != nil {
return []Sticker{}, err
}
var stickers []Sticker
err = json.Unmarshal(resp.Result, &stickers)
return stickers, err