diff --git a/bot.py b/bot.py index 743223d..2bce749 100755 --- a/bot.py +++ b/bot.py @@ -1,8 +1,8 @@ # main.py import discord from discord.ext import commands +import itertools import os -import sys from dotenv import load_dotenv from utils.sql_commands import initialize_database @@ -46,12 +46,10 @@ def main(): load_dotenv() initialize_database() client = Client() - token = os.getenv("TOKEN") - if token is not None: - threading.Thread(target=run_web, daemon=True).start() - client.run(token) - else: - print("Token is missing.") + token = os.getenv("DISCORD_TOKEN") or os.getenv("TOKEN") + if not token: + raise SystemExit("ERROR: Discord token not found. Set DISCORD_TOKEN or TOKEN in environment.") + client.run(token) if __name__ == "__main__":