mirror of
https://github.com/civsocit/olgram.git
synced 2023-07-22 01:29:12 +03:00
test
This commit is contained in:
parent
8b73746bcb
commit
8066aed530
@ -18,6 +18,7 @@ class CustomRequestHandler(WebhookRequestHandler):
|
|||||||
self._dispatcher = None
|
self._dispatcher = None
|
||||||
super(CustomRequestHandler, self).__init__(*args, **kwargs)
|
super(CustomRequestHandler, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
async def _create_dispatcher(self):
|
async def _create_dispatcher(self):
|
||||||
key = self.request.url.path[1:]
|
key = self.request.url.path[1:]
|
||||||
|
|
||||||
@ -40,11 +41,10 @@ class CustomRequestHandler(WebhookRequestHandler):
|
|||||||
return dp
|
return dp
|
||||||
|
|
||||||
async def post(self):
|
async def post(self):
|
||||||
# TODO: refactor
|
dispatcher = await self._create_dispatcher()
|
||||||
self._dispatcher = await self._create_dispatcher()
|
Dispatcher.set_current(dispatcher)
|
||||||
res = await super(CustomRequestHandler, self).post()
|
AioBot.set_current(dispatcher.bot)
|
||||||
self._dispatcher = None
|
return await super(CustomRequestHandler, self).post()
|
||||||
return res
|
|
||||||
|
|
||||||
def get_dispatcher(self):
|
def get_dispatcher(self):
|
||||||
"""
|
"""
|
||||||
@ -52,4 +52,5 @@ class CustomRequestHandler(WebhookRequestHandler):
|
|||||||
|
|
||||||
:return: :class:`aiogram.Dispatcher`
|
:return: :class:`aiogram.Dispatcher`
|
||||||
"""
|
"""
|
||||||
return self._dispatcher
|
return Dispatcher.get_current()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user