StaticGramBot API

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

Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned.

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

exact bucket, empty list when unset (like api.telegram.org)

Параметры

scopeBotCommandScopeнеобязательный
A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault.
language_codeStringнеобязательный
A two-letter ISO 639-1 language code or an empty string

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

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

Ответ (Array of BotCommand)

JSON
{
  "ok": true,
  "result": [
    {
      "command": "...",
      "description": "..."
    }
  ]
}

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