Skip to main content

poll

Poll

type tg.Poll struct { /* ... */ }

Fields​

NameTypeRequiredDescription
IDint64yesID of the poll
Closedbool—Whether the poll is closed and doesn't accept any more answers
PublicVotersbool—Whether cast votes are publicly visible to all users (non-anonymous poll)
MultipleChoicebool—Whether multiple options can be chosen as answer
Quizbool—Whether this is a quiz (with wrong and correct answers, results shown in the return type)
OpenAnswersbool—OpenAnswers field of Poll.
RevotingDisabledbool—RevotingDisabled field of Poll.
ShuffleAnswersbool—ShuffleAnswers field of Poll.
HideResultsUntilClosebool—HideResultsUntilClose field of Poll.
Creatorbool—Creator field of Poll.
SubscribersOnlybool—SubscribersOnly field of Poll.
QuestionTextWithEntitiesyesThe question of the poll (only Premium users can use custom emoji entities here).
Answers[]PollAnswerClassyesThe possible answers (2-poll_answers_max), vote using messages.sendVote.
ClosePeriodint—Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
CloseDateint—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.
CountriesISO2[]string—CountriesISO2 field of Poll.
Hashint64yesHash field of Poll.

References​