diff --git a/main.py b/main.py index 70514c6..ae1bc1c 100644 --- a/main.py +++ b/main.py @@ -9,6 +9,7 @@ from webui import create_ui from bot_instance import bot import asyncio +bot_started = False # prolly only need this in dev mode load_dotenv() TOKEN = os.getenv("TOKEN") if not TOKEN: @@ -32,8 +33,11 @@ async def start_discord_bot(): def main(): + global bot_started create_ui() - ui.timer(0, lambda: asyncio.create_task(start_discord_bot()), once=True) + if not bot_started: + bot_started = True + ui.timer(0, lambda: asyncio.create_task(start_discord_bot()), once=True) ui.run()