mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Pass kwargs to observer from Dispatcher.feed_update
This commit is contained in:
parent
23dbd88487
commit
21c8ad4ec3
1 changed files with 3 additions and 3 deletions
|
|
@ -9,14 +9,14 @@ from .router import Router
|
|||
class Dispatcher(Router):
|
||||
@property
|
||||
def parent_router(self) -> Optional[Router]:
|
||||
return super().parent_router
|
||||
return None
|
||||
|
||||
@parent_router.setter
|
||||
def parent_router(self, value) -> Optional[Router]:
|
||||
# Dispatcher is root Router then configuring parent router is not allowed
|
||||
raise RuntimeError("Dispatcher can not be attached to another Router.")
|
||||
|
||||
async def feed_update(self, bot: Bot, update: Update):
|
||||
async def feed_update(self, bot: Bot, update: Update, **kwargs):
|
||||
"""
|
||||
Main entry point for incoming updates
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ class Dispatcher(Router):
|
|||
:return:
|
||||
"""
|
||||
Bot.set_current(bot)
|
||||
async for result in self.update_handler.trigger(update, bot=bot):
|
||||
async for result in self.update_handler.trigger(update, bot=bot, **kwargs):
|
||||
yield result
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue