diff options
author | marzavec <admin@marzavec.com> | 2018-03-10 08:47:00 +0100 |
---|---|---|
committer | marzavec <admin@marzavec.com> | 2018-03-10 08:47:00 +0100 |
commit | fde6895720a4f417283b9e375583967b504de2f3 (patch) | |
tree | f5c8d9a188572d759456831d574bef9881d5c0be /server/src/commands/core/help.js | |
download | hackchat-fde6895720a4f417283b9e375583967b504de2f3.tar.gz hackchat-fde6895720a4f417283b9e375583967b504de2f3.zip |
initial commit
Diffstat (limited to '')
-rw-r--r-- | server/src/commands/core/help.js | 33 |
1 files changed, 33 insertions, 0 deletions
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' +}; |