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, InputPaidMedia, Message, MessageEntity, ParseMode, Recipient,
    ReplyMarkup, ReplyParameters,
};

impl_payload! {
    /// Use this method to send paid media. On success, the sent [`Message`] is returned.
    ///
    /// [`Message`]: crate::types::Message
    #[derive(Debug, Clone, Serialize)]
    pub SendPaidMedia (SendPaidMediaSetters) => Message {
        required {
            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
            pub chat_id: Recipient [into],
            /// The number of Telegram Stars that must be paid to buy access to the media
            pub star_count: u32,
            /// A JSON-serialized array describing the media to be sent; up to 10 items
            pub media: Vec<InputPaidMedia> [collect],
        }
        optional {
            /// Unique identifier of the business connection on behalf of which the message will be sent
            pub business_connection_id: BusinessConnectionId,
            /// Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes.
            pub payload: String [into],
            /// Media caption, 0-1024 characters after entities parsing
            pub caption: String [into],
            /// Mode for parsing entities in the media caption. See [formatting options] for more details.
            ///
            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
            pub parse_mode: ParseMode,
            /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
            pub caption_entities: Vec<MessageEntity> [collect],
            /// Pass `true`, if the caption must be shown above the message media
            pub show_caption_above_media: bool,
            /// Sends the message [silently]. Users will receive a notification with no sound.
            ///
            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
            pub disable_notification: bool,
            /// Protects the contents of sent messages from forwarding and saving
            pub protect_content: bool,
            /// Pass `true` to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
            pub allow_paid_broadcast: bool,
            /// Description of the message to reply to
            pub reply_parameters: ReplyParameters,
            /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
            ///
            /// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
            /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
            pub reply_markup: ReplyMarkup [into],
        }
    }
}