teloxide_core/payloads/send_gift.rs
1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{GiftId, MessageEntity, ParseMode, True, UserId};
6
7impl_payload! {
8 /// Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success.
9 ///
10 /// See also: [`SendGiftChat`](crate::payloads::SendGiftChat)
11 #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
12 pub SendGift (SendGiftSetters) => True {
13 required {
14 /// Unique identifier of the target user that will receive the gift
15 pub user_id: UserId,
16 /// Identifier of the gift
17 pub gift_id: GiftId,
18 }
19 optional {
20 /// Pass _true_ to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
21 pub pay_for_upgrade: bool,
22 /// Text that will be shown along with the gift; 0-255 characters
23 pub text: String [into],
24 /// 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
25 ///
26 /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
27 pub text_parse_mode: ParseMode,
28 /// 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.
29 pub text_entities: Vec<MessageEntity> [collect],
30 }
31 }
32}