1
0
Fork 0
mirror of https://github.com/ChomeNS/chomens-bot-mc.git synced 2025-07-17 17:32:20 -04:00
chomens-bot-js/plugins/tellraw.js

13 lines
415 B
JavaScript
Raw Permalink Normal View History

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') {
bot.chat(ChatMessage.fromNotch(message).toMotd().replaceAll('\xa7', '&'))
return
}
bot.core.run(`minecraft:tellraw ${selector} ${JSON.stringify(message)}`)
2022-11-27 14:35:28 +07:00
}
};
2022-11-27 14:35:28 +07:00
module.exports = { inject }