Create warn.js
This commit is contained in:
parent
577b34b801
commit
4677b40686
1 changed files with 30 additions and 0 deletions
30
commands/Moderation/warn.js
Normal file
30
commands/Moderation/warn.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
exports.run = async (client, message, args, level) => {
|
||||
const user = message.mentions.users.first();
|
||||
parseUser(message, user);
|
||||
const modlog = client.channels.find('name', 'mod-log');
|
||||
const caseNum = await caseNumber(client, modlog);
|
||||
if (!modlog) return message.reply('I cannot find a modlog channel');
|
||||
if (message.mentions.users.size < 1) return message.reply('You must mention someone to warn them.').catch(console.error);
|
||||
|
||||
const reason = args.splice(1, args.length).join(' ') || `Awaiting moderator's input. Use ${message.settings.prefix}reason ${caseNum} <reason>.`;
|
||||
const embed = new RichEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Action:** Warning\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: ["w","citation"],
|
||||
permLevel: "Moderator"
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: "warn",
|
||||
category: "Moderation",
|
||||
description: "Issues a citation to a specified user.",
|
||||
usage: "warn <user> <reason>"
|
||||
};
|
Loading…
Reference in a new issue