mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-23 23:57:57 -05:00
15 lines
481 B
JavaScript
15 lines
481 B
JavaScript
/* 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};
|