This repository has been archived on 2024-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
ShareX-Upload-Server/bot/commands/unbanIP.js
2021-08-18 00:12:37 -07:00

19 lines
726 B
JavaScript

module.exports = {
command: 'unbanip',
description: 'Unban an IP Address from your service',
syntax: '{PREFIX}unbanip [IP_ADDRESS]',
execute: async (_this, msg, args) => {
if (!args.join(' ')) return msg.channel.createMessage('No arguments were given');
const ipAddress = args.join(' ');
const exists = _this.db.get('bans').find({ ip: ipAddress }).value();
if (exists === undefined) {
msg.channel.createMessage('This IP Address is not banned');
} else {
msg.channel.createMessage(`Removing ban for IP \`${ipAddress}\`...`);
_this.db.get('bans')
.remove({ ip: ipAddress })
.write();
}
},
};