getMyCommands implemented
parent
4a2c8c4547
commit
e7590a0638
14
bot.go
14
bot.go
|
@ -1037,6 +1037,20 @@ func (bot *BotAPI) GetStickerSet(config GetStickerSetConfig) (StickerSet, error)
|
||||||
return stickerSet, nil
|
return stickerSet, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetMyCommands gets the current list of the bot's commands.
|
||||||
|
func (bot *BotAPI) GetMyCommands() ([]BotCommand, error) {
|
||||||
|
res, err := bot.MakeRequest("getMyCommands", nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var commands []BotCommand
|
||||||
|
err = json.Unmarshal(res.Result, &commands)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return commands, nil
|
||||||
|
}
|
||||||
|
|
||||||
// SetMyCommands changes the list of the bot's commands.
|
// SetMyCommands changes the list of the bot's commands.
|
||||||
func (bot *BotAPI) SetMyCommands(commands []BotCommand) error {
|
func (bot *BotAPI) SetMyCommands(commands []BotCommand) error {
|
||||||
v := url.Values{}
|
v := url.Values{}
|
||||||
|
|
Loading…
Reference in New Issue