Telegram Bot icon

Telegram Bot

Interact with the Telegram Bot API – send messages, manage chats, handle payments, and more

Actions101

Bot → Set My Commands

AI-generated

Summary

Set bot commands

Inputs

  • bot_commands (required) — JSON array of BotCommand objects, each with "command" and "description" fields.
  • scope — Optional JSON object defining the command scope (e.g., language_code or default scope).
  • language_code — Two‑letter ISO 639‑1 language code for the commands.

Output shape

array of record objects, each containing a json field with the Telegram API response (e.g., {ok:true, result: [...]} )

On success the json reflects the API result; on error it may contain an error object if continueOnFail is disabled.

Examples

Example 1: Define basic commands in the default language

{"bot_commands":[{"command":"start","description":"Start"},{"command":"help","description":"Help"}]}

Example 2: Define commands for a specific language

{"bot_commands":[{"command":"start","description":"開始"},{"command":"help","description":"ヘルプ"}],"scope":{"language_code":"ja"}

Links

Discussion