From 2303b78dd9aec6677f3782f9d063950cd40beeef Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Sun, 28 Aug 2022 08:24:52 +0700 Subject: [PATCH] no substring --- plugins/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chat.js b/plugins/chat.js index 89af748..984e0e4 100644 --- a/plugins/chat.js +++ b/plugins/chat.js @@ -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)) {