18 lines
641 B
JavaScript
18 lines
641 B
JavaScript
module.exports = {
|
|
command:"banip",
|
|
description: "Ban an IP Address from your service",
|
|
syntax: "{PREFIX}banip [IP_ADDRESS]",
|
|
execute:async (_this, msg, args) => {
|
|
if (!args.join(" ")) return msg.channel.createMessage("No arguments were given")
|
|
let ipAddress = args.join(" ")
|
|
let exists = _this.db.get("bans").find({ip: ipAddress}).value();
|
|
if(exists === undefined) {
|
|
msg.channel.createMessage(`Banning IP \`${ipAddress}\`...`)
|
|
_this.db.get("bans")
|
|
.push({ip: ipAddress})
|
|
.write();
|
|
} else {
|
|
msg.channel.createMessage("This IP Address is already banned")
|
|
}
|
|
}
|
|
} |