Added new node route to get online bots

This commit is contained in:
Logan Cusano
2025-05-24 23:24:18 -04:00
parent fbd0e65019
commit 4a61bd195f

View File

@@ -112,4 +112,13 @@ async def leave():
return jsonify({"status": "command sent", "client_id": client_id, "command": NodeCommands.LEAVE}), 200
except Exception as e:
return jsonify({"error": f"Failed to send command: {e}"}), 500
return jsonify({"error": f"Failed to send command: {e}"}), 500
@nodes_bp.route("/get_online_bots", methods=['GET'])
async def get_online_bots():
active_bots = []
for client in current_app.active_clients:
active_bots.append(client.active_token.to_dict())
return jsonify(active_bots)