2017-09-04 19:10:21 +00:00
|
|
|
package telegram
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
json "github.com/pquerna/ffjson/ffjson"
|
|
|
|
http "github.com/valyala/fasthttp"
|
|
|
|
)
|
|
|
|
|
2017-10-06 07:55:54 +00:00
|
|
|
// SetStickerPositionInSet move a sticker in a set created by the bot to a
|
|
|
|
// specific position. Returns True on success.
|
2017-09-04 19:10:21 +00:00
|
|
|
func (bot *Bot) SetStickerPositionInSet(sticker string, position int) (bool, error) {
|
|
|
|
var args http.Args
|
2017-10-06 07:55:54 +00:00
|
|
|
args.Add("sticker", sticker)
|
|
|
|
args.Add("position", strconv.Itoa(position))
|
2017-09-04 19:10:21 +00:00
|
|
|
|
2017-09-05 09:20:10 +00:00
|
|
|
resp, err := bot.request(nil, "setStickerPositionInSet", &args)
|
2017-09-04 19:10:21 +00:00
|
|
|
if err != nil {
|
2017-09-04 20:54:28 +00:00
|
|
|
return false, err
|
2017-09-04 19:10:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var data bool
|
|
|
|
err = json.Unmarshal(*resp.Result, &data)
|
|
|
|
return data, err
|
|
|
|
}
|