RequestPoll

RequestPoll is a single reply keyboard button that asks the user to create a poll and send it to the bot.

The button requires a text label. Optional parameter includes poll_type to specify type of the poll.

Code example:

from aiogram_dialog.widgets.kbd import RequestPoll
from aiogram_dialog.widgets.text import Const

# Regular poll
poll_btn = RequestPoll(
    text=Const("Create Poll"),
)

# Quiz poll
quiz_btn = RequestPoll(
    text=Const("Create Quiz"),
    poll_type="quiz",
)

Result:

../../../_images/request_poll.png

Classes

class aiogram_dialog.widgets.kbd.request.RequestPoll(text, poll_type=None, when=None, style=<aiogram_dialog.widgets.style.base.Style object>)
Parameters:
  • text (TextWidget)

  • poll_type (str | None)

  • when (str | Callable | None)

  • style (StyleWidget)

__init__(text, poll_type=None, when=None, style=<aiogram_dialog.widgets.style.base.Style object>)
Parameters:
  • text (TextWidget)

  • poll_type (str | None)

  • when (str | Callable | None)

  • style (StyleWidget)