noice fixed

This commit is contained in:
ChomeNS 2022-08-20 15:49:57 +07:00
parent 24b1916e06
commit 2034047469
2 changed files with 3 additions and 2 deletions

View file

@ -18,6 +18,7 @@ function inject(bot) {
bot.on('parsed_chat', (message, packet) => { bot.on('parsed_chat', (message, packet) => {
try { try {
const raw = message.toMotd().substring(0, 32767); const raw = message.toMotd().substring(0, 32767);
console.log(raw)
if (raw.match(/.* .*§r: §.*/g)) { if (raw.match(/.* .*§r: §.*/g)) {
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return; // if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
const username = raw.replace(/.*?\[.*?\] /, '').replace(/:.*/g, '').replace(/§#....../gm, ''); const username = raw.replace(/.*?\[.*?\] /, '').replace(/:.*/g, '').replace(/§#....../gm, '');
@ -32,7 +33,7 @@ function inject(bot) {
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return; // if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
const username = raw.substr(3).split('§r>')[0]; const username = raw.substr(3).split('§r>')[0];
const message = raw.split('§r> §r')[1]; const message = raw.split('§r> ')[1];
bot.emit('message', username, message, packet.sender); bot.emit('message', username, message, packet.sender);
} else if (raw.match(/<.*> .*/g)) { } else if (raw.match(/<.*> .*/g)) {

View file

@ -13,7 +13,7 @@ function inject(bot) {
if (!bot.visibility) { if (!bot.visibility) {
if (data.toString().startsWith('Vanish for ') && data.toString().endsWith('disabled')) vanish = false; if (data.toString().startsWith('Vanish for ') && data.toString().endsWith('disabled')) vanish = false;
} }
if (data.toString()==='Successfully enabled CommandSpy' || data.toString()===' Enabled your command spy.') cspy = true; if (data.toString()==='Successfully enabled CommandSpy' || data.toString()===' Enabled your command spy.' || data.toString()===' Your command spy is already enabled.') cspy = true;
if (data.toString()==='Successfully disabled CommandSpy' || data.toString()===' Disabled your command spy.') cspy = false; if (data.toString()==='Successfully disabled CommandSpy' || data.toString()===' Disabled your command spy.') cspy = false;
if (data.toString()==='You now have the tag: [ChomeNS Bot]') { if (data.toString()==='You now have the tag: [ChomeNS Bot]') {
prefix = true; prefix = true;