Create unban.js

This commit is contained in:
Carol Knieriem 2020-02-04 10:00:29 -05:00
parent 4677b40686
commit fcbd144a1d
No known key found for this signature in database
GPG key ID: 932EC6A6BAEE122B

View file

@ -0,0 +1,25 @@
exports.run = async (client, message, args, level) => {
const reason = args.slice(1).join(' ');
client.unbanReason = reason;
client.unbanAuth = message.author;
const user = args[0];
const modlog = client.channels.find('name', config.modLogChannel);
if (!modlog) return message.reply('I could not find a valid modlog channel.');
if (reason.length < 1) return message.reply('You must supply a reason for the unban.');
if (!user) return message.reply('You must supply a User Resolvable, such as a user id.').catch(console.error);
message.guild.unban(user);
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "Administrator"
};
exports.help = {
name: "unban",
category: "Moderation",
description: "Unbans a specified user.",
usage: "unban <user> <reason>"
};