Documentation - v0.27.0
    Preparing search index...

    Interface InputMediaPoll

    A simple poll to be sent

    Note: when using user account, the poll can't be sent to PMs, only to channels/groups, otherwise there will be MEDIA_INVALID error.

    interface InputMediaPoll {
        answers: (RawPollAnswer | InputText)[];
        caption?: InputText;
        closed?: boolean;
        closeDate?: number | Date;
        closePeriod?: number;
        multiple?: boolean;
        public?: boolean;
        question: InputText;
        type: "poll";
    }

    Hierarchy (View Summary)

    Index

    Properties

    answers: (RawPollAnswer | InputText)[]

    Answers of the poll.

    You can either provide a string, or a TL object representing an answer. Strings will be transformed to TL objects, with a single=byte incrementing option value.

    caption?: InputText

    Caption of the media

    closed?: boolean

    Whether this is poll is closed (i.e. nobody can vote anymore)

    closeDate?: number | Date

    Point in time 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 closePeriod.

    When number is used, UNIX time in ms is expected

    closePeriod?: number

    Amount of time in seconds the poll will be active after creation (5-600).

    Can't be used together with closeDate.

    multiple?: boolean

    Whether users can select multiple answers as an answer

    public?: boolean

    Whether this is a public poll (i.e. users who have voted are visible to everyone)

    question: InputText

    Question of the poll (1-255 chars for users, 1-300 chars for bots)

    type: "poll"