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; }