teloxide_core/payloads/
post_story.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6    BusinessConnectionId, InputStoryContent, MessageEntity, ParseMode, Seconds, Story, StoryArea,
7};
8
9impl_payload! {
10    /// Posts a story on behalf of a managed business account. Requires the _can_manage_stories_ business bot right. Returns [`Story`] on success.
11    ///
12    /// [`Story`]: crate::types::Story
13    #[derive(Debug, Clone, Serialize)]
14    pub PostStory (PostStorySetters) => Story {
15        required {
16            /// Unique identifier of the business connection
17            pub business_connection_id: BusinessConnectionId,
18            /// Content of the story
19            pub content: InputStoryContent,
20            /// Period after which the story is moved to the archive, in seconds; must be one of `6 * 3600`, `12 * 3600`, `86400`, or `2 * 86400`
21            pub active_period: Seconds,
22        }
23        optional {
24            /// Caption of the story, 0-2048 characters after entities parsing
25            pub caption: String [into],
26            /// Mode for parsing entities in the story caption. See [formatting options] for more details
27            ///
28            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
29            pub parse_mode: ParseMode,
30            /// List of special entities that appear in the caption, which can be specified instead of _parse_mode_
31            pub caption_entities: Vec<MessageEntity> [collect],
32            /// List of clickable areas to be shown on the story
33            pub areas: Vec<StoryArea> [collect],
34            /// Pass _true_ to keep the story accessible after it expires
35            pub post_to_chat_page: bool,
36            /// Pass _true_ if the content of the story must be protected from forwarding and screenshotting
37            pub protect_content: bool,
38        }
39    }
40}