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

16 lines
445 B
JavaScript
Raw Normal View History

2022-11-30 06:01:46 -05:00
/* 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 }