pub struct Giveaway {
pub chats: Vec<Chat>,
pub winners_selection_date: Integer,
pub winner_count: Integer,
pub country_codes: Option<Vec<String>>,
pub has_public_winners: Option<bool>,
pub only_new_members: Option<bool>,
pub premium_subscription_month_count: Option<Integer>,
pub prize_description: Option<String>,
pub prize_star_count: Option<Integer>,
}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: IntegerPoint in time (Unix timestamp) when winners of the giveaway will be selected.
winner_count: IntegerThe 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.
prize_star_count: Option<Integer>The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only.
Implementations§
Source§impl Giveaway
impl Giveaway
Sourcepub fn new<A, B>(
chats: A,
winners_selection_date: Integer,
winner_count: Integer,
) -> Self
pub fn new<A, B>( chats: A, winners_selection_date: Integer, winner_count: Integer, ) -> Self
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) -> Self
pub fn with_country_codes<A, B>(self, value: A) -> Self
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) -> Self
pub fn with_has_public_winners(self, value: bool) -> Self
Sets a new value for the 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) -> Self
pub fn with_only_new_members(self, value: bool) -> Self
Sets a new value for the 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.
Sourcepub fn with_prize_description<T>(self, value: T) -> Self
pub fn with_prize_description<T>(self, value: T) -> Self
Sets a new description of additional prizes.
§Arguments
value- Description of additional giveaway prize.
Sourcepub fn with_prize_star_count(self, value: Integer) -> Self
pub fn with_prize_star_count(self, value: Integer) -> Self
Sets a new prize star count.
§Arguments
value- The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only.