Added new node route to get online bots
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user