from app import app, start_telegram_bot
import os

# Start Telegram bot when running via WSGI/service (e.g., gunicorn, mod_wsgi)
# Guard with env var to avoid multiple instances in multi-worker setups.
if os.environ.get("ENABLE_TG_BOT", "1") == "1":
    start_telegram_bot()
    

if __name__ == "__main__":
    app.run()