teloxide_core/payloads/
gift_premium_subscription.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{MessageEntity, ParseMode, True, UserId};
6
7impl_payload! {
8    /// Gifts a Telegram Premium subscription to the given user. Returns True on success.
9    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
10    pub GiftPremiumSubscription (GiftPremiumSubscriptionSetters) => True {
11        required {
12            /// Unique identifier of the target user
13            pub user_id: UserId,
14            /// Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
15            pub month_count: u8,
16            /// Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
17            pub star_count: u32,
18        }
19        optional {
20            /// Text that will be shown along with the service message about the subscription; 0-128 characters
21            pub text: String [into],
22            /// Mode for parsing entities in the text. See [formatting options] for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
23            ///
24            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
25            pub text_parse_mode: ParseMode,
26            /// List of special entities that appear in the gift text. It can be specified instead of `text_parse_mode`. See [formatting options] for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
27            ///
28            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
29            pub text_entities: Vec<MessageEntity> [collect],
30        }
31    }
32}