Layer 220
Poll
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 |
| Flags | # | Flags, see TL conditional fields |
| 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) |
| 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, 5-600. Can't be used together with close_date. |
| CloseDate | flags.5?int | 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. |
Returns
PollGogram Example
// Creating Poll constructor obj := &tg.Poll{ Id: int64(0), Question: &tg.TextWithEntities{}, Answers: []tg.PollAnswer{&tg.PollAnswer{}}, // Optional fields: // Closed: true, // PublicVoters: true, // MultipleChoice: true, // Quiz: true, // ... more optional fields }