pub struct Poll {Show 17 fields
pub id: String,
pub question: String,
pub question_entities: Option<Vec<MessageEntity>>,
pub options: Vec<PollOption>,
pub total_voter_count: u32,
pub is_closed: bool,
pub is_anonymous: bool,
pub kind: PollType,
pub allows_multiple_answers: bool,
pub allows_revoting: bool,
pub correct_option_ids: Option<Vec<u8>>,
pub explanation: Option<String>,
pub explanation_entities: Option<Vec<MessageEntity>>,
pub open_period: Option<u32>,
pub close_date: Option<i64>,
pub description: Option<String>,
pub description_entities: Option<Vec<MessageEntity>>,
}Expand description
A native Telegram poll or quiz.
Polls are either regular (users vote freely) or quiz (one or more correct
answers). Returned inside Message when a poll is
sent or forwarded.
Fields§
§id: StringUnique poll identifier.
question: StringPoll question (1–300 characters).
question_entities: Option<Vec<MessageEntity>>Special entities in the question.
options: Vec<PollOption>List of answer options.
total_voter_count: u32Total number of users who voted.
is_closed: booltrue if the poll is closed.
is_anonymous: booltrue if the poll is anonymous.
kind: PollTypePoll type.
allows_multiple_answers: booltrue if the poll allows multiple answers.
allows_revoting: booltrue if voters can change their chosen answer options.
correct_option_ids: Option<Vec<u8>>Zero-based indices of the correct answers (quiz polls only).
Bot API 9.6 changed this from a single u8 to an array to support
quizzes with multiple correct answers.
explanation: Option<String>Explanation shown after a quiz is answered.
explanation_entities: Option<Vec<MessageEntity>>Special entities in the explanation.
open_period: Option<u32>Duration in seconds the poll stays active after creation.
close_date: Option<i64>Unix timestamp when the poll closes automatically.
description: Option<String>Description of the poll; present only inside Message objects.
description_entities: Option<Vec<MessageEntity>>Special entities in the description.