Update ban.js

This commit is contained in:
carol 2020-02-04 11:15:16 -05:00 committed by GitHub
parent 4edb15af8f
commit d34c9f4f4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,19 +1,21 @@
exports.run = async (client, message, args, level) => { exports.run = async (client, message, args, level) => {
const user = message.mentions.users.first() || client.users.get("username", args[0]).id; const user = message.mentions.users.first() || client.users.get("username", args[0]).id;
parseUser(message, user); parseUser(message, user);
const modlog = client.channels.find('name', config.modLogChannel);
const caseNum = await caseNumber(client, modlog);
if (!modlog) return message.reply('I cannot find a valid modlog channel.');
if (message.mentions.users.size < 1) return message.reply('You must mention someone to ban them.').catch(console.error);
// message.guild.ban(user, 2);
const reason = args.splice(1, args.length).join(' ') || `Awaiting moderator's input. Use ${settings.prefix}reason ${caseNum} <reason>.`; const modlog = client.channels.find('name', config.modLogChannel);
const embed = new RichEmbed() const caseNum = await caseNumber(client, modlog);
.setColor(0x00AE86)
.setTimestamp() if (!modlog) return message.reply('I cannot find a valid modlog channel.');
.setDescription(`**Action:** Ban\n**Target:** ${user.tag}\n**Moderator:** ${message.author.tag}\n**Reason:** ${reason}`) if (message.mentions.users.size < 1) return message.reply('You must mention someone to ban them.').catch(console.error);
.setFooter(`Case ${caseNum}`); // message.guild.ban(user, 2);
return client.channels.get(modlog.id).send({embed});
const reason = args.splice(1, args.length).join(' ') || `Awaiting moderator's input. Use ${settings.prefix}reason ${caseNum} <reason>.`;
const embed = new RichEmbed()
.setColor(0x00AE86)
.setTimestamp()
.setDescription(`**Action:** Ban\n**Target:** ${user.tag}\n**Moderator:** ${message.author.tag}\n**Reason:** ${reason}`)
.setFooter(`Case ${caseNum}`);
return client.channels.get(modlog.id).send({embed});
}; };
exports.conf = { exports.conf = {