Fix bug with token in join server

This commit is contained in:
Logan Cusano
2025-06-29 18:02:20 -04:00
parent 743e405ff6
commit 0a82a9b6e6

View File

@@ -73,13 +73,13 @@ def command(func):
@command
async def join_server(websocket, system_id, guild_id, channel_id):
# Takes guild ID, channel ID, and optionally system_id. If system ID is not included then it will skip OP25 logic
global bot_token
bot_status = await drb_api.get_bot_status()
print("Bot status:", bot_status)
# Check if the bot is running
if 'bot_running' not in bot_status or not bot_status['bot_running']:
# Get a token if one is not already
if not bot_token:
global bot_token
bot_token = await srv_api.request_token()
if not bot_token or "token" not in bot_token or not bot_token['token']:
raise Exception("No bot token received") # TODO - Handle this better