From fde6895720a4f417283b9e375583967b504de2f3 Mon Sep 17 00:00:00 2001 From: marzavec Date: Fri, 9 Mar 2018 23:47:00 -0800 Subject: initial commit --- server/src/commands/core/help.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 server/src/commands/core/help.js (limited to 'server/src/commands/core/help.js') diff --git a/server/src/commands/core/help.js b/server/src/commands/core/help.js new file mode 100644 index 0000000..17478d0 --- /dev/null +++ b/server/src/commands/core/help.js @@ -0,0 +1,33 @@ +/* + +*/ + +'use strict'; + +exports.run = async (core, server, socket, data) => { + let reply = `Help usage: { cmd: 'help', type: 'categories'} or { cmd: 'help', type: 'commandname'}`; + + if (typeof data.type === 'undefined') { + // + } else { + if (data.type == 'categories') { + let categories = core.commands.categories(); + // TODO: bad output, fix this + reply = `Command Categories:\n${categories}`; + } else { + // TODO: finish this module later + } + } + + server.reply({ + cmd: 'info', + text: reply + }, socket); +}; + +// optional parameters are marked, all others are required +exports.info = { + name: 'help', // actual command name + usage: 'help ([type:categories] | [type:command])', + description: 'Outputs information about the servers current protocol' +}; -- cgit v1.2.1