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§
impl Eq for SendGift
Source§impl Payload for SendGift
impl Payload for SendGift
Source§const NAME: &'static str = "SendGift"
const NAME: &'static str = "SendGift"
EditMessageTextInline).Source§const TELEGRAM_METHOD: &'static str = Self::NAME
const TELEGRAM_METHOD: &'static str = Self::NAME
EditMessageText). Defaults to the payload name.Source§fn timeout_hint(&self) -> Option<Duration>
fn timeout_hint(&self) -> Option<Duration>
GetUpdates with
big timeout), the minimum timeout that should be used.Source§impl Serialize for SendGift
impl Serialize for SendGift
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for SendGift
Auto Trait Implementations§
impl Forget for SendGift
impl Freeze for SendGift
impl Move for SendGift
impl RefUnwindSafe for SendGift
impl Send for SendGiftwhere
RawVecInner: Send,
impl Sync for SendGiftwhere
RawVecInner: Sync,
impl Unpin for SendGift
impl UnsafeUnpin for SendGiftwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<MessageEntity>: UnsafeUnpin,
impl UnwindSafe for SendGiftwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreimpl<T> MaybeSend for T
impl<T> MaybeSync for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> 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) -> Self
fn text_entities<T>(self, value: T) -> Self
text_entities field.