Fix bug with token in join server
This commit is contained in:
@@ -73,13 +73,13 @@ def command(func):
|
|||||||
@command
|
@command
|
||||||
async def join_server(websocket, system_id, guild_id, channel_id):
|
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
|
# 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()
|
bot_status = await drb_api.get_bot_status()
|
||||||
print("Bot status:", bot_status)
|
print("Bot status:", bot_status)
|
||||||
# Check if the bot is running
|
# Check if the bot is running
|
||||||
if 'bot_running' not in bot_status or not bot_status['bot_running']:
|
if 'bot_running' not in bot_status or not bot_status['bot_running']:
|
||||||
# Get a token if one is not already
|
# Get a token if one is not already
|
||||||
if not bot_token:
|
if not bot_token:
|
||||||
global bot_token
|
|
||||||
bot_token = await srv_api.request_token()
|
bot_token = await srv_api.request_token()
|
||||||
if not bot_token or "token" not in bot_token or not bot_token['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
|
raise Exception("No bot token received") # TODO - Handle this better
|
||||||
|
|||||||
Reference in New Issue
Block a user