2021-01-26 21:20:52 +02:00
|
|
|
===============
|
|
|
|
|
Handling events
|
|
|
|
|
===============
|
|
|
|
|
|
2021-12-01 03:43:57 +03:00
|
|
|
*aiogram* includes Dispatcher mechanism.
|
2021-01-26 21:20:52 +02:00
|
|
|
Dispatcher is needed for handling incoming updates from Telegram.
|
|
|
|
|
|
|
|
|
|
With dispatcher you can do:
|
|
|
|
|
|
|
|
|
|
- Handle incoming updates;
|
|
|
|
|
- Filter incoming events before it will be processed by specific handler;
|
|
|
|
|
- Modify event and related data in middlewares;
|
|
|
|
|
- Separate bot functionality between different handlers, modules and packages
|
|
|
|
|
|
|
|
|
|
Dispatcher is also separated into two entities - Router and Dispatcher.
|
|
|
|
|
Dispatcher is subclass of router and should be always is root router.
|
|
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
|
|
|
|
|
observer
|
|
|
|
|
router
|
|
|
|
|
dispatcher
|
2021-02-07 18:43:43 +02:00
|
|
|
class_based_handlers/index
|
|
|
|
|
filters/index
|
2021-05-12 23:00:12 +03:00
|
|
|
middlewares
|
2021-10-12 01:11:53 +03:00
|
|
|
finite_state_machine/index
|
2022-02-19 01:45:59 +02:00
|
|
|
flags
|