From ee08c5517107106f8c7ff97936331b2ea2ceb9c0 Mon Sep 17 00:00:00 2001 From: djeck1432 Date: Fri, 22 Nov 2024 18:03:20 +0100 Subject: [PATCH] disable telegram bot if TELEGRAM_TOKEN is not set --- apps/web_app/telegram/bot.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/web_app/telegram/bot.py b/apps/web_app/telegram/bot.py index 80d78646..70ddb7c4 100644 --- a/apps/web_app/telegram/bot.py +++ b/apps/web_app/telegram/bot.py @@ -3,7 +3,11 @@ from .config import TELEGRAM_TOKEN from .handlers import index_router -bot = Bot(token=TELEGRAM_TOKEN) -dp = Dispatcher() +if TELEGRAM_TOKEN: + bot = Bot(token=TELEGRAM_TOKEN) + dp = Dispatcher() -dp.include_router(index_router) + dp.include_router(index_router) +else: + bot = None + dp = None