pub struct GiveawayBuilder {
pub chats: Vec<Chat>,
pub winners_selection_date: i64,
pub winner_count: i64,
pub only_new_members: Option<bool>,
pub has_public_winners: Option<bool>,
pub prize_description: Option<String>,
pub country_codes: Option<Vec<String>>,
pub prize_star_count: Option<i64>,
pub premium_subscription_month_count: Option<i64>,
}Expand description
This object 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: i64Point in time (Unix timestamp) when winners of the giveaway will be selected
winner_count: i64The number of users which are supposed to be selected as winners of the giveaway
only_new_members: Option<bool>Optional. True, if only users who join the chats after the giveaway started should be eligible to win
has_public_winners: Option<bool>Optional. True, if the list of giveaway winners will be visible to everyone
prize_description: Option<String>Optional. Description of additional giveaway prize
country_codes: Option<Vec<String>>Optional. 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.
prize_star_count: Option<i64>Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
Implementations§
Source§impl GiveawayBuilder
impl GiveawayBuilder
pub fn new( chats: Vec<Chat>, winners_selection_date: i64, winner_count: i64, ) -> Self
Sourcepub fn set_chats(self, chats: Vec<Chat>) -> Self
pub fn set_chats(self, chats: Vec<Chat>) -> Self
The list of chats which the user must join to participate in the giveaway
Sourcepub fn set_winners_selection_date(self, winners_selection_date: i64) -> Self
pub fn set_winners_selection_date(self, winners_selection_date: i64) -> Self
Point in time (Unix timestamp) when winners of the giveaway will be selected
Sourcepub fn set_winner_count(self, winner_count: i64) -> Self
pub fn set_winner_count(self, winner_count: i64) -> Self
The number of users which are supposed to be selected as winners of the giveaway
Sourcepub fn set_only_new_members(self, only_new_members: bool) -> Self
pub fn set_only_new_members(self, only_new_members: bool) -> Self
Optional. True, if only users who join the chats after the giveaway started should be eligible to win
Sourcepub fn set_has_public_winners(self, has_public_winners: bool) -> Self
pub fn set_has_public_winners(self, has_public_winners: bool) -> Self
Optional. True, if the list of giveaway winners will be visible to everyone
Sourcepub fn set_prize_description(self, prize_description: String) -> Self
pub fn set_prize_description(self, prize_description: String) -> Self
Optional. Description of additional giveaway prize
Sourcepub fn set_country_codes(self, country_codes: Vec<String>) -> Self
pub fn set_country_codes(self, country_codes: Vec<String>) -> Self
Optional. 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.
Sourcepub fn set_prize_star_count(self, prize_star_count: i64) -> Self
pub fn set_prize_star_count(self, prize_star_count: i64) -> Self
Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
pub fn build(self) -> Giveaway
Trait Implementations§
Source§impl Clone for GiveawayBuilder
impl Clone for GiveawayBuilder
Source§fn clone(&self) -> GiveawayBuilder
fn clone(&self) -> GiveawayBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GiveawayBuilder
impl Debug for GiveawayBuilder
Source§impl Default for GiveawayBuilder
impl Default for GiveawayBuilder
Source§fn default() -> GiveawayBuilder
fn default() -> GiveawayBuilder
Source§impl<'de> Deserialize<'de> for GiveawayBuilder
impl<'de> Deserialize<'de> for GiveawayBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for GiveawayBuilder
impl Hash for GiveawayBuilder
Source§impl Ord for GiveawayBuilder
impl Ord for GiveawayBuilder
Source§fn cmp(&self, other: &GiveawayBuilder) -> Ordering
fn cmp(&self, other: &GiveawayBuilder) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for GiveawayBuilder
impl PartialEq for GiveawayBuilder
Source§impl PartialOrd for GiveawayBuilder
impl PartialOrd for GiveawayBuilder
Source§impl Serialize for GiveawayBuilder
impl Serialize for GiveawayBuilder
impl Eq for GiveawayBuilder
impl StructuralPartialEq for GiveawayBuilder
Auto Trait Implementations§
impl Freeze for GiveawayBuilder
impl RefUnwindSafe for GiveawayBuilder
impl Send for GiveawayBuilder
impl Sync for GiveawayBuilder
impl Unpin for GiveawayBuilder
impl UnsafeUnpin for GiveawayBuilder
impl UnwindSafe for GiveawayBuilder
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.