diff --git a/index.js b/index.js index eedc70c..391819b 100644 --- a/index.js +++ b/index.js @@ -206,7 +206,7 @@ function main() { discordQueue = setInterval(function() { if (dcmsg.queue!='') { - channel.send(dcmsg.queue.substring(0, 1998)); + channel.send(dcmsg.queue.substring(0, 1997) + '\u200b'); dcmsg.queue = ''; } }, 1000); @@ -292,13 +292,14 @@ function main() { }); bot.on('parsed_chat', async function(message, data) { + // try catch prevents hi % exploit (it uses prismarine-chat) and json parse error try { if (previusMessage===message.toString()) return; previusMessage = message.toString(); - // prevents command set message and hi % exploit (it uses prismarine-chat) const parsedMessage = JSON.parse(data.message); if (parsedMessage.translate==='translation.test.invalid') return; + // down here it prevents command set message if (parsedMessage.translate==='advMode.setCommand.success') return; if (parsedMessage.extra!==undefined) { if (parsedMessage.extra[0].text==='Command set: ') return;