From 098afc97183086aa1d0b634d3ea86595b93b094d Mon Sep 17 00:00:00 2001 From: Chipmunk <65827213+ChipmunkMC@users.noreply.github.com> Date: Wed, 4 Sep 2024 11:58:56 -0400 Subject: [PATCH] Attempt to fix the spam issue --- plugins/self_care.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/self_care.js b/plugins/self_care.js index c194c2a..1225672 100644 --- a/plugins/self_care.js +++ b/plugins/self_care.js @@ -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) => {