Attempt to fix the spam issue

This commit is contained in:
Chipmunk 2024-09-04 11:58:56 -04:00
parent 93d711378d
commit 098afc9718

View file

@ -1,7 +1,9 @@
const util = require('util')
const COMMANDSPY_ENABLED_MESSAGE = { extra: [ 'Successfully ', 'enabled', ' CommandSpy' ], text: '' }
const COMMANDSPY_DISABLED_MESSAGE = { extra: [ 'Successfully ', 'disabled', ' CommandSpy' ], text: '' }
const COMMANDSPY_ENABLED_MESSAGE = { text: 'Successfully enabled CommandSpy' }
const COMMANDSPY_DISABLED_MESSAGE = { text: 'Successfully disabled CommandSpy' }
const COMMANDSPY_ENABLED_MESSAGE_2 = { extra: [ 'Successfully ', 'enabled', ' CommandSpy' ], text: '' }
const COMMANDSPY_DISABLED_MESSAGE_2 = { extra: [ 'Successfully ', 'disabled', ' CommandSpy' ], text: '' }
function inject (bot) {
let permissionLevel, gamemode, commandSpyEnabled, vanished, godEnabled
@ -26,8 +28,8 @@ function inject (bot) {
})
bot.on('system_chat', (message) => {
if (util.isDeepStrictEqual(message, COMMANDSPY_ENABLED_MESSAGE)) commandSpyEnabled = true
else if (util.isDeepStrictEqual(message, COMMANDSPY_DISABLED_MESSAGE)) commandSpyEnabled = false
if (util.isDeepStrictEquals(message, COMMANDSPY_ENABLED_MESSAGE) || util.isDeepStrictEqual(message, COMMANDSPY_ENABLED_MESSAGE_2)) commandSpyEnabled = true
else if (util.isDeepStrictEquals(message, COMMANDSPY_DISABLED_MESSAGE) || util.isDeepStrictEqual(message, COMMANDSPY_DISABLED_MESSAGE_2)) commandSpyEnabled = false
})
bot.on('player_added', (player) => {