2024-08-12 05:13:32 -04:00
|
|
|
const { bot } = require('../index.js')
|
|
|
|
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
|
|
|
|
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: {
|
|
|
|
action: "show_text",
|
|
|
|
value: {
|
|
|
|
translate: '%s: %s:%s',
|
|
|
|
with: [
|
|
|
|
{
|
|
|
|
text: getMessage(c.lang, "command.netmsg.serverAddress"),
|
|
|
|
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
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: c.args.join(' ')
|
2024-07-27 02:39:18 -04:00
|
|
|
}
|
2024-07-28 02:37:31 -04:00
|
|
|
],
|
|
|
|
color: 'white'
|
|
|
|
}
|
2024-08-22 07:34:39 -04:00
|
|
|
bot.forEach(item => {
|
|
|
|
item.tellraw('@a', json)
|
|
|
|
})
|
2024-07-28 02:37:31 -04:00
|
|
|
}
|
2024-07-27 02:39:18 -04:00
|
|
|
}
|