Skip to main content

ronami_core/payloads/
send_paid_media.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::BusinessConnectionId;
6use crate::types::InputPaidMedia;
7use crate::types::Message;
8use crate::types::MessageEntity;
9use crate::types::ParseMode;
10use crate::types::Recipient;
11use crate::types::ReplyMarkup;
12use crate::types::ReplyParameters;
13use crate::types::SuggestedPostParameters;
14use crate::types::ThreadId;
15use crate::types::TopicId;
16
17impl_payload! {
18    /// Use this method to send paid media. On success, the sent [`Message`] is returned.
19    ///
20    /// [`Message`]: crate::types::Message
21    #[derive(Debug, Clone, Serialize)]
22    pub SendPaidMedia (SendPaidMediaSetters) => Message {
23        required {
24            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
25            pub chat_id: Recipient [into],
26            /// The number of Telegram Stars that must be paid to buy access to the media
27            pub star_count: u32,
28            /// A JSON-serialized array describing the media to be sent; up to 10 items
29            pub media: Vec<InputPaidMedia> [collect],
30        }
31        optional {
32            /// Unique identifier of the business connection on behalf of which the message will be sent
33            pub business_connection_id: BusinessConnectionId,
34            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
35            pub message_thread_id: ThreadId,
36            /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
37            pub direct_messages_topic_id: TopicId,
38            /// Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes.
39            pub payload: String [into],
40            /// Media caption, 0-1024 characters after entities parsing
41            pub caption: String [into],
42            /// Mode for parsing entities in the media caption. See [formatting options] for more details.
43            ///
44            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
45            pub parse_mode: ParseMode,
46            /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
47            pub caption_entities: Vec<MessageEntity> [collect],
48            /// Pass `true`, if the caption must be shown above the message media
49            pub show_caption_above_media: bool,
50            /// Sends the message [silently]. Users will receive a notification with no sound.
51            ///
52            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
53            pub disable_notification: bool,
54            /// Protects the contents of sent messages from forwarding and saving
55            pub protect_content: bool,
56            /// 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
57            pub allow_paid_broadcast: bool,
58            /// An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
59            pub suggested_post_parameters: SuggestedPostParameters,
60            /// Description of the message to reply to
61            pub reply_parameters: ReplyParameters,
62            /// 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
63            ///
64            /// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
65            /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
66            pub reply_markup: ReplyMarkup [into],
67        }
68    }
69}