StaticGramBot API

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

Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.

Параметры

web_app_query_idStringобязательный
Unique identifier for the query to be answered
resultInlineQueryResultобязательный
A JSON-serialized object describing the message to be sent

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

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

Ответ (SentWebAppMessage)

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

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