StaticGramBot API

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

Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.

Параметры

user_idIntegerобязательный
Unique identifier of the target user that can use the prepared message
resultInlineQueryResultобязательный
A JSON-serialized object describing the message to be sent
allow_user_chatsBooleanнеобязательный
Pass True if the message can be sent to private chats with users
allow_bot_chatsBooleanнеобязательный
Pass True if the message can be sent to private chats with bots
allow_group_chatsBooleanнеобязательный
Pass True if the message can be sent to group and supergroup chats
allow_channel_chatsBooleanнеобязательный
Pass True if the message can be sent to channel chats

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

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

Ответ (PreparedInlineMessage)

JSON
{
  "ok": true,
  "result": {
    "id": "...",
    "expiration_date": 1
  }
}

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