Skip to main content

teloxide_core/payloads/
send_gift_chat.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{GiftId, MessageEntity, ParseMode, Recipient, True};
6
7impl_payload! {
8    @[tg_method = "SendGift"]
9    /// Sends a gift to the given channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
10    ///
11    /// See also: [`SendGift`](crate::payloads::SendGift)
12    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
13    pub SendGiftChat (SendGiftChatSetters) => True {
14        required {
15            /// Unique identifier for the chat or username of the channel that will receive the gift
16            pub chat_id: Recipient [into],
17            /// Identifier of the gift
18            pub gift_id: GiftId,
19        }
20        optional {
21            /// Pass _true_ to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
22            pub pay_for_upgrade: bool,
23            /// Text that will be shown along with the gift; 0-255 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. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
30            pub text_entities: Vec<MessageEntity> [collect],
31        }
32    }
33}