mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 09:35:35 -05:00
add comments and add zwsp to discord
(to prevent error)
This commit is contained in:
parent
21a93ef844
commit
95efcda2c3
1 changed files with 3 additions and 2 deletions
5
index.js
5
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;
|
||||
|
|
Loading…
Reference in a new issue