mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fixed Dispatcher._process_update
This commit is contained in:
parent
33a6c769d5
commit
51f0b77a9e
2 changed files with 2 additions and 4 deletions
|
|
@ -233,13 +233,11 @@ class Dispatcher(Router):
|
|||
:param kwargs: contextual data for middlewares, filters and handlers
|
||||
:return: status
|
||||
"""
|
||||
handled = False
|
||||
try:
|
||||
response = await self.feed_update(bot, update, **kwargs)
|
||||
handled = handled is not UNHANDLED
|
||||
if call_answer and isinstance(response, TelegramMethod):
|
||||
await self._silent_call_request(bot=bot, result=response)
|
||||
return handled
|
||||
return response is not UNHANDLED
|
||||
|
||||
except Exception as e:
|
||||
loggers.dispatcher.exception(
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class TestDispatcher:
|
|||
dispatcher = Dispatcher()
|
||||
|
||||
result = await dispatcher._process_update(bot=bot, update=Update(update_id=42))
|
||||
assert result
|
||||
assert not result
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_process_update_handled(self, bot: MockedBot):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue