Skip to main content
Module

x/mtkruto/mod.ts>Poll

[WIP] Cross-runtime JavaScript library for building Telegram clients
Go to Latest
interface Poll
Re-export
import { type Poll } from "https://deno.land/x/mtkruto@0.1.100/mod.ts";

Properties

id: string

Unique poll identifier

question: string

Poll question, 1-300 characters

options: PollOption[]

List of poll options

totalVoterCount: number

Total number of users that voted in the poll

isClosed: boolean

True, if the poll is closed

isAnonymous: boolean

True, if the poll is anonymous

type: "regular" | "quiz"

Poll type, currently can be "regular" or "quiz"

optional
allowMultipleAnswers: boolean

True, if the poll allows multiple answers

optional
correctOptionIndex: number

Index of the correct answer in options. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.

optional
explanation: string

Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters

optional
explanationEntities: MessageEntity[]

Special entities like usernames, URLs, bot commands, etc. that appear in the explanation

optional
openPeriod: number

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

optional
closeDate: Date

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