StaticGramBot API

editStoryЧастично

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

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

replaces media/caption/areas; same area limits as postStory

Параметры

business_connection_idStringобязательный
Unique identifier of the business connection
story_idIntegerобязательный
Unique identifier of the story to edit
contentInputStoryContentобязательный
Content of the story
captionStringнеобязательный
Caption of the story, 0-2048 characters after entities parsing
parse_modeStringнеобязательный
Mode for parsing entities in the story caption. See formatting options for more details.
caption_entitiesArray of MessageEntityнеобязательный
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
areasArray of StoryAreaнеобязательный
A JSON-serialized list of clickable areas to be shown on the story

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

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

Ответ (Story)

JSON
{
  "ok": true,
  "result": {
    "chat": {
      "id": 1780243423,
      "type": "private"
    },
    "id": 1780243423
  }
}

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