Merge pull request #304 from blasphemy/getstickerset2
add getStickerSet call
This commit is contained in:
commit
cf3ea3f80d
3 changed files with 42 additions and 0 deletions
19
bot.go
19
bot.go
|
@ -982,3 +982,22 @@ func (bot *BotAPI) DeleteChatPhoto(config DeleteChatPhotoConfig) (APIResponse, e
|
|||
|
||||
return bot.MakeRequest(config.method(), v)
|
||||
}
|
||||
|
||||
// GetStickerSet get a sticker set.
|
||||
func (bot *BotAPI) GetStickerSet(config GetStickerSetConfig) (StickerSet, error) {
|
||||
v, err := config.values()
|
||||
if err != nil {
|
||||
return StickerSet{}, err
|
||||
}
|
||||
bot.debugLog(config.method(), v, nil)
|
||||
res, err := bot.MakeRequest(config.method(), v)
|
||||
if err != nil {
|
||||
return StickerSet{}, err
|
||||
}
|
||||
stickerSet := StickerSet{}
|
||||
err = json.Unmarshal(res.Result, &stickerSet)
|
||||
if err != nil {
|
||||
return StickerSet{}, err
|
||||
}
|
||||
return stickerSet, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue