teloxide-core 0.13.0

Core part of the `teloxide` library - telegram bot API client
Documentation
//! Generated by `codegen_payloads`, do not edit by hand.

use serde::Serialize;

use crate::types::{
    BusinessConnectionId, InputStoryContent, MessageEntity, ParseMode, Seconds, Story, StoryArea,
};

impl_payload! {
    /// Posts a story on behalf of a managed business account. Requires the _can_manage_stories_ business bot right. Returns [`Story`] on success.
    ///
    /// [`Story`]: crate::types::Story
    #[derive(Debug, Clone, Serialize)]
    pub PostStory (PostStorySetters) => Story {
        required {
            /// Unique identifier of the business connection
            pub business_connection_id: BusinessConnectionId,
            /// Content of the story
            pub content: InputStoryContent,
            /// Period after which the story is moved to the archive, in seconds; must be one of `6 * 3600`, `12 * 3600`, `86400`, or `2 * 86400`
            pub active_period: Seconds,
        }
        optional {
            /// Caption of the story, 0-2048 characters after entities parsing
            pub caption: String [into],
            /// Mode for parsing entities in the story caption. See [formatting options] for more details
            ///
            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
            pub parse_mode: ParseMode,
            /// List of special entities that appear in the caption, which can be specified instead of _parse_mode_
            pub caption_entities: Vec<MessageEntity> [collect],
            /// List of clickable areas to be shown on the story
            pub areas: Vec<StoryArea> [collect],
            /// Pass _true_ to keep the story accessible after it expires
            pub post_to_chat_page: bool,
            /// Pass _true_ if the content of the story must be protected from forwarding and screenshotting
            pub protect_content: bool,
        }
    }
}