pub struct Giveaway {
pub chats: Vec<Chat>,
pub winners_selection_date: i64,
pub winner_count: i64,
pub country_codes: Option<Vec<String>>,
pub has_public_winners: Option<bool>,
pub only_new_members: Option<bool>,
pub premium_subscription_month_count: Option<i64>,
pub prize_description: Option<String>,
}
Expand description
Represents a message about a scheduled giveaway.
Fields§
§chats: Vec<Chat>
The list of chats which the user must join to participate in the giveaway.
winners_selection_date: i64
Point in time (Unix timestamp) when winners of the giveaway will be selected.
winner_count: i64
The number of users which are supposed to be selected as winners of the giveaway.
country_codes: Option<Vec<String>>
A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come.
If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.
has_public_winners: Option<bool>
Whether the list of giveaway winners will be visible to everyone.
only_new_members: Option<bool>
Whether only users who join the chats after the giveaway started should be eligible to win.
The number of months the Telegram Premium subscription won from the giveaway will be active for.
prize_description: Option<String>
Description of additional giveaway prize.
Implementations§
source§impl Giveaway
impl Giveaway
sourcepub fn new<A, B>(
chats: A,
winners_selection_date: i64,
winner_count: i64
) -> Giveaway
pub fn new<A, B>( chats: A, winners_selection_date: i64, winner_count: i64 ) -> Giveaway
Creates a new Giveaway
.
§Arguments
chats
- The list of chats which the user must join to participate in the giveaway.winners_selection_date
- Point in time (Unix timestamp) when winners of the giveaway will be selected.winner_count
- The number of users which are supposed to be selected as winners of the giveaway.
sourcepub fn with_country_codes<A, B>(self, value: A) -> Giveaway
pub fn with_country_codes<A, B>(self, value: A) -> Giveaway
Sets a new list of country codes.
§Arguments
value
- A list of two-letter ISO 3166-1 alpha-2 country codes.
sourcepub fn with_has_public_winners(self, value: bool) -> Giveaway
pub fn with_has_public_winners(self, value: bool) -> Giveaway
Sets a new value for a has_public_winners
flag.
§Arguments
value
- Whether the list of giveaway winners will be visible to everyone.
sourcepub fn with_only_new_members(self, value: bool) -> Giveaway
pub fn with_only_new_members(self, value: bool) -> Giveaway
Sets a new value for an only_new_members
flag.
§Arguments
value
- Whether only users who join the chats after the giveaway started should be eligible to win.
Sets a new number of premium subscription months.
§Arguments
value
- The number of months the Telegram Premium subscription won from the giveaway will be active for.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Giveaway
impl<'de> Deserialize<'de> for Giveaway
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Giveaway, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Giveaway, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<Giveaway> for ExternalReplyData
impl From<Giveaway> for ExternalReplyData
source§fn from(original: Giveaway) -> ExternalReplyData
fn from(original: Giveaway) -> ExternalReplyData
source§impl PartialEq for Giveaway
impl PartialEq for Giveaway
source§impl Serialize for Giveaway
impl Serialize for Giveaway
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 Giveaway
Auto Trait Implementations§
impl Freeze for Giveaway
impl RefUnwindSafe for Giveaway
impl Send for Giveaway
impl Sync for Giveaway
impl Unpin for Giveaway
impl UnwindSafe for Giveaway
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> 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