Added debug to main client

This commit is contained in:
Logan Cusano
2025-04-27 02:15:26 -04:00
parent 68cc0aa18e
commit 40565b1235

View File

@@ -43,10 +43,12 @@ def command(func):
async def join_server(system_id, guild_id, channel_id):
# Takes system ID, guild ID, channel ID
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
bot_token = await srv_api.request_token()
print("Bot token:", bot_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
# Run the bot if not
@@ -54,10 +56,12 @@ async def join_server(system_id, guild_id, channel_id):
# Update status
client_status = StatusValues.LISTENING
op25_status = await drb_api.get_op25_status()
print("OP25 status:", op25_status)
# Check if OP25 is stopped, if so set the selected channel, otherwise
if op25_status == "stopped":
chn_details = await srv_api.get_channel_details(channel_id)
print("Channel details", chn_details)
if not chn_details:
# TODO - handle not having channel details
pass
@@ -81,6 +85,7 @@ async def join_server(system_id, guild_id, channel_id):
async def leave_server(guild_id):
# Takes guild ID
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']: