This commit is contained in:
Daniel Odendahl Jr
2017-04-30 22:56:59 +00:00
parent 83e990ae1c
commit 877f720cfc
105 changed files with 460 additions and 461 deletions
+12 -12
View File
@@ -38,30 +38,30 @@ module.exports = class UnbanCommand extends Command {
return msg.member.permissions.has('BAN_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff'));
}
async run(message, args) {
if (!message.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
return message.say('This Command requires the `Ban Members` Permission.');
const modlogs = message.guild.channels.find('name', message.guild.settings.get('modLog', 'mod_logs'));
async run(msg, args) {
if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
return msg.say('This Command requires the `Ban Members` Permission.');
const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs'));
if (!modlogs)
return message.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return message.say('This Command requires the `Embed Links` Permission.');
return msg.say('This Command requires the `Embed Links` Permission.');
const { id, reason } = args;
const bans = await message.guild.fetchBans();
const bans = await msg.guild.fetchBans();
if (!bans.has(id))
return message.say('This ID is not in the Guild Banlist.');
return msg.say('This ID is not in the Guild Banlist.');
const member = bans.get(id);
try {
await message.guild.unban(member);
await message.say(':ok_hand:');
await msg.guild.unban(member);
await msg.say(':ok_hand:');
const embed = new RichEmbed()
.setAuthor(message.author.tag, message.author.displayAvatarURL)
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
.setColor(0x00AE86)
.setTimestamp()
.setDescription(`**Member:** ${member.tag} (${member.id})\n**Action:** Unban\n**Reason:** ${reason}`);
return modlogs.send({embed});
} catch (err) {
return message.say('An Unknown Error Occurred.');
return msg.say('An Unknown Error Occurred.');
}
}
};