MadelineProtoDocs/old_docs/API_docs_v38/constructors/poll.md
2020-06-16 17:50:25 +02:00

1.4 KiB

title description image
poll Poll 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 string Yes The question of the poll
answers Array of PollAnswer Yes The possible answers, vote using messages.sendVote.

Type: Poll

Example:

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

Or, if you're into Lua:

poll={_='poll', id=long, closed=Bool, public_voters=Bool, multiple_choice=Bool, quiz=Bool, question='string', answers={PollAnswer}}