getMyCommands
Get the Bot's command list.
Request
POST /:token/getmycommands
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| scope | BotCommandScope | No | Scope of the commands, defaults to all chats |
| language_code | String | No | IETF language code for retrieving a language-specific command list |
Response
Returns an array of BotCommand objects.
json
{
"ok": true,
"result": [
{
"command": "start",
"description": "Start the bot"
},
{
"command": "help",
"description": "Get help information"
},
{
"command": "settings",
"description": "Change settings"
}
]
}BotCommand Fields
| Field | Type | Description |
|---|---|---|
| command | String | Command text |
| description | String | Command description |
Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters |
| 401 | Invalid or expired token |
| 500 | Internal server error |
