StaticGramBot API

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

Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.

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

per-chat override, else bot default

Параметры

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

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

curl
curl "https://api.staticgram.top/bot$TOKEN/getChatMenuButton"
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.get_chat_menu_button()
JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/getChatMenuButton`);
const data = await res.json();

Ответ (MenuButton)

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

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