setMyCommands implemented
bcmk 45658475+bcmk@users.noreply.github.com
Sun, 27 Sep 2020 00:55:26 +0400
M
bot.go
→
bot.go
@@ -1036,3 +1036,18 @@ return StickerSet{}, err
} return stickerSet, nil } + +// SetMyCommands changes the list of the bot's commands. +func (bot *BotAPI) SetMyCommands(commands []BotCommand) error { + v := url.Values{} + data, err := json.Marshal(commands) + if err != nil { + return err + } + v.Add("commands", string(data)) + _, err = bot.MakeRequest("setMyCommands", v) + if err != nil { + return err + } + return nil +}