Skip to content

Commit

Permalink
Merge pull request #298 from CarmineOptions/feat/run-web-app-without-…
Browse files Browse the repository at this point in the history
…telegram-bot

disable telegram bot if TELEGRAM_TOKEN is not set
  • Loading branch information
djeck1432 authored Nov 22, 2024
2 parents 12f65f1 + ee08c55 commit 8b07781
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 8b07781

Please sign in to comment.