Skip to main content

Poll

Poll is an object which ask user to choose an option.

import { Poll } from "@tlgr/poll";
const poll = new Carousel(bot, options);

bot.start(ctx => {
await poll.send(ctx);
})

// some time after
await poll.stop();

Events described at events page

extends​

constructor(bot, options)​

added in 1.0.0
  • bot - <Object>. Telegraf instance.
  • options - <Object>. Poll options
    • name - <string>. Poll name.
    • options - <string[]>. possible options as an array.
    • open_period - <number>. Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
    • is_anonymous - <boolean>. True, if the poll needs to be anonymous, defaults to True.