no substring

This commit is contained in:
ChomeNS 2022-08-28 08:24:52 +07:00
parent 2dd3a76817
commit 2303b78dd9

View file

@ -30,7 +30,7 @@ function inject(bot) {
bot.emit('message', username, message, packet.sender);
} else if (raw.match(/.* .*\u203a .*/g)) {
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u203a.*/g, '').replace(/§#....../gm, '').split(' ')[0].substring(2);
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u203a.*/g, '').replace(/§#....../gm, '').split(' ')[0];
const message = raw.split('\u203a ')[1];
bot.emit('message', username, message, packet.sender);
} else if (raw.match(/<.*§r> .*/g)) {