Fixed circular import.

This commit is contained in:
2026-04-09 12:28:06 +02:00
parent d74534965c
commit a17a790b61
3 changed files with 11 additions and 7 deletions

9
bot_instance.py Normal file
View File

@@ -0,0 +1,9 @@
from discord.ext import commands
import discord
import threading
intents = discord.Intents.default()
bot = commands.Bot(command_prefix="!", intents=intents)
bot.tracked_games = []
bot.tracked_games_lock = threading.Lock()

View File

@@ -7,16 +7,11 @@ from servermanager import create_server
from nicegui import ui
from webui import create_ui
import threading
from bot_instance import bot
intents = discord.Intents.default()
bot = commands.Bot(command_prefix="!", intents=intents)
load_dotenv()
TOKEN = os.getenv("TOKEN")
bot.tracked_games = []
bot.tracked_games_lock = threading.Lock()
def reload_games():
with bot.tracked_games_lock:

View File

@@ -1,5 +1,5 @@
from nicegui import ui
from main import bot
from bot_instance import bot
# reminder:
# tracked_games etc erst in andere variable kopieren und lock benutzen.