Update main/chatparser.js

This commit is contained in:
Yaode_owo 2024-10-12 10:10:37 -04:00
parent 3d25099f44
commit 988048783d

View file

@ -29,12 +29,15 @@ function processNbtMessage(msg) {
return '{"text":""}';
}
}
let profilelesschat = {};
let systemchat = {};
let playerchat = {};
function inject(bot) {
bot.on('system_chat', (packet) => { // system
if (packet.isActionBar) return;
let systemchat = {};
systemchat = {};
systemchat.jsonMsg = JSON.parse(processNbtMessage(packet.content));
systemchat.message = parseMinecraftMessage(processNbtMessage(packet.content));
systemchat.nocolor_message = parseMinecraftMessageNoColor(processNbtMessage(packet.content));
@ -44,7 +47,7 @@ bot.on('system_chat', (packet) => { // system
bot.on('profileless_chat', (packet) => { // sudo and vanish
let profilelesschat = {};
profilelesschat = {};
profilelesschat.type = packet.type
@ -61,7 +64,7 @@ bot.on('profileless_chat', (packet) => { // sudo and vanish
})
bot.on('player_chat', (packet) => { // player
let playerchat = {};
playerchat = {};
playerchat.plainMessage = packet.plainMessage;
playerchat.type = packet.type;