1
0
telegram/set_sticker_position_in_set.go
Maxim Lebedev 3265acc0fc
♻️ Methods refactor
2018-08-21 16:05:04 +05:00

31 lines
775 B
Go

package telegram
import json "github.com/pquerna/ffjson/ffjson"
// SetStickerPositionInSetParameters represents data for SetStickerPositionInSet
// method.
type SetStickerPositionInSetParameters struct {
Sticker string `json:"sticker"`
Position int `json:"position"`
}
// SetStickerPositionInSet move a sticker in a set created by the bot to a
// specific position. Returns True on success.
func (bot *Bot) SetStickerPositionInSet(sticker string, position int) (ok bool, err error) {
dst, err := json.Marshal(&SetStickerPositionInSetParameters{
Sticker: sticker,
Position: position,
})
if err != nil {
return
}
resp, err := bot.request(dst, MethodSetStickerPositionInSet)
if err != nil {
return
}
err = json.Unmarshal(*resp.Result, &ok)
return
}