StaticGramBot API

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

Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.

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

stories.deleteStories as the business account, needs can_manage_stories

Параметры

business_connection_idStringобязательный
Unique identifier of the business connection
story_idIntegerобязательный
Unique identifier of the story to delete

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

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

Ответ (True)

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

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