mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 09:35:35 -05:00
12 lines
455 B
JavaScript
12 lines
455 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} ${typeof message === 'string' ? message : JSON.stringify(message)}`)
|
|
}
|
|
};
|
|
|
|
module.exports = { inject }
|