approveSuggestedPostПоддерживается
Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success.
Особенности StaticGram
channel direct messages (monoforum) chats; needs can_manage_direct_messages + can_post_messages for a subscriber's suggestion (the topic owner approves a channel's counter-offer); send_date ≤ 30 days; publishes at once or at send_date (lifecycle dispatcher), Stars/TON debited from the suggester, paid out after 24 h; repeated approve/decline → "suggested post was already approved or declined"
Параметры
Unique identifier for the target direct messages chat
Identifier of a suggested post message to approve
Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future.
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/approveSuggestedPost" \
-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.approve_suggested_post(chat_id=123456789, message_id=42)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/approveSuggestedPost`, {
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
}