Check discord status for token on startup

This commit is contained in:
Logan Cusano
2025-06-29 02:48:29 -04:00
parent 0966c78521
commit 2e5f54a0f5

View File

@@ -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: