Interface Poll

Describes a poll.

interface Poll {
    @type: "poll";
    allows_multiple_answers?: boolean;
    allows_revoting?: boolean;
    can_get_voters?: boolean;
    can_see_results?: boolean;
    close_date: number;
    country_codes: string[];
    id: string;
    is_anonymous?: boolean;
    is_closed?: boolean;
    members_only?: boolean;
    open_period: number;
    option_order: number[];
    options: PollOption[];
    question: FormattedText;
    recent_voter_ids: MessageSender[];
    total_voter_count: number;
    type: PollType;
    vote_restriction_reason: PollVoteRestrictionReason;
}

Properties

@type: "poll"
allows_multiple_answers?: boolean

True, if multiple answer options can be chosen simultaneously.

allows_revoting?: boolean

True, if the poll can be answered multiple times.

can_get_voters?: boolean

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

can_see_results?: boolean

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

close_date: number

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

country_codes: string[]

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

id: string

Unique poll identifier.

is_anonymous?: boolean

True, if the poll is anonymous.

is_closed?: boolean

True, if the poll is closed.

members_only?: boolean

True, if only the users who have been members of the chat for more than a day will be able to vote.

open_period: number

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

option_order: number[]

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

options: PollOption[]

List of poll answer options.

question: FormattedText

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

recent_voter_ids: MessageSender[]

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

total_voter_count: number

Total number of voters participating in the poll.

type: PollType

Type of the poll.

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.