Add local hiding of server IPs in the server command

This commit is contained in:
7cc5c4f330d47060 2024-10-03 15:05:22 -04:00
parent 1be6ea282e
commit 2b3e4789c6
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
2 changed files with 14 additions and 0 deletions

View file

@ -222,6 +222,19 @@ const aboutServer = function (c) {
const displayServerList = function (c) {
index.bots.forEach((item, i) => {
if(c.bot.id == i && c.bot.host.options.hideLocally){
c.reply({
translate: getMessage(c.lang, "command.about.serverList.hideLocally"),
color: c.colors.secondary,
with: [
{
text: i.toString(),
color: c.colors.primary
}
]
});
return;
}
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'

View file

@ -121,6 +121,7 @@
"command.about.serverInfo.os.android.model": "Device model",
"command.about.serverInfo.botName": "Bot name",
"command.about.serverInfo.botVer": "Bot version",
"command.about.serverList.hideLocally": "Server %s has been hidden from the server list.",
"command.about.serverListItem": "Server %s - %s",
"command.about.serverListItem.thisServer": "Server %s - %s (this server)",
"command.tpr.success": "Teleporting %s to %s, %s, %s",