MadelineProtoDocs/docs/API_docs/constructors/poll.md
2024-05-01 14:53:46 +02:00

1.8 KiB

title description nav_exclude image
poll Poll true https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png

Constructor: poll

Back to constructors index

Poll

Attributes:

Name Type Required Description
id long Yes ID of the poll
closed Bool Optional Whether the poll is closed and doesn't accept any more answers
public_voters Bool Optional Whether cast votes are publicly visible to all users (non-anonymous poll)
multiple_choice Bool Optional Whether multiple options can be chosen as answer
quiz Bool Optional Whether this is a quiz (with wrong and correct answers, results shown in the return type)
question TextWithEntities Yes
answers Array of PollAnswer Yes The possible answers, vote using messages.sendVote.
close_period int Optional Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
close_date int Optional Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future; can't be used together with close_period.

Type: Poll

Example:

$poll = ['_' => 'poll', 'id' => long, 'closed' => Bool, 'public_voters' => Bool, 'multiple_choice' => Bool, 'quiz' => Bool, 'question' => TextWithEntities, 'answers' => [PollAnswer, PollAnswer], 'close_period' => int, 'close_date' => int];