Skip to content

Commit e7590a0

Browse files
committed
getMyCommands implemented
1 parent 4a2c8c4 commit e7590a0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

bot.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,20 @@ func (bot *BotAPI) GetStickerSet(config GetStickerSetConfig) (StickerSet, error)
10371037
return stickerSet, nil
10381038
}
10391039

1040+
// GetMyCommands gets the current list of the bot's commands.
1041+
func (bot *BotAPI) GetMyCommands() ([]BotCommand, error) {
1042+
res, err := bot.MakeRequest("getMyCommands", nil)
1043+
if err != nil {
1044+
return nil, err
1045+
}
1046+
var commands []BotCommand
1047+
err = json.Unmarshal(res.Result, &commands)
1048+
if err != nil {
1049+
return nil, err
1050+
}
1051+
return commands, nil
1052+
}
1053+
10401054
// SetMyCommands changes the list of the bot's commands.
10411055
func (bot *BotAPI) SetMyCommands(commands []BotCommand) error {
10421056
v := url.Values{}

0 commit comments

Comments
 (0)