From aa4751fd06cca7f4b4a09409fdd6a874fe8b2748 Mon Sep 17 00:00:00 2001 From: Dmitry Afanasyev Date: Sat, 13 Aug 2022 15:59:27 +0300 Subject: [PATCH] reworked to poetry run --- app/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index f03b9f7..8a699ec 100644 --- a/app/main.py +++ b/app/main.py @@ -1,3 +1,4 @@ +from aiogram import Dispatcher from aiogram.utils.executor import start_webhook from core.bot import bot, dispatcher from core.logger import logger @@ -5,12 +6,12 @@ from core.scheduler import asyncio_schedule from settings import WEBAPP_HOST, WEBAPP_PORT, WEBHOOK_PATH, WEBHOOK_URL -async def on_startup() -> None: +async def on_startup(dp: Dispatcher) -> None: await bot.set_webhook(WEBHOOK_URL) asyncio_schedule() -async def on_shutdown() -> None: +async def on_shutdown(dp: Dispatcher) -> None: logger.warning('Shutting down..') # Remove webhook (not acceptable in some cases)