diff --git a/util/chat.js b/util/chat.js index f9d84ce..5dfbd2a 100644 --- a/util/chat.js +++ b/util/chat.js @@ -6,13 +6,9 @@ * @param {object} bot bot */ function chatPacketListener (packet, ChatMessage, bot) { - // try catch prevents hi % exploit (it uses prismarine-chat) - // and try catch also prevents json parse error + // try catch prevents json parse error (which prob never happens but still..) try { const parsedMessage = JSON.parse(packet.message) - if (parsedMessage.translate === 'translation.test.invalid' || - parsedMessage.translate === 'translation.test.invalid2') return - // down here it prevents command set message // for ayunboom cuz its 1.17.1 @@ -27,9 +23,7 @@ function chatPacketListener (packet, ChatMessage, bot) { const message = ChatMessage.fromNotch(packet.message) bot.emit('parsed_chat', message, packet) - } catch (e) { - - } + } catch (e) {} }; /** @@ -40,11 +34,7 @@ function chatPacketListener (packet, ChatMessage, bot) { */ function parsePlayerMessages (message, packet, bot) { try { - // prevent braille cuz it CRASHES THE ENTIRE LAPTOP - // but sometimes this may not work - if (message.toString().includes('⣿')) return - - // then here is all the player message parsing thing + // here is all the player message parsing thing const raw = message.toMotd().substring(0, 32767) if (raw.match(/.* .*: .*/g)) { const username = raw.replace(/.*?\[.*?\] /g, '').replace(/:.*/g, '').replace(/§#....../gm, '')