Merge pull request #20 from iamwavecut/master

Add missing `getCustomEmojiStickers` method from API v6.2
bot-api-7.1
OvyFlash 2024-03-16 10:35:15 +02:00 committed by GitHub
commit def9b6b5dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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