2024-09-12 00:09:00 -04:00
|
|
|
const { bots } = require('../index.js')
|
2024-08-12 05:13:32 -04:00
|
|
|
const { getMessage } = require('../util/lang.js')
|
2024-07-28 02:37:31 -04:00
|
|
|
module.exports = {
|
|
|
|
execute: (c) => {
|
2024-08-24 09:06:55 -04:00
|
|
|
let host = c.host
|
|
|
|
let port = c.port
|
2024-08-24 10:15:39 -04:00
|
|
|
if (c.bot.host.options && c.bot.host.options.hidden) {
|
|
|
|
host = 'localhost' // Makes hidden servers appear as localhost
|
|
|
|
port = '25565'
|
2024-08-12 05:13:32 -04:00
|
|
|
}
|
2024-07-28 02:37:31 -04:00
|
|
|
const json = {
|
|
|
|
translate: '[%s] %s: %s',
|
|
|
|
with: [
|
|
|
|
{
|
2024-08-24 09:06:55 -04:00
|
|
|
text: c.serverName,
|
|
|
|
hoverEvent: {
|
2024-08-24 10:15:39 -04:00
|
|
|
action: 'show_text',
|
2024-08-24 09:06:55 -04:00
|
|
|
value: {
|
|
|
|
translate: '%s: %s:%s',
|
|
|
|
with: [
|
|
|
|
{
|
2024-08-24 10:15:39 -04:00
|
|
|
text: getMessage(c.lang, 'command.netmsg.serverAddress'),
|
2024-08-24 09:06:55 -04:00
|
|
|
color: c.colors.primary
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: host,
|
|
|
|
color: c.colors.primary
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: port + '',
|
|
|
|
color: c.colors.primary
|
|
|
|
}
|
|
|
|
],
|
|
|
|
color: c.colors.secondary
|
2024-07-28 02:37:31 -04:00
|
|
|
}
|
2024-08-24 09:06:55 -04:00
|
|
|
},
|
|
|
|
color: c.colors.primary
|
2024-07-28 02:37:31 -04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
text: c.username,
|
|
|
|
color: c.colors.primary
|
|
|
|
},
|
|
|
|
{
|
2024-09-12 00:47:58 -04:00
|
|
|
text: c.args.join(' ').slice(0,512)
|
2024-07-27 02:39:18 -04:00
|
|
|
}
|
2024-07-28 02:37:31 -04:00
|
|
|
],
|
|
|
|
color: 'white'
|
|
|
|
}
|
2024-09-12 00:09:00 -04:00
|
|
|
bots.forEach(item => {
|
2024-08-25 22:29:39 -04:00
|
|
|
if (item.host.options && item.host.options.netmsgIncomingDisabled && c.type !== 'console') return
|
2024-08-22 07:34:39 -04:00
|
|
|
item.tellraw('@a', json)
|
|
|
|
})
|
2024-07-28 02:37:31 -04:00
|
|
|
}
|
2024-07-27 02:39:18 -04:00
|
|
|
}
|