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