1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// WARNING: THIS CODE IS AUTOGENERATED.
// DO NOT EDIT!!!
use crate::types::{MessageEntity, PollOption};
use serde::{Deserialize, Serialize};
/// This object contains information about a poll.
/// <https://core.telegram.org/bots/api#poll>
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Poll {
/// Unique poll identifier
pub id: String,
/// Poll question, 1-300 characters
pub question: String,
/// Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions
#[serde(skip_serializing_if = "Option::is_none")]
pub question_entities: Option<Vec<MessageEntity>>,
/// List of poll options
pub options: Vec<PollOption>,
/// Total number of users that voted in the poll
pub total_voter_count: i64,
/// True, if the poll is closed
pub is_closed: bool,
/// True, if the poll is anonymous
pub is_anonymous: bool,
/// Poll type, currently can be "regular" or "quiz"
pub r#type: String,
/// True, if the poll allows multiple answers
pub allows_multiple_answers: bool,
/// Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
#[serde(skip_serializing_if = "Option::is_none")]
pub correct_option_id: Option<i64>,
/// Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
#[serde(skip_serializing_if = "Option::is_none")]
pub explanation: Option<String>,
/// Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
#[serde(skip_serializing_if = "Option::is_none")]
pub explanation_entities: Option<Vec<MessageEntity>>,
/// Optional. Amount of time in seconds the poll will be active after creation
#[serde(skip_serializing_if = "Option::is_none")]
pub open_period: Option<i64>,
/// Optional. Point in time (Unix timestamp) when the poll will be automatically closed
#[serde(skip_serializing_if = "Option::is_none")]
pub close_date: Option<i64>,
}