chomens-bot-js/plugins/proxy/chat.js

16 lines
481 B
JavaScript
Raw Normal View History

2022-11-16 20:46:04 -05:00
/* eslint-disable require-jsdoc */
const {chatPacketListener, parsePlayerMessages} = require('../../util/chat');
function inject(bot, client, targetClient) {
const ChatMessage = require('prismarine-chat')(bot.version);
targetClient.on('chat', (packet) => {
chatPacketListener(packet, ChatMessage, '', targetClient);
});
targetClient.on('parsed_chat', (message, packet) => {
parsePlayerMessages(message, packet, targetClient);
});
};
module.exports = {inject};