pub struct SendGift { /* private fields */ }
Expand description
Sends a gift to the given user.
The gift can’t be converted to Telegram Stars by the user.
Implementations§
Source§impl SendGift
impl SendGift
Sourcepub fn for_chat_id<A, B>(chat_id: A, gift_id: B) -> SendGift
pub fn for_chat_id<A, B>(chat_id: A, gift_id: B) -> SendGift
Creates a new SendGift
with a user_id
.
§Arguments
chat_id
- Unique identifier of the target chat that will receive the gift.gift_id
- Identifier of the gift
Sourcepub fn for_user_id<T>(user_id: i64, gift_id: T) -> SendGift
pub fn for_user_id<T>(user_id: i64, gift_id: T) -> SendGift
Creates a new SendGift
with a user_id
.
§Arguments
user_id
- Unique identifier of the target user that will receive the gift.gift_id
- Identifier of the gift
Sourcepub fn with_pay_for_upgrade(self, value: bool) -> SendGift
pub fn with_pay_for_upgrade(self, value: bool) -> SendGift
Sets a new value for the pay_for_upgrade
flag.
§Arguments
value
- Whether to pay for the gift upgrade from the bot’s balance, thereby making the upgrade free for the receiver.
Sourcepub fn with_text_parse_mode(self, value: ParseMode) -> SendGift
pub fn with_text_parse_mode(self, value: ParseMode) -> SendGift
Sourcepub fn with_text_entities<T>(self, value: T) -> SendGiftwhere
T: IntoIterator<Item = TextEntity>,
pub fn with_text_entities<T>(self, value: T) -> SendGiftwhere
T: IntoIterator<Item = TextEntity>,
Trait Implementations§
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,
Serialize this value into the given Serde serializer. Read more
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
Mutably borrows from an owned value. Read more