diff options
author | Neel Kamath <neelkamath@protonmail.com> | 2018-05-13 12:39:55 +0200 |
---|---|---|
committer | Neel Kamath <neelkamath@protonmail.com> | 2018-05-13 12:39:55 +0200 |
commit | 2bb5ced363b692a5696b176bc317fe525c0c05df (patch) | |
tree | 1532d9456c5f2b25ac05f7cec620a3af890eff83 /server/src/commands/mod/unban.js | |
parent | Re-add module documentation (diff) | |
download | hackchat-2bb5ced363b692a5696b176bc317fe525c0c05df.tar.gz hackchat-2bb5ced363b692a5696b176bc317fe525c0c05df.zip |
Flatten
Diffstat (limited to 'server/src/commands/mod/unban.js')
-rw-r--r-- | server/src/commands/mod/unban.js | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/server/src/commands/mod/unban.js b/server/src/commands/mod/unban.js deleted file mode 100644 index e82f0b9..0000000 --- a/server/src/commands/mod/unban.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - Description: Removes a target ip from the ratelimiter -*/ - -exports.run = async (core, server, socket, data) => { - if (socket.uType == 'user') { - // ignore if not mod or admin - return; - } - - if (typeof data.ip !== 'string' && typeof data.hash !== 'string') { - server.reply({ - cmd: 'warn', - text: "hash:'targethash' or ip:'1.2.3.4' is required" - }, socket); - - return; - } - - let mode, target; - - if (typeof data.ip === 'string') { - mode = 'ip'; - target = data.ip; - } else { - mode = 'hash'; - target = data.hash; - } - - server._police.pardon(target); - - if (mode === 'ip') { - target = server.getSocketHash(target); - } - - console.log(`${socket.nick} [${socket.trip}] unbanned ${target} in ${socket.channel}`); - - server.reply({ - cmd: 'info', - text: `Unbanned ${target}` - }, socket); - - server.broadcast({ - cmd: 'info', - text: `${socket.nick} unbanned: ${target}` - }, { uType: 'mod' }); - - core.managers.stats.decrement('users-banned'); -}; - -exports.info = { - name: 'unban', - usage: 'unban {[ip || hash]}', - description: 'Removes target ip from the ratelimiter' -};
\ No newline at end of file |