all repos — telegram-bot-api @ def9b6b5dc127f34b065db302ba536e22fa4f134

Golang bindings for the Telegram Bot API

Merge pull request #20 from iamwavecut/master

Add missing `getCustomEmojiStickers` method from API v6.2
OvyFlash 46941696+OvyFlash@users.noreply.github.com
Sat, 16 Mar 2024 10:35:15 +0200
commit

def9b6b5dc127f34b065db302ba536e22fa4f134

parent

eced2e4efa397f26d23d2512bc3c063279bbd03a

1 files changed, 14 insertions(+), 1 deletions(-)

jump to
M bot.gobot.go

@@ -640,7 +640,20 @@ if err != nil {

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