Update chatparser.js

This commit is contained in:
Yaode_owo 2024-07-19 20:38:10 -04:00
parent a77e4d8425
commit aa0e0c6536

View file

@ -1,17 +1,11 @@
const ChatMessage = require('../util/ChatMessage')('1.19.2');
function inject(bot) {
bot.on('systemChat', (data) => {
const msg = ChatMessage.fromNotch(data.formattedMessage);
const chatPositions = {
1: 'system',
2: 'game_info',
};
bot.emit('cmessage', msg, chatPositions[data.positionId], null);
bot.emit('cmessagestr', msg.toString(), chatPositions[data.positionId], msg, null);
if (data.positionId === 2) bot.emit('cactionBar', msg, null);
});
}
module.exports = inject;
bot.on('systemChat', (data) => {
const msg = ChatMessage.fromNotch(data.formattedMessage);
const chatPositions = {
1: 'system',
2: 'game_info',
};
bot.emit('cmessage', msg, chatPositions[data.positionId], null);
bot.emit('cmessagestr', msg.toString(), chatPositions[data.positionId], msg, null);
if (data.positionId === 2) bot.emit('cactionBar', msg, null);
});