aiogram/docs/dispatcher/class_based_handlers/poll.md
mpa 4124770b0e refactor(handler): rename observers
Rename observers but with backward compatibility, relevant documentation
2020-05-10 03:02:31 +04:00

558 B

PollHandler

There is base class for poll handlers.

Simple usage:

from aiogram.handlers import PollHandler

...

@router.poll()
class MyHandler(PollHandler):
    async def handle(self) -> Any: ...

Extension

This base handler is subclass of BaseHandler with some extensions:

  • self.question is alias for self.event.question
  • self.options is alias for self.event.options