Telegram Bot icon

Telegram Bot

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

Actions101

Chat → Set Chat Menu Button

AI-generated

Summary

Sets the main menu button for a Telegram chat, overriding the default or previous custom button configuration.

Inputs

  • chat_id (required) — Unique identifier for the target chat or username (@channelusername).
  • menu_button — JSON object for the menu button (MenuButton). An empty object {} removes the custom button and resets it to the default Telegram button.

Output shape

a single record

Returns the updated MenuButton object if successful. The operation sends the request to the Telegram Bot API and returns the result.

Examples

Example 1: Set a custom menu button with a web app for a specific chat.

Chat ID: 123456789, Menu Button: { type: 'web_app', text: 'Open App', web_app: { url: 'https://example.com/app' } }

Example 2: Reset the chat menu to Telegram's default button.

Chat ID: 123456789, Menu Button: {}

Links

Discussion