aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/mod/unbanall.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands/mod/unbanall.js')
-rw-r--r--server/src/commands/mod/unbanall.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/server/src/commands/mod/unbanall.js b/server/src/commands/mod/unbanall.js
index c285b80..49eeee5 100644
--- a/server/src/commands/mod/unbanall.js
+++ b/server/src/commands/mod/unbanall.js
@@ -3,34 +3,35 @@
*/
// module main
-exports.run = async (core, server, socket, data) => {
+export async function run(core, server, socket) {
// increase rate limit chance and ignore if not admin or mod
if (socket.uType === 'user') {
- return server.police.frisk(socket.remoteAddress, 10);
+ return server.police.frisk(socket.address, 10);
}
// remove arrest records
- server.police.records = {};
+ server.police.clear();
console.log(`${socket.nick} [${socket.trip}] unbanned all`);
// reply with success
server.reply({
cmd: 'info',
- text: `Unbanned all ip addresses`
+ text: 'Unbanned all ip addresses',
}, socket);
// notify mods
server.broadcast({
cmd: 'info',
- text: `${socket.nick} unbanned all ip addresses`
+ text: `${socket.nick} unbanned all ip addresses`,
}, { uType: 'mod' });
-};
-// module meta
-exports.info = {
+ return true;
+}
+
+export const info = {
name: 'unbanall',
description: 'Clears all banned ip addresses',
usage: `
- API: { cmd: 'unbanall' }`
+ API: { cmd: 'unbanall' }`,
};