Layer 227
PollObj
Poll
constructor
poll#58747131 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:TextWithEntities answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll;
Parameters
| Name | Type | Description |
|---|---|---|
| Id | long | ID of the poll |
| Closed | flags .0? true | Whether the poll is closed and doesn't accept any more answers |
| PublicVoters | flags .1? true | Whether cast votes are publicly visible to all users (non-anonymous poll) |
| MultipleChoice | flags .2? true | Whether multiple options can be chosen as answer |
| Quiz | flags .3? true | Whether this is a quiz (with wrong and correct answers, results shown in the return type). When creating a poll, the correct answers are specified in input Media Poll. correct_answers. |
| OpenAnswers | flags .6? true | Whether users can add new answer options after the poll is created, see open-answer polls |
| RevotingDisabled | flags .7? true | If set, users cannot change their vote after casting it |
| ShuffleAnswers | flags .8? true | Whether answer options are displayed in a randomized order to each user |
| HideResultsUntilClose | flags .9? true | Whether vote results are hidden from all participants until the poll is closed |
| Creator | flags .10? true | Whether the current user created this poll |
| SubscribersOnly | flags .11? true | Whether only subscribers can vote: a user may vote only if they are currently a member of the channel/supergroup and joined it at least 24 hours before the poll was posted, see subscriber-only polls. |
| Question | TextWithEntities | The question of the poll (only Premium users can use custom emoji entities here). |
| Answers | Vector < PollAnswer > | The possible answers (2- poll_answers_max ), vote using messages. send Vote. |
| ClosePeriod | flags .4? int | Amount of time in seconds the poll will be active after creation, up to poll_close_period_max seconds. Can't be used together with close_date. |
| CloseDate | flags .5? int | Point in time (Unix timestamp) when the poll will be automatically closed. Up to poll_close_period_max seconds in the future; can't be used together with close_period. |
| CountriesIso2 | flags .12? Vector < string > | If set, only users from the specified ISO 3166-1 alpha-2 country codes may vote, see country-restricted polls; a user may vote only if the phone_country_iso 2 configuration parameter is contained in this list. |
| Hash | long | Hash for use with messages. get Poll Results |
Returns
PollGogram Example
// Creating PollObj constructor obj := &tg.PollObj{ Id: int64(1234567890), Closed: nil, PublicVoters: nil, MultipleChoice: nil, Quiz: nil, OpenAnswers: nil, // ... more required fields }