diff options
| author | Justin <jtsshieh@outlook.com> | 2019-11-02 11:02:19 -0400 |
|---|---|---|
| committer | Justin <jtsshieh@outlook.com> | 2019-11-02 11:02:19 -0400 |
| commit | 7031fa12ba79281edc49df972311c13ad0e8fa53 (patch) | |
| tree | 60410a33fe45add85a9dc962c975be478f3f8cff /commands/Moderation/warn.js | |
| parent | 106530d5dc53166632a6a0ecc8930eb2b1ed4bfd (diff) | |
| download | PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.tar.gz PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.tar.bz2 PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.zip | |
es-lint settings added + linted all files
Diffstat (limited to 'commands/Moderation/warn.js')
| -rw-r--r-- | commands/Moderation/warn.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index b8548a3..5dcd5ef 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -21,13 +21,12 @@ exports.run = async (bot, msg, args) => { if (warns) { const reasons = warns.reasons; reasons.push(warnReason); - await db.set(`warns_${msg.guild.id}_${victim.user.id}`, { count : warns.count + 1, reasons : reasons }); - } - else { - await db.set(`warns_${msg.guild.id}_${victim.user.id}`, { count : 1, reasons : [warnReason]}); + await db.set(`warns_${msg.guild.id}_${victim.user.id}`, {count : warns.count + 1, reasons : reasons}); + } else { + await db.set(`warns_${msg.guild.id}_${victim.user.id}`, {count : 1, reasons : [warnReason]}); } - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); const logChannel = await bot.plugins.settings.getStr('logs', msg.guild.id); bot.channels.find('id', logChannel).send( new RichEmbed() @@ -38,22 +37,24 @@ exports.run = async (bot, msg, args) => { .addField('ID', victim.id, true) .addField('Created Account', victim.user.createdAt, true) .setTimestamp() - .setFooter('Warned by: ' + msg.author.tag, msg.author.avatarURL) + .setFooter(`Warned by: ${msg.author.tag}`, msg.author.avatarURL) ); }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to warn.'; + if (!member.hasPermission('MANAGE_MESSAGES')) { + return 'You don\'t have permission to warn.'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'warn', description: 'Logs a warning to the user.', - usage : '@user <reason>', + usage : '@user <reason>' }; |
