From 8c67f0c40c8a05f091e777cad62ab0cbb127de29 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 18 Feb 2019 15:33:15 -0500 Subject: [PATCH] Update Fix warnings maybe.. --- plugins/moderation/warn.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/moderation/warn.js b/plugins/moderation/warn.js index 5fd853f..374e15f 100644 --- a/plugins/moderation/warn.js +++ b/plugins/moderation/warn.js @@ -36,14 +36,17 @@ commands.register(this.command, '([^s]+) (.*)', 'warn <@user> ', 'Warn a msg.channel.send(`Warned {${extra[1]}} for {${extra[2]}}`); return warnedUser.send(`You have been warned for {${extra[2]}}`); }); + } else { + UserWarning.create({ user, warning, warner }, (warningError) => { + if (warningError) throw warningError; + msg.channel.send(`Warned {${extra[1]}} for {${extra[2]}}`); + return warnedUser.send(`You have been warned for {${extra[2]}}`); + }); } - UserWarning.create({ user, warning, warner }, (warningError) => { - if (warningError) throw warningError; - msg.channel.send(`Warned {${extra[1]}} for {${extra[2]}}`); - return warnedUser.send(`You have been warned for {${extra[2]}}`); - }); + } else { + return msg.reply('Cannot warn, error?'); } - return msg.channel.send('Cannot warn, error?'); + return false; }); commands.register(this.command, 'list (.*)', 'warn list <@user>', 'List a users warnings', async (msg) => {