Create ban.js

This commit is contained in:
carol 2020-02-04 11:12:23 -05:00 committed by GitHub
parent cccdc5f07f
commit b5453e9563
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,31 @@
exports.run = async (client, message, args, level) => {
const user = message.mentions.users.first();
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 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 = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User"
};
exports.help = {
name: "ban",
category: "Moderation",
description: "You've been hit by Banny Billy!",
usage: "ban <user> <reason>"
};