From ea53f5da3d10bf1c0adbe061c731d8ebc1c4da35 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 25 May 2025 21:56:26 -0400 Subject: [PATCH] Update command reply --- app/client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/client.py b/app/client.py index d68bf50..f76cc88 100644 --- a/app/client.py +++ b/app/client.py @@ -135,7 +135,10 @@ async def leave_server(guild_id): @command async def get_status(websocket, request_id): # Return the status object - await websocket.send({"type":"response", "request_id": request_id, "status": client_status}) + response_payload = {"status": client_status} # It's good practice to wrap the actual data in a 'payload' key + + # Corrected line: Convert the dictionary to a JSON string before sending + await websocket.send(json.dumps({"type":"response", "request_id": request_id, "payload": response_payload})) @command async def run_task(websocket, task_id, duration_seconds): @@ -168,7 +171,7 @@ async def receive_commands(websocket): else: print(f"Received unknown command: {command_name}") elif data.get("type") == "handshake_ack": - print(f"Server acknowledged handshake.") + print(f"Server acknowledged handshake.") else: print(f"Received unknown message type: {data.get('type')}")