StaticGramBot API

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

Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.

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

emoji/custom emoji; paid → 400

Параметры

chat_idInteger or Stringобязательный
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
message_idIntegerобязательный
Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.
reactionArray of ReactionTypeнеобязательный
A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.
is_bigBooleanнеобязательный
Pass True to set the reaction with a big animation

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

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

Ответ (True)

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

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