pub struct SendGift {
pub user_id: UserId,
pub gift_id: GiftId,
pub pay_for_upgrade: Option<bool>,
pub text: Option<String>,
pub text_parse_mode: Option<ParseMode>,
pub text_entities: Option<Vec<MessageEntity>>,
}Expand description
Sends a gift to the given user. The gift can’t be converted to Telegram Stars by the user. Returns True on success.
See also: SendGiftChat
Fields§
§user_id: UserIdUnique identifier of the target user that will receive the gift
gift_id: GiftIdIdentifier of the gift
pay_for_upgrade: Option<bool>Pass true to pay for the gift upgrade from the bot’s balance, thereby making the upgrade free for the receiver
text: Option<String>Text that will be shown along with the gift; 0-255 characters
text_parse_mode: Option<ParseMode>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
text_entities: Option<Vec<MessageEntity>>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.
Implementations§
Trait Implementations§
Source§impl Payload for SendGift
impl Payload for SendGift
Source§fn timeout_hint(&self) -> Option<Duration>
fn timeout_hint(&self) -> Option<Duration>
GetUpdates with
big timeout), the minimum timeout that should be used.impl Eq for SendGift
impl StructuralPartialEq for SendGift
Auto Trait Implementations§
impl Freeze for SendGift
impl RefUnwindSafe for SendGift
impl Send for SendGift
impl Sync for SendGift
impl Unpin for SendGift
impl UnwindSafe for SendGift
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<P> HasPayload for Pwhere
P: Payload,
impl<P> HasPayload for Pwhere
P: Payload,
Source§fn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
fn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
Source§fn payload_ref(&self) -> &<P as HasPayload>::Payload
fn payload_ref(&self) -> &<P as HasPayload>::Payload
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<P> SendGiftSetters for Pwhere
P: HasPayload<Payload = SendGift>,
impl<P> SendGiftSetters for Pwhere
P: HasPayload<Payload = SendGift>,
Source§fn pay_for_upgrade(self, value: bool) -> Self
fn pay_for_upgrade(self, value: bool) -> Self
pay_for_upgrade field.Source§fn text_parse_mode(self, value: ParseMode) -> Self
fn text_parse_mode(self, value: ParseMode) -> Self
text_parse_mode field.Source§fn text_entities<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = MessageEntity>,
fn text_entities<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = MessageEntity>,
text_entities field.