Add serverlist to about command
This commit is contained in:
parent
58df0b2b6a
commit
58b94697bb
2 changed files with 25 additions and 0 deletions
|
@ -4,6 +4,7 @@ const { getMessage, formatTime } = require('../util/lang.js')
|
|||
const fs = require('fs')
|
||||
const botVersion = require('../util/version.js')
|
||||
const version = require('../version.json')
|
||||
const index = require('../index.js')
|
||||
|
||||
const aboutBot = function (c) {
|
||||
c.reply({
|
||||
|
@ -178,10 +179,33 @@ const aboutServer = function (c) {
|
|||
return botVersion
|
||||
})
|
||||
}
|
||||
|
||||
const displayServerList = function (c) {
|
||||
for(const i in index.bot){
|
||||
if(index.bot[i].host.options && index.bot[i].host.options.hidden) continue
|
||||
c.reply({
|
||||
translate: getMessage(c.lang, 'command.about.serverListItem'),
|
||||
color: c.colors.secondary,
|
||||
with:[
|
||||
{
|
||||
text: i.toString(),
|
||||
color: c.colors.primary
|
||||
},
|
||||
{
|
||||
text: `${index.bot[i].host.host}:${index.bot[i].host.port}`,
|
||||
color: c.colors.primary
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
execute: function (c) {
|
||||
if (c.args[0] === 'server') {
|
||||
aboutServer(c)
|
||||
} else if (c.args[0] === 'serverlist') {
|
||||
displayServerList(c)
|
||||
} else {
|
||||
aboutBot(c)
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
"command.about.serverInfo.os.android.model": "Device model",
|
||||
"command.about.serverInfo.botName": "Bot name",
|
||||
"command.about.serverInfo.botVer": "Bot version",
|
||||
"command.about.serverListItem": "Server %s - %s",
|
||||
"command.tpr.success": "Teleporting %s to %s, %s, %s",
|
||||
"command.verify.success": "Successfully verified with permission level %s",
|
||||
"command.error": "An error occured (check console for more info)",
|
||||
|
|
Loading…
Reference in a new issue