From 1652392572b339a93d24fd78212c3aa3322987f4 Mon Sep 17 00:00:00 2001 From: MrWhiff Date: Tue, 9 Dec 2025 21:14:35 +0100 Subject: [PATCH] AstraOS Ver. 1.8.2: - DC Bots werden nach restart automatisch gestartet --- AstraOS/astra_os.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/AstraOS/astra_os.py b/AstraOS/astra_os.py index 2f1c36e..a5b9b5b 100644 --- a/AstraOS/astra_os.py +++ b/AstraOS/astra_os.py @@ -128,12 +128,6 @@ except Exception as e: accounts_collection = None logs_collection = None -# Autostart-Funktion für Bots im Produktions- und Entwicklungsmodus aufrufen -# Die Prüfung `os.environ.get('WERKZEUG_RUN_MAIN') != 'true'` verhindert, dass es im Debug-Modus doppelt ausgeführt wird. -if os.environ.get('WERKZEUG_RUN_MAIN') != 'true': - with app.app_context(): - start_bots_on_startup() - def start_bots_on_startup(): if discord_bots_collection is None: print("WARNUNG: Bot-Autostart übersprungen, da keine DB-Verbindung besteht.") @@ -170,6 +164,11 @@ def start_bots_on_startup(): except Exception as e: print(f"FEHLER: Bot '{bot_info['name']}' konnte nicht gestartet werden: {e}") +# Autostart-Funktion für Bots im Produktions- und Entwicklungsmodus aufrufen +# Die Prüfung `os.environ.get('WERKZEUG_RUN_MAIN') != 'true'` verhindert, dass es im Debug-Modus doppelt ausgeführt wird. +if os.environ.get('WERKZEUG_RUN_MAIN') != 'true': + with app.app_context(): + start_bots_on_startup() try: tickets_client = MongoClient(os.environ.get("MONGO_URI"))