Struct tgbot::types::GiveawayWinners
source · pub struct GiveawayWinners {
pub chat: Chat,
pub giveaway_message_id: Integer,
pub winner_count: Integer,
pub winners: Vec<User>,
pub winners_selection_date: Integer,
pub additional_chat_count: Option<Integer>,
pub only_new_members: Option<bool>,
pub premium_subscription_month_count: Option<Integer>,
pub prize_description: Option<String>,
pub unclaimed_prize_count: Option<Integer>,
pub was_refunded: Option<bool>,
}
Expand description
Represents a message about the completion of a giveaway with public winners.
Fields§
§chat: Chat
The chat that created the giveaway.
giveaway_message_id: Integer
Identifier of the messsage with the giveaway in the chat.
winner_count: Integer
Total number of winners in the giveaway.
winners: Vec<User>
List of up to 100 winners of the giveaway.
winners_selection_date: Integer
Point in time (Unix timestamp) when winners of the giveaway were selected.
additional_chat_count: Option<Integer>
The number of other chats the user had to join in order to be eligible for the giveaway.
only_new_members: Option<bool>
Whether only users who had joined the chats after the giveaway started were 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.
unclaimed_prize_count: Option<Integer>
Number of undistributed prizes.
was_refunded: Option<bool>
Whether the giveaway was canceled because the payment for it was refunded.
Implementations§
source§impl GiveawayWinners
impl GiveawayWinners
sourcepub fn new<A, B>(
chat: A,
giveaway_message_id: Integer,
winner_count: Integer,
winners: B,
winners_selection_date: Integer
) -> Self
pub fn new<A, B>( chat: A, giveaway_message_id: Integer, winner_count: Integer, winners: B, winners_selection_date: Integer ) -> Self
Creates a new GiveawayWinners
.
§Arguments
chat
- The chat that created the giveaway.giveaway_message_id
- Identifier of the messsage with the giveaway in the chat.winner_count
- Total number of winners in the giveaway.winners
- List of up to 100 winners of the giveaway.winners_selection_date
- Point in time (Unix timestamp) when winners of the giveaway were selected.
sourcepub fn with_additional_chat_count(self, value: Integer) -> Self
pub fn with_additional_chat_count(self, value: Integer) -> Self
Sets a new number of additional chats.
§Arguments
value
- The number of other chats the user had to join in order to be eligible for the giveaway.
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 an only_new_members
flag.
§Arguments
value
- Whether only users who had joined the chats after the giveaway started were 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
sourcepub fn with_unclaimed_prize_count(self, value: Integer) -> Self
pub fn with_unclaimed_prize_count(self, value: Integer) -> Self
sourcepub fn with_was_refunded(self, value: bool) -> Self
pub fn with_was_refunded(self, value: bool) -> Self
Sets a new value for a was_refunded
flag.
§Arguments
value
- Whether the giveaway was canceled because the payment for it was refunded.
Trait Implementations§
source§impl Clone for GiveawayWinners
impl Clone for GiveawayWinners
source§fn clone(&self) -> GiveawayWinners
fn clone(&self) -> GiveawayWinners
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GiveawayWinners
impl Debug for GiveawayWinners
source§impl<'de> Deserialize<'de> for GiveawayWinners
impl<'de> Deserialize<'de> for GiveawayWinners
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 From<GiveawayWinners> for ExternalReplyData
impl From<GiveawayWinners> for ExternalReplyData
source§fn from(original: GiveawayWinners) -> ExternalReplyData
fn from(original: GiveawayWinners) -> ExternalReplyData
source§impl PartialEq for GiveawayWinners
impl PartialEq for GiveawayWinners
source§fn eq(&self, other: &GiveawayWinners) -> bool
fn eq(&self, other: &GiveawayWinners) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for GiveawayWinners
impl Serialize for GiveawayWinners
impl StructuralPartialEq for GiveawayWinners
Auto Trait Implementations§
impl Freeze for GiveawayWinners
impl RefUnwindSafe for GiveawayWinners
impl Send for GiveawayWinners
impl Sync for GiveawayWinners
impl Unpin for GiveawayWinners
impl UnwindSafe for GiveawayWinners
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