pub struct GiftPremiumSubscription {
pub user_id: UserId,
pub month_count: u8,
pub star_count: u32,
pub text: Option<String>,
pub text_parse_mode: Option<ParseMode>,
pub text_entities: Option<Vec<MessageEntity>>,
}Expand description
Gifts a Telegram Premium subscription to the given user. Returns True on success.
Fields§
§user_id: UserIdUnique identifier of the target user
month_count: u8Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
star_count: u32Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
text: Option<String>Text that will be shown along with the service message about the subscription; 0-128 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. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
Implementations§
Trait Implementations§
Source§impl Clone for GiftPremiumSubscription
impl Clone for GiftPremiumSubscription
Source§impl Debug for GiftPremiumSubscription
impl Debug for GiftPremiumSubscription
impl Eq for GiftPremiumSubscription
Source§impl Hash for GiftPremiumSubscription
impl Hash for GiftPremiumSubscription
Source§impl PartialEq for GiftPremiumSubscription
impl PartialEq for GiftPremiumSubscription
Source§impl Payload for GiftPremiumSubscription
impl Payload for GiftPremiumSubscription
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 GiftPremiumSubscription
impl Serialize for GiftPremiumSubscription
impl StructuralPartialEq for GiftPremiumSubscription
Auto Trait Implementations§
impl Forget for GiftPremiumSubscription
impl Freeze for GiftPremiumSubscription
impl RefUnwindSafe for GiftPremiumSubscription
impl Send for GiftPremiumSubscription
impl Sync for GiftPremiumSubscription
impl Unpin for GiftPremiumSubscription
impl UnsafeUnpin for GiftPremiumSubscription
impl UnwindSafe for GiftPremiumSubscription
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> GiftPremiumSubscriptionSetters for Pwhere
P: HasPayload<Payload = GiftPremiumSubscription>,
impl<P> GiftPremiumSubscriptionSetters for Pwhere
P: HasPayload<Payload = GiftPremiumSubscription>,
Source§fn month_count(self, value: u8) -> Self
fn month_count(self, value: u8) -> Self
month_count field.Source§fn star_count(self, value: u32) -> Self
fn star_count(self, value: u32) -> Self
star_count 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.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 more