readBusinessMessageПоддерживается
Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.
Особенности StaticGram
can_read_messages; messages.readHistory as the business account
Параметры
Unique identifier of the business connection on behalf of which to read the message
Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.
Unique identifier of the message to mark as read
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/readBusinessMessage" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "<business_connection_id>",
"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.read_business_message(
business_connection_id="<business_connection_id>",
chat_id=123456789,
message_id=42,
)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/readBusinessMessage`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "<business_connection_id>",
"chat_id": 123456789,
"message_id": 42
}),
});
const data = await res.json();Ответ (True)
JSON
{
"ok": true,
"result": true
}