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

NameTypeRequiredRules
commandsarray of {command, description}Yesat 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

StatusErrorWhen
400commands must be an arraycommands not an array
400at most 100 commandsmore than 100 commands
400each command must be an objecta command is not an object
400command must be 1-32 chars: lowercase letters, numbers, underscoresbad command name
400description must be 1-256 charactersbad description
500could not save commandsDB update failed