From 1d80e28aac0da59efc73fc29d3fb3925f893c29d Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 24 Feb 2018 11:56:04 -0500 Subject: Warn --- commands/warn.js | 55 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) (limited to 'commands/warn.js') diff --git a/commands/warn.js b/commands/warn.js index 0e9e966..9fc2272 100644 --- a/commands/warn.js +++ b/commands/warn.js @@ -1,30 +1,31 @@ exports.run = (bot, msg, args) => { - if (!message.member.permissions.has("MANAGE_MESSAGES")) return message.channel.send(':warning: You cannot warn members due to your permission level.'); - let warnReason = args.slice(1); - var victim = message.mentions.users.first(); + if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permssion to warn.'); + const warnReason = args.slice(1); + const victim = msg.mentions.users.first(); - message.channel.send(`Successfully logged ${victim.user.tag}'s warning.`) + msg.channel.send(`Successfully logged ${victim.user.tag}'s warning.`); - bot.channels.find('name', 'logs').send( - new Discord.RichEmbed() - .setColor(0x00ae86) - .setTitle('Warning') - .addField('ID', victim.id, true) - .addField('Created Account', victim.user.createdAt, true) - .addField('Warning Reason', warnReason) - .setTimestamp() - .setFooter('Warned by: ' + message.author.user.tag, message.author.user.avatarURL) - ); - }; - - exports.conf = { - aliases: [], - guildOnly: true, - }; - - exports.help = { - name: 'warn', - description: 'Logs a warning to the user.', - category: 'Moderation', - }; - \ No newline at end of file + const { RichEmbed } = require('discord.js'); + bot.channels.find('name', 'logs').send( + new RichEmbed() + .setColor(0x00ae86) + .setTitle('Warning') + .addField('ID', victim.id, true) + .addField('Created Account', victim.user.createdAt, true) + .addField('Warning Reason', warnReason) + .setTimestamp() + .setFooter('Warned by: ' + msg.author.user.tag, msg.author.user.avatarURL) + ); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'warn', + description: 'Logs a warning to the user.', + usage : '@ ', + category: 'Moderation', +}; -- cgit v1.2.3