diff --git a/util/karma.js b/util/karma.js index f0d4616..8df10aa 100644 --- a/util/karma.js +++ b/util/karma.js @@ -1,4 +1,4 @@ -const client = require('../index').client; +const { client, logger } = require('../index'); const Enmap = require('enmap'); // Stores the karma and coins of users @@ -75,7 +75,11 @@ module.exports.run = () => { 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 (!perms.has('SEND_MESSAGES') || !perms.has('ADD_REACTIONS')) { + logger.warn(`${user.tag} => Ignoring reaction in ${message.channel}: User is missing permission`); + reaction.users.remove(user.id); + return; + } if (coins.get(user.id) < award.cost) { if (noTimeout) message.channel.send(`${user}, you don't have sufficient coins to use this award.`);