Merge branch 'main' of code.chipmunk.land:7cc5c4f330d47060/owobot

This commit is contained in:
7cc5c4f330d47060 2024-09-14 12:48:44 -04:00
commit 24236cf7a7
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
3 changed files with 12 additions and 2 deletions

View file

@ -221,6 +221,11 @@ const displayServerList = function (c) {
if (item.host.options && item.host.options.hidden && c.verify !== 2 && c.bot.id !== i) return
let message = 'command.about.serverListItem'
if (c.bot.id === i) message = 'command.about.serverListItem.thisServer'
let host = item.host.host
let port = item.host.port
if(item.host.options && item.host.options.displayAsIPv6){
host = `[${host}]`
}
c.reply({
translate: getMessage(c.lang, message),
color: c.colors.secondary,
@ -230,11 +235,11 @@ const displayServerList = function (c) {
color: c.colors.primary
},
{
text: `${item.host.host}:${item.host.port}`,
text: `${host}:${port}`,
color: c.colors.primary,
clickEvent: {
action: 'copy_to_clipboard',
value: `${item.host.host}:${item.host.port}`
value: `${host}:${port}`
},
hoverEvent: {
action: 'show_text',

View file

@ -7,6 +7,8 @@ module.exports = {
if (c.bot.host.options && c.bot.host.options.hidden) {
host = 'localhost' // Makes hidden servers appear as localhost
port = '25565'
} else if(c.bot.host.options && c.bot.host.options.displayAsIPv6){
host = `[${host}]`
}
const json = {
translate: '[%s] %s: %s',

View file

@ -70,6 +70,9 @@ const createBot = function createBot (host, oldId) {
}
bot.host = host
if(bot.host.host.includes(":")){
bot.host.options.displayAsIPv6 = true
}
bot.interval = {}
bot.info = (msg) => {