pub struct Quiz {
pub correct_option_id: Integer,
pub id: String,
pub is_anonymous: bool,
pub is_closed: bool,
pub options: Vec<PollOption>,
pub question: String,
pub total_voter_count: Integer,
pub close_date: Option<Integer>,
pub explanation: Option<Text>,
pub open_period: Option<Integer>,
}
Expand description
Represents a quiz.
Fields§
§correct_option_id: Integer
0-based identifier of the correct answer option.
Available only for a closed quiz, or was sent (not forwarded) by the bot or to the private chat with the bot.
id: String
Unique identifier of the quiz.
is_anonymous: bool
Indicates whether the quiz is anonymous.
is_closed: bool
Indicates whether the quiz is closed.
options: Vec<PollOption>
List of options.
question: String
Question; 1-255 characters.
total_voter_count: Integer
Total number of users that answered to the quiz.
close_date: Option<Integer>
Point in time (Unix timestamp) when the quiz will be automatically closed.
explanation: Option<Text>
Text that is shown when a user chooses an incorrect answer or taps on the lamp icon; 0-200 characters.
open_period: Option<Integer>
Amount of time in seconds the quiz will be active after creation.
Implementations§
source§impl Quiz
impl Quiz
sourcepub fn with_close_date(self, value: Integer) -> Self
pub fn with_close_date(self, value: Integer) -> Self
Sets a new close date.
§Arguments
value
- Point in time (Unix timestamp) when the quiz will be automatically closed.
sourcepub fn with_correct_option_id(self, value: Integer) -> Self
pub fn with_correct_option_id(self, value: Integer) -> Self
sourcepub fn with_explanation<T>(self, value: T) -> Self
pub fn with_explanation<T>(self, value: T) -> Self
Sets a new explanation.
§Arguments
value
- Text that is shown when a user chooses an incorrect answer or taps on the lamp icon; 0-200 characters.
sourcepub fn with_is_anonymous(self, value: bool) -> Self
pub fn with_is_anonymous(self, value: bool) -> Self
Sets a new value for the is_anonymous
flag.
§Arguments
value
- Indicates whether the quiz is anonymous.
sourcepub fn with_is_closed(self, value: bool) -> Self
pub fn with_is_closed(self, value: bool) -> Self
sourcepub fn with_open_period(self, value: Integer) -> Self
pub fn with_open_period(self, value: Integer) -> Self
Sets a new open period.
§Arguments
value
- Amount of time in seconds the quiz will be active after creation.
sourcepub fn with_options<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = PollOption>,
pub fn with_options<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = PollOption>,
sourcepub fn with_total_voter_count(self, value: Integer) -> Self
pub fn with_total_voter_count(self, value: Integer) -> Self
Sets a new correct total voter count.
§Arguments
value
- Total number of users that answered to the quiz.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Quiz
impl<'de> Deserialize<'de> for Quiz
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 PartialEq for Quiz
impl PartialEq for Quiz
source§impl PartialOrd for Quiz
impl PartialOrd for Quiz
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more