diff --git a/commands/clearchatqueue.js b/commands/clearchatqueue.js index e6a1ea2..5a47f48 100644 --- a/commands/clearchatqueue.js +++ b/commands/clearchatqueue.js @@ -5,13 +5,15 @@ module.exports = { usage: '', trusted: 0, execute (bot) { - if (bot.queue[0]) { + if (bot._chatQueue[0]) { bot.chatQueue = [] + bot._chatQueue = [] } }, discordExecute (bot) { - if (bot.queue[0]) { + if (bot._chatQueue[0]) { bot.chatQueue = [] + bot._chatQueue = [] } } } diff --git a/plugins/chat.js b/plugins/chat.js index 7d0b9d1..2956a6d 100644 --- a/plugins/chat.js +++ b/plugins/chat.js @@ -6,7 +6,7 @@ const { chatPacketListener, parsePlayerMessages } = require('../util/chat') function inject (bot, dcclient, config) { bot.chatQueue = [] - const _chatQueue = [] + bot._chatQueue = [] const _chatQueueInterval = setInterval(() => { if (bot.chatQueue.length !== 0) { @@ -20,7 +20,7 @@ function inject (bot, dcclient, config) { let smallMsg for (let i = 0; i < subMessage.length; i += config.chat.messageLength) { smallMsg = subMessage.substring(i, i + config.chat.messageLength) - _chatQueue.push(smallMsg) + bot._chatQueue.push(smallMsg) } }) bot.chatQueue.shift() @@ -28,9 +28,9 @@ function inject (bot, dcclient, config) { }, 0) const chatQueueInterval = setInterval(function () { - if (_chatQueue.length !== 0) { - bot.write('chat', { message: _chatQueue[0] }) - _chatQueue.shift() + if (bot._chatQueue.length !== 0) { + bot.write('chat', { message: bot._chatQueue[0] }) + bot._chatQueue.shift() } }, 450)