Interface InputMessagePoll

A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat. Subtype of InputMessageContent.

interface InputMessagePoll {
    @type: "inputMessagePoll";
    allows_multiple_answers?: boolean;
    allows_revoting?: boolean;
    close_date: number;
    country_codes: string[];
    description: FormattedText;
    hide_results_until_closes?: boolean;
    is_anonymous?: boolean;
    is_closed?: boolean;
    media: InputPollMedia;
    members_only?: boolean;
    open_period: number;
    options: InputPollOption[];
    question: FormattedText;
    shuffle_options?: boolean;
    type: InputPollType;
}

Properties

@type: "inputMessagePoll"
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.

close_date: number

Point in time (Unix timestamp) when the poll will automatically be closed; must be 0-getOption("poll_open_period_max") seconds in the future; pass 0 if not specified.

country_codes: string[]

The list of two-letter ISO 3166-1 alpha-2 codes of countries whose users will be able to vote; for channel chats only. If empty, then all users can participate in the poll. There can be up to getOption("poll_country_count_max") chosen countries.

description: FormattedText

A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat.

hide_results_until_closes?: boolean

True, if the poll results will appear only after the poll closes.

is_anonymous?: boolean

True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels.

is_closed?: boolean

True, if the poll needs to be sent already closed; for bots only.

Media attached to the poll; pass null if none. Must be one of the following types: inputPollMediaAnimation, inputPollMediaAudio, inputPollMediaDocument, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaVenue, or inputPollMediaVideo without caption.

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; for channel chats only.

open_period: number

Amount of time the poll will be active after creation, in seconds; 0-getOption("poll_open_period_max"); pass 0 if not specified.

options: InputPollOption[]

List of poll answer options; 1-getOption("poll_answer_count_max") options.

question: FormattedText

Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users.

shuffle_options?: boolean

True, if poll options must be shown in a fixed random order.

Type of the poll.