Help with logic in routers #1240
-
Hi all! I'm trying to write a bot that includes different functionality. Therefore, I think that at one moment I do not correctly exit the router, because I do not know the mechanism - it is not described anywhere. And is it generally possible to detach the router session? I'm jun in python, and even more so just to know aiogram. I can make mistakes, and I will be glad to any comments and critic. tree of work directory
bot.py
bot_workstart
bot _worktype
So in log when i start bot i get messages like this:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It looks like you're trying to pull an owl onto a globe - trying to use routers registering mechanist just like FSM, so, please, read the docs about FSM: https://docs.aiogram.dev/en/dev-3.x/dispatcher/finite_state_machine/index.html Note that you should'nt register any handler or router after you start receiveng of the incoming events. All handlers in routers tree should be registered when you construct the application. |
Beta Was this translation helpful? Give feedback.
It looks like you're trying to pull an owl onto a globe - trying to use routers registering mechanist just like FSM, so, please, read the docs about FSM: https://docs.aiogram.dev/en/dev-3.x/dispatcher/finite_state_machine/index.html
Note that you should'nt register any handler or router after you start receiveng of the incoming events. All handlers in routers tree should be registered when you construct the application.