setChatMenuButton
Sets the bot's menu button.
Returns: On success, returns True.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Optional | Chat ID |
menu_button | MenuButton | Optional | JSON MenuButton object |
Example request
curl
curl -s "https://api.telegram.org/bot$TOKEN/setChatMenuButton"
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/setChatMenuButton", timeout=30)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/setChatMenuButton`);
console.log(await res.json());
Step-by-step guide: How to Test a Telegram Mini App: From Browser Mock to Real Telegram
Related methods
getMeReturns bot information.getMyCommandsReturns the current list of bot commands.setMyCommandsSets the list of bot commands.deleteMyCommandsDeletes bot commands.getMyNameReturns the bot's name.setMyNameSets the bot's name.getMyDescriptionReturns the bot's description.setMyDescriptionSets the bot's description.getMyShortDescriptionReturns the bot's short description.setMyShortDescriptionSets the bot's short description.setMyProfilePhotoSets the bot's profile photo.removeMyProfilePhotoRemoves the bot's profile photo.