owobot/commands/netmsg.js

45 lines
980 B
JavaScript
Raw Normal View History

2024-08-12 05:13:32 -04:00
const { bot } = require('../index.js')
const { getMessage } = require('../util/lang.js')
module.exports = {
execute: (c) => {
if (c.bot.host && c.bot.host.options.hidden) {
2024-08-12 05:13:32 -04:00
c.reply({
text: getMessage(c.lang, 'command.netmsg.disabled'),
2024-08-12 05:13:32 -04:00
color: c.colors.secondary
})
return
}
const json = {
translate: '[%s] %s: %s',
with: [
{
translate: '%s:%s',
with: [
{
text: c.host,
color: c.colors.primary
},
{
text: c.port + '',
color: c.colors.primary
}
],
color: c.colors.secondary
},
{
text: c.username,
color: c.colors.primary
},
{
text: c.args.join(' ')
2024-07-27 02:39:18 -04:00
}
],
color: 'white'
}
bot.forEach(item => {
if (item.host.options.hidden) return
item.tellraw('@a', json)
})
}
2024-07-27 02:39:18 -04:00
}