diff options
| author | Unknown <jtsshieh@outlook.com> | 2018-02-24 11:56:04 -0500 |
|---|---|---|
| committer | Unknown <jtsshieh@outlook.com> | 2018-02-24 11:56:04 -0500 |
| commit | 1d80e28aac0da59efc73fc29d3fb3925f893c29d (patch) | |
| tree | 3b6ac75c3bca2df0b854a3528a683209fb01defa /commands/warn.js | |
| parent | 83bfe82d30e67c19a1934848570886d07992189d (diff) | |
| download | PokeBot-1d80e28aac0da59efc73fc29d3fb3925f893c29d.tar.gz PokeBot-1d80e28aac0da59efc73fc29d3fb3925f893c29d.tar.bz2 PokeBot-1d80e28aac0da59efc73fc29d3fb3925f893c29d.zip | |
Warn
Diffstat (limited to 'commands/warn.js')
| -rw-r--r-- | commands/warn.js | 55 |
1 files changed, 28 insertions, 27 deletions
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 : '@<user> <reason>', + category: 'Moderation', +}; |
