Skip to content

Poll

Type · TDLib 1.8.67 · d1085f9c

Describes a poll

Poll(
  id: int64,
  question: FormattedText,
  options: list of PollOption,
  total_voter_count: int32,
  recent_voter_ids: list of MessageSender,
  can_get_voters: Bool,
  can_see_results: Bool,
  is_anonymous: Bool,
  allows_multiple_answers: Bool,
  allows_revoting: Bool,
  members_only: Bool,
  country_codes: list of string,
  option_order: list of int32,
  type: PollType,
  open_period: int32,
  close_date: int32,
  is_closed: Bool,
  vote_restriction_reason: PollVoteRestrictionReason
) → Poll

id

int64

Unique poll identifier

question

FormattedText

Poll question; 1-300 characters; may contain only custom emoji entities

options

list of PollOption

List of poll answer options

total_voter_count

int32

Total number of voters, participating in the poll

recent_voter_ids

list of MessageSender

Identifiers of recent voters, if the poll is non-anonymous and poll results are available

can_get_voters

Bool

True, if the current user can get voters in the poll using getPollVoters

can_see_results

Bool

True, if the current user can see results of the poll

is_anonymous

Bool

True, if the poll is anonymous

allows_multiple_answers

Bool

True, if multiple answer options can be chosen simultaneously

allows_revoting

Bool

True, if the poll can be answered multiple times

members_only

Bool

True, if only the users that are members of the chat for more than a day will be able to vote

country_codes

list of string

The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote. If empty, then all users can participate in the poll

option_order

list of int32

The list of 0-based poll identifiers in which the options of the poll must be shown; empty if the order of options must not be changed

type

PollType

Type of the poll

open_period

int32

Amount of time the poll will be active after creation, in seconds

close_date

int32

Point in time (Unix timestamp) when the poll will automatically be closed

is_closed

Bool

True, if the poll is closed

vote_restriction_reason

PollVoteRestrictionReason

The reason describing, why the current user can't vote in the poll; may be null if the user can vote in the poll