aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/mod/kick.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands/mod/kick.js')
-rw-r--r--server/src/commands/mod/kick.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/server/src/commands/mod/kick.js b/server/src/commands/mod/kick.js
index 75c0d40..0e8ee0a 100644
--- a/server/src/commands/mod/kick.js
+++ b/server/src/commands/mod/kick.js
@@ -2,12 +2,11 @@
Description: Forces a change on the target(s) socket's channel, then broadcasts event
*/
+// module main
exports.run = async (core, server, socket, data) => {
// increase rate limit chance and ignore if not admin or mod
- if (socket.uType == 'user') {
- server._police.frisk(socket.remoteAddress, 10);
-
- return;
+ if (socket.uType === 'user') {
+ return server._police.frisk(socket.remoteAddress, 10);
}
// check user input
@@ -21,12 +20,10 @@ exports.run = async (core, server, socket, data) => {
let badClients = server.findSockets({ channel: socket.channel, nick: data.nick });
if (badClients.length === 0) {
- server.reply({
+ return server.reply({
cmd: 'warn',
text: 'Could not find user(s) in channel'
}, socket);
-
- return;
}
// check if found targets are kickable, commit kick
@@ -75,10 +72,11 @@ exports.run = async (core, server, socket, data) => {
core.managers.stats.increment('users-kicked', kicked.length);
};
+// module meta
exports.requiredData = ['nick'];
-
exports.info = {
name: 'kick',
- usage: 'kick {nick}',
- description: 'Silently forces target client(s) into another channel. `nick` may be string or array of strings'
+ description: 'Silently forces target client(s) into another channel. `nick` may be string or array of strings',
+ usage: `
+ API: { cmd: 'kick', nick: '<target nick>' }`
};