pub struct SendGift { /* private fields */ }Expand description
Builder for the sendGift method.
Sends a gift to a user or channel chat. Either user_id or chat_id must be
set — use the corresponding builder method.
Implementations§
Source§impl SendGift
impl SendGift
Sourcepub fn user_id(self, id: i64) -> Self
pub fn user_id(self, id: i64) -> Self
Sends the gift to a user. Required if chat_id is not set.
Sourcepub fn chat_id(self, id: impl Into<ChatId>) -> Self
pub fn chat_id(self, id: impl Into<ChatId>) -> Self
Sends the gift to a channel chat. Required if user_id is not set.
Limited gifts cannot be sent to channel chats.
Sourcepub fn pay_for_upgrade(self, v: bool) -> Self
pub fn pay_for_upgrade(self, v: bool) -> Self
Pass true to pay for the upgrade from the bot’s balance, making the upgrade free for the receiver.
Sourcepub fn text(self, t: impl Into<String>) -> Self
pub fn text(self, t: impl Into<String>) -> Self
Optional text message to accompany the gift (0–128 characters).
Sourcepub fn text_parse_mode(self, m: ParseMode) -> Self
pub fn text_parse_mode(self, m: ParseMode) -> Self
Parse mode for entities in the gift text.
Sourcepub fn text_entities(self, e: Vec<MessageEntity>) -> Self
pub fn text_entities(self, e: Vec<MessageEntity>) -> Self
Special entities in the gift text; alternative to text_parse_mode.
Trait Implementations§
Source§impl IntoFuture for SendGift
impl IntoFuture for SendGift
Source§type IntoFuture = Pin<Box<dyn Future<Output = <SendGift as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <SendGift as IntoFuture>::Output> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SendGift
impl !UnwindSafe for SendGift
impl Freeze for SendGift
impl Send for SendGift
impl Sync for SendGift
impl Unpin for SendGift
impl UnsafeUnpin 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