mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
12 lines
415 B
JavaScript
12 lines
415 B
JavaScript
function inject (bot, dcclient, config) {
|
|
const ChatMessage = require('prismarine-chat')(bot.version)
|
|
bot.tellraw = function (selector, message) {
|
|
if (config.chat.useChat && selector === '@a') {
|
|
bot.chat(ChatMessage.fromNotch(message).toMotd().replaceAll('\xa7', '&'))
|
|
return
|
|
}
|
|
bot.core.run(`minecraft:tellraw ${selector} ${JSON.stringify(message)}`)
|
|
}
|
|
};
|
|
|
|
module.exports = { inject }
|