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) => {