Add config option to enable/disable command parsing. Useful for presence/ingamechat bot instances.

This commit is contained in:
Junior 2024-11-23 15:40:42 +00:00
parent 3a6a190404
commit 9a33539e16
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -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 = "";