Skip to main content

Voting on a poll

The dyteClient.polls.vote() method can be used to register a vote on a poll. It accepts the following params.

ParamTypeDefault ValueRequiredDescription
pollMessageDytePollMessage-yesContains all the poll properties (question, options, etc.)
pollOptionDytePollOptionyesyesOption on which the user voted

The following snippet votes for the 1st option on the 1st poll created in the meeting.

final poll = dyteClient.polls.polls[0];
final selectedPollOption = poll.options[0];
dyteClient.polls.vote(poll, selectedPollOption);