This commit is contained in:
Jan 2020-12-23 14:08:41 +01:00
parent c953f74e30
commit a9e18d9750

View file

@ -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.`);