StaticGramBot API

setChatMenuButtonПоддерживается

Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.

Особенности StaticGram

per-chat_id override stored, returned by getChatMenuButton, shown to that user in userFull.bot_info.menu_button and pushed as updateBotMenuButton; shared with bots.setBotMenuButton(user_id)

Параметры

chat_idIntegerнеобязательный
Unique identifier for the target private chat. If not specified, the bot's default menu button will be changed.

Пример запроса

curl
curl "https://api.staticgram.top/bot$TOKEN/setChatMenuButton"
aiogram 3
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer

session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)

result = await bot.set_chat_menu_button()
JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/setChatMenuButton`);
const data = await res.json();

Ответ (True)

JSON
{
  "ok": true,
  "result": true
}

Описания методов и типов взяты из официальной документации Telegram Bot API (Bot API 10.3). Адрес API: https://api.staticgram.top