From c719020e17cb1c98da55be6cc7efe0e50ab51ffa Mon Sep 17 00:00:00 2001 From: marzavec Date: Sat, 29 Sep 2018 23:44:36 -0700 Subject: Added hooks, modules and cleaned up code --- server/src/commands/core/move.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server/src/commands/core/move.js') diff --git a/server/src/commands/core/move.js b/server/src/commands/core/move.js index 284a38d..e85f481 100644 --- a/server/src/commands/core/move.js +++ b/server/src/commands/core/move.js @@ -2,15 +2,14 @@ Description: Changes the current channel of the calling socket */ +// module main exports.run = async (core, server, socket, data) => { // check for spam if (server._police.frisk(socket.remoteAddress, 6)) { - server.reply({ + return server.reply({ cmd: 'warn', text: 'You are changing channels too fast. Wait a moment before trying again.' }, socket); - - return; } // check user input @@ -81,10 +80,11 @@ exports.run = async (core, server, socket, data) => { socket.channel = data.channel; }; +// module meta exports.requiredData = ['channel']; - exports.info = { name: 'move', - usage: 'move {channel}', - description: 'This will change the current channel to the new one provided' + description: 'This will change your current channel to the new one provided', + usage: ` + API: { cmd: 'move', channel: '' }` }; -- cgit v1.2.1