StaticGramBot API

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

Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.

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

all 20 InlineQueryResult types, InputText/Location/Venue/Contact content (Invoice → 400 INVOICE_CONTENT_UNSUPPORTED), button (web_app / start_parameter) + legacy switch_pm_*; https URLs only; live_period ignored; inline_query and chosen_inline_result updates are enqueued (chosen_inline_result always, no /setinlinefeedback)

Параметры

inline_query_idStringобязательный
Unique identifier for the answered query
resultsArray of InlineQueryResultобязательный
A JSON-serialized Array of results for the inline query
cache_timeIntegerнеобязательный
The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
is_personalBooleanнеобязательный
Pass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query.
next_offsetStringнеобязательный
Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.
buttonInlineQueryResultsButtonнеобязательный
A JSON-serialized object describing a button to be shown above inline query results

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

curl
curl "https://api.staticgram.top/bot$TOKEN/answerInlineQuery" \
  -H "Content-Type: application/json" \
  -d '{
    "inline_query_id": "<inline_query_id>",
    "results": []
  }'
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.answer_inline_query(inline_query_id="<inline_query_id>", results=[])
JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/answerInlineQuery`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "inline_query_id": "<inline_query_id>",
    "results": []
  }),
});
const data = await res.json();

Ответ (True)

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

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