Poll
class Poll
This object contains information about a poll.
Methods
No description
Unique poll identifier.
Poll question, 1-300 characters.
List of poll options.
Total number of users that voted in the poll.
True, if the poll is closed.
True, if the poll is anonymous.
Poll type, currently can be “regular” or “quiz”.
True, if the poll allows multiple answers.
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.
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.
Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.
Optional. Amount of time in seconds the poll will be active after creation.
Optional. Point in time (Unix timestamp) when the poll will be automatically closed.
Details
at line 25
__construct(string $id, string $question, PollOption[] $options, int $total_voter_count, bool $is_closed, bool $is_anonymous, string $type, bool $allows_multiple_answers, int|null $correct_option_id = null, string|null $explanation = null, MessageEntity[]|null $explanation_entities = null, int|null $open_period = null, int|null $close_date = null)
No description
at line 45
string
getId()
Unique poll identifier.
at line 53
string
getQuestion()
Poll question, 1-300 characters.
at line 63
array
getOptions()
List of poll options.
at line 71
int
getTotalVoterCount()
Total number of users that voted in the poll.
at line 79
bool
getIsClosed()
True, if the poll is closed.
at line 87
bool
getIsAnonymous()
True, if the poll is anonymous.
at line 95
string
getType()
Poll type, currently can be “regular” or “quiz”.
at line 103
bool
getAllowsMultipleAnswers()
True, if the poll allows multiple answers.
at line 111
int|null
getCorrectOptionId()
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.
at line 119
string|null
getExplanation()
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.
at line 129
array|null
getExplanationEntities()
Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.
at line 137
int|null
getOpenPeriod()
Optional. Amount of time in seconds the poll will be active after creation.
at line 145
int|null
getCloseDate()
Optional. Point in time (Unix timestamp) when the poll will be automatically closed.