Skip to main content

ronami_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;
6use crate::types::ParseMode;
7use crate::types::True;
8use crate::types::UserId;
9
10impl_payload! {
11    /// Gifts a Telegram Premium subscription to the given user. Returns True on success.
12    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
13    pub GiftPremiumSubscription (GiftPremiumSubscriptionSetters) => True {
14        required {
15            /// Unique identifier of the target user
16            pub user_id: UserId,
17            /// Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
18            pub month_count: u8,
19            /// 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
20            pub star_count: u32,
21        }
22        optional {
23            /// Text that will be shown along with the service message about the subscription; 0-128 characters
24            pub text: String [into],
25            /// 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.
26            ///
27            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
28            pub text_parse_mode: ParseMode,
29            /// 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.
30            ///
31            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
32            pub text_entities: Vec<MessageEntity> [collect],
33        }
34    }
35}