mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 17:33:44 +00:00
Fix webhook.
This commit is contained in:
parent
dcbaa6d561
commit
89dc148ef5
2 changed files with 6 additions and 2 deletions
|
|
@ -181,6 +181,7 @@ class Dispatcher:
|
|||
raise RuntimeError('Pooling already started')
|
||||
log.info('Start pooling.')
|
||||
context.set_value(MODE, LONG_POOLING)
|
||||
context.set_value('dispatcher', self)
|
||||
context.set_value('bot', self.bot)
|
||||
|
||||
self._pooling = True
|
||||
|
|
|
|||
|
|
@ -53,7 +53,10 @@ class WebhookRequestHandler(web.View):
|
|||
|
||||
:return: :class:`aiogram.Dispatcher`
|
||||
"""
|
||||
return self.request.app[BOT_DISPATCHER_KEY]
|
||||
dp = self.request.app[BOT_DISPATCHER_KEY]
|
||||
context.set_value('dispatcher', dp)
|
||||
context.set_value('bot', dp.bot)
|
||||
return dp
|
||||
|
||||
async def parse_update(self, bot):
|
||||
"""
|
||||
|
|
@ -63,7 +66,7 @@ class WebhookRequestHandler(web.View):
|
|||
:return: :class:`aiogram.types.Update`
|
||||
"""
|
||||
data = await self.request.json()
|
||||
update = types.Update.deserialize(data)
|
||||
update = types.Update(**data)
|
||||
bot.prepare_object(update, parent=bot)
|
||||
return update
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue