from discord.ext import commands import discord import threading import os from dotenv import load_dotenv _started = False intents = discord.Intents.default() bot = commands.Bot(command_prefix="!", intents=intents) bot.tracked_games = [] bot.tracked_games_lock = threading.Lock() async def start_bot(): global _started if _started: return _started = True load_dotenv() TOKEN = os.getenv("TOKEN") if not TOKEN: raise ValueError("No token found") await bot.start(TOKEN)