mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 18:54:55 -05:00
16 lines
445 B
JavaScript
16 lines
445 B
JavaScript
|
/* eslint-disable require-jsdoc */
|
||
|
const { chatPacketListener, parsePlayerMessages } = require('../../util/chat')
|
||
|
function inject (bot, client, target) {
|
||
|
const ChatMessage = require('prismarine-chat')(bot.version)
|
||
|
|
||
|
target.on('chat', (packet) => {
|
||
|
chatPacketListener(packet, ChatMessage, target)
|
||
|
})
|
||
|
|
||
|
target.on('parsed_chat', (message, packet) => {
|
||
|
parsePlayerMessages(message, packet, target)
|
||
|
})
|
||
|
};
|
||
|
|
||
|
module.exports = { inject }
|