mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-23 15:47:57 -05:00
use global else chat parse BROKE
This commit is contained in:
parent
a23abfb5af
commit
b70cbdf5f3
1 changed files with 3 additions and 3 deletions
|
@ -53,17 +53,17 @@ function parsePlayerMessages(message, packet, bot) {
|
|||
const raw = message.toMotd().substring(0, 32767);
|
||||
if (raw.match(/.* .*: .*/g)) {
|
||||
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
|
||||
const username = raw.replace(/.*?\[.*?\] /, '').replace(/:.*/g, '').replace(/§#....../gm, '');
|
||||
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/:.*/g, '').replace(/§#....../gm, '');
|
||||
const message = raw.split(': ')[1];
|
||||
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(/.*?\[.*?\] /, '').replace(/\u203a.*/g, '').replace(/§#....../gm, '').split(' ')[0];
|
||||
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u203a.*/g, '').replace(/§#....../gm, '').split(' ')[0];
|
||||
const message = raw.split('\u203a ')[1].substring(2);
|
||||
bot.emit('message', username, message, packet.sender);
|
||||
} else if (raw.match(/.* .*\u00BB .*/g)) {
|
||||
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
|
||||
const username = raw.replace(/.*?\[.*?\] /, '').replace(/\u00BB.*/g, '').replace(/§#....../gm, '').split(' ')[0];
|
||||
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u00BB.*/g, '').replace(/§#....../gm, '').split(' ')[0];
|
||||
const message = raw.split('\u00BB ')[1].substring(2);
|
||||
bot.emit('message', username, message, packet.sender);
|
||||
} else if (raw.match(/<.*§r> .*/g)) {
|
||||
|
|
Loading…
Reference in a new issue