2022-12-05 03:16:48 -05:00
|
|
|
function inject (bot, dcclient, config) {
|
|
|
|
const ChatMessage = require('prismarine-chat')(bot.version)
|
2022-11-27 02:35:28 -05:00
|
|
|
bot.tellraw = function (selector, message) {
|
2023-03-01 07:51:24 -05:00
|
|
|
if (bot.options.useChat && selector === '@a') {
|
2022-12-05 03:16:48 -05:00
|
|
|
bot.chat(ChatMessage.fromNotch(message).toMotd().replaceAll('\xa7', '&'))
|
|
|
|
return
|
|
|
|
}
|
2022-12-25 04:55:34 -05:00
|
|
|
bot.core.run(`minecraft:tellraw ${selector} ${JSON.stringify(message)}`)
|
2022-11-27 02:35:28 -05:00
|
|
|
}
|
2022-11-07 06:30:37 -05:00
|
|
|
};
|
|
|
|
|
2022-11-27 02:35:28 -05:00
|
|
|
module.exports = { inject }
|