Add config option to enable/disable command parsing. Useful for presence/ingamechat bot instances.
This commit is contained in:
		
							parent
							
								
									3a6a190404
								
							
						
					
					
						commit
						9a33539e16
					
				| 
						 | 
					@ -7,7 +7,7 @@ const config = {
 | 
				
			||||||
   RESTART_ROLE: '123456789012345678',
 | 
					   RESTART_ROLE: '123456789012345678',
 | 
				
			||||||
   ALLOW_RESTART: false,
 | 
					   ALLOW_RESTART: false,
 | 
				
			||||||
   PRESENCE_INTERVAL: 5,
 | 
					   PRESENCE_INTERVAL: 5,
 | 
				
			||||||
   ONLINE_CHECK: false
 | 
					   ALLOW_COMMANDS: false,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module.exports = config;
 | 
					module.exports = config;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								index.js
									
									
									
									
									
								
							| 
						 | 
					@ -84,6 +84,7 @@ function getOnlineReport(channel = null) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
client.on('messageCreate', (msg) => {
 | 
					client.on('messageCreate', (msg) => {
 | 
				
			||||||
    if ( msg.author.id === client.user.id ) return;
 | 
					    if ( msg.author.id === client.user.id ) return;
 | 
				
			||||||
 | 
					    if ( Config.ALLOW_COMMANDS == false ) return;
 | 
				
			||||||
    if ( msg.content.startsWith(">>paddle") ) {
 | 
					    if ( msg.content.startsWith(">>paddle") ) {
 | 
				
			||||||
        if ( msg.member.roles.cache.has(Config.MOD_ROLE) || msg.member.roles.cache.has(Config.STAFF_ROLE) ) {
 | 
					        if ( msg.member.roles.cache.has(Config.MOD_ROLE) || msg.member.roles.cache.has(Config.STAFF_ROLE) ) {
 | 
				
			||||||
            let response = "";
 | 
					            let response = "";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user