StaticGramBot API

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

Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.

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

returns Poll; optional new inline keyboard; business_connection_id: only polls this bot sent for the account

Параметры

business_connection_idStringнеобязательный
Unique identifier of the business connection on behalf of which the message to be edited was sent
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 original message with the poll
reply_markupInlineKeyboardMarkupнеобязательный
A JSON-serialized object for a new message inline keyboard

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

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

Ответ (Poll)

JSON
{
  "ok": true,
  "result": {
    "id": "...",
    "question": "...",
    "options": [],
    "total_voter_count": 1,
    "is_closed": true,
    "is_anonymous": true,
    "type": "private",
    "allows_multiple_answers": true,
    "allows_revoting": true,
    "members_only": true
  }
}

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