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