Skip to content

Commit

Permalink
disable telegram bot if TELEGRAM_TOKEN is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
djeck1432 committed Nov 22, 2024
1 parent 12f65f1 commit ee08c55
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/web_app/telegram/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ee08c55

Please sign in to comment.