postStory()
Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
parameters
| parameter | type | required | description |
|---|---|---|---|
business_connection_id | string | required | Unique identifier of the business connection |
content | InputStoryContent | required | Content of the story |
active_period | number | required | Period after which the story is moved to the archive, in seconds; must be one of 6 3600, 12 3600, 86400, or 2 * 86400 |
caption | string | optional | Caption of the story, 0-2048 characters after entities parsing |
parse_mode | string | optional | Mode for parsing entities in the story caption. See formatting options for more details. |
caption_entities | MessageEntity[] | optional | A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode |
areas | StoryArea[] | optional | A JSON-serialized list of clickable areas to be shown on the story |
post_to_chat_page | boolean | optional | Pass True to keep the story accessible after it expires |
protect_content | boolean | optional | Pass True if the content of the story must be protected from forwarding and screenshotting |
returns
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { PostStoryParams, Story } from "@yaebal/types";
await bot.api.call<Story>("postStory", {
business_connection_id: "...",
content: {} /* InputStoryContent */,
active_period: 1,
} satisfies PostStoryParams);official Bot API docs: https://core.telegram.org/bots/api/#poststory