mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fixed signature of startup/shutdown events
- Include the **dispatcher.workflow_data as the handler arguments
This commit is contained in:
parent
1f03b0ad39
commit
c40c9dae67
2 changed files with 8 additions and 2 deletions
1
CHANGES/1155.bugfix.rst
Normal file
1
CHANGES/1155.bugfix.rst
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fixed signature of startup/shutdown events to include the **dispatcher.workflow_data as the handler arguments.
|
||||
|
|
@ -488,8 +488,13 @@ class Dispatcher(Router):
|
|||
signal.SIGINT, self._signal_stop_polling, signal.SIGINT
|
||||
)
|
||||
|
||||
workflow_data = {"dispatcher": self, "bots": bots, "bot": bots[-1]}
|
||||
workflow_data.update(kwargs)
|
||||
workflow_data = {
|
||||
"dispatcher": self,
|
||||
"bots": bots,
|
||||
"bot": bots[-1],
|
||||
**kwargs,
|
||||
**self.workflow_data,
|
||||
}
|
||||
await self.emit_startup(**workflow_data)
|
||||
loggers.dispatcher.info("Start polling")
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue