From b9db17c2e35f31d57c49909f9db76c11b6c0a312 Mon Sep 17 00:00:00 2001 From: Dmitry Afanasyev Date: Tue, 16 Aug 2022 13:08:30 +0300 Subject: [PATCH] changed to gunicorn --- app/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index def620e..b478a86 100644 --- a/app/main.py +++ b/app/main.py @@ -67,7 +67,10 @@ async def webhook(request: web.Request) -> web.Response: async def on_startup_gunicorn(app: web.Application) -> None: - await Bot.get_current().set_webhook(WEBHOOK_URL) + Bot.set_current(dispatcher.bot) + Dispatcher.set_current(dispatcher) + await dispatcher.bot.set_webhook(WEBHOOK_URL) + logger.info(f'Webhook set to {WEBHOOK_URL}') async def create_app() -> web.Application: