repostStoryПоддерживается
Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.
Особенности StaticGram
source must be a business account connected to the same bot; "originally posted by the bot" is not tracked
Параметры
Unique identifier of the business connection
Unique identifier of the chat which posted the story that should be reposted
Unique identifier of the story that should be reposted
Period after which the story is moved to the archive, in seconds; must be one of
6 * 3600, 12 * 3600, 86400, or 2 * 86400Pass True to keep the story accessible after it expires
Pass True if the content of the story must be protected from forwarding and screenshotting
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/repostStory" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "<business_connection_id>",
"from_chat_id": 123456789,
"from_story_id": 1,
"active_period": 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.repost_story(
business_connection_id="<business_connection_id>",
from_chat_id=123456789,
from_story_id=1,
active_period=1,
)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/repostStory`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "<business_connection_id>",
"from_chat_id": 123456789,
"from_story_id": 1,
"active_period": 1
}),
});
const data = await res.json();Ответ (Story)
JSON
{
"ok": true,
"result": {
"chat": {
"id": 1780243423,
"type": "private"
},
"id": 1780243423
}
}