From c953f74e3000eb0c3963c73f689f37112d8b38cb Mon Sep 17 00:00:00 2001 From: Jan <26145882+imverum@users.noreply.github.com> Date: Wed, 23 Dec 2020 14:03:07 +0100 Subject: [PATCH] r --- util/karma.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/karma.js b/util/karma.js index 5fc1265..f0d4616 100644 --- a/util/karma.js +++ b/util/karma.js @@ -73,18 +73,19 @@ module.exports.run = () => { } else if (awards[reaction.emoji.id]) { let award = awards[reaction.emoji.id]; + let noTimeout = (timeouts[user.id] && timeouts[user.id] < Date.now()); let perms = message.channel.permissionsFor(user.id); if (!perms.has('SEND_MESSAGES') || !perms.has('ADD_REACTIONS')) return reaction.users.remove(user.id); if (coins.get(user.id) < award.cost) { - if (timeouts[user.id] < Date.now()) message.channel.send(`${user}, you don't have sufficient coins to use this award.`); + if (noTimeout) message.channel.send(`${user}, you don't have sufficient coins to use this award.`); reaction.users.remove(user.id); timeouts[user.id] = Date.now() + 5000; return; } if (message.author.id == user.id) { reaction.users.remove(user.id); - if (timeouts[user.id] < Date.now()) message.channel.send(`${user}, why would you give an award to yourself? smh my head`); + if (noTimeout) message.channel.send(`${user}, why would you give an award to yourself? smh my head`); timeouts[user.id] = Date.now() + 5000; return; }