Bot API · Bot token
setMyCommands
Set the bot's command list
Sets the bot's command list. Commands appear in the client's '/' autocomplete in bot threads. Replaces the entire list; pass an empty array to clear.
Request
curl https://api.sprintelex.com/setMyCommands \
-H "Authorization: Bearer <bot-token>" \
-H "Content-Type: application/json" \
-d '{"commands":"<commands>"}'Parameters
| Name | Type | Required | Rules |
|---|---|---|---|
| commands | array of {command, description} | Yes | at most 100 commands; command 1-32 chars [a-z0-9_], description 1-256 chars |
Response
{ ok: true, result: true }Rate limit: none in code
Errors
| Status | Error | When |
|---|---|---|
| 400 | commands must be an array | commands not an array |
| 400 | at most 100 commands | more than 100 commands |
| 400 | each command must be an object | a command is not an object |
| 400 | command must be 1-32 chars: lowercase letters, numbers, underscores | bad command name |
| 400 | description must be 1-256 characters | bad description |
| 500 | could not save commands | DB update failed |