add code
This commit is contained in:
		
							parent
							
								
									c953f74e30
								
							
						
					
					
						commit
						a9e18d9750
					
				| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
const client = require('../index').client;
 | 
					const { client, logger } = require('../index');
 | 
				
			||||||
const Enmap = require('enmap');
 | 
					const Enmap = require('enmap');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Stores the karma and coins of users
 | 
					// 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 noTimeout = (timeouts[user.id] && timeouts[user.id] < Date.now());
 | 
				
			||||||
            let perms = message.channel.permissionsFor(user.id);
 | 
					            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 (coins.get(user.id) < award.cost) {
 | 
				
			||||||
                if (noTimeout) 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.`);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue