From 2e5f54a0f5c5b69f109230a16043ae9e3bc4c9c6 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 29 Jun 2025 02:48:29 -0400 Subject: [PATCH] Check discord status for token on startup --- app/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/client.py b/app/client.py index 66709f3..86d33e6 100644 --- a/app/client.py +++ b/app/client.py @@ -254,6 +254,14 @@ async def receive_commands(websocket): async def main_client(): """Connects to the server and handles communication with a robust retry system.""" retry_delay = 5 # seconds + + # Get initial status from the discord bot + discord_status = await drb_api.get_bot_status() + if "active_token" in discord_status and discord_status['active_token']: + # If there's a status and the active token is set, update the global var + global bot_token + bot_token = discord_status['active_token'] + while True: print(f"Client {CLIENT_ID} attempting to connect to {SERVER_WS_URI}...") try: