Rename index.bot to index.bots

This commit is contained in:
7cc5c4f330d47060 2024-09-11 23:44:17 -04:00
parent 9c6eb5ee4e
commit b8a6883933
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
4 changed files with 6 additions and 6 deletions

View file

@ -217,7 +217,7 @@ const aboutServer = function (c) {
}
const displayServerList = function (c) {
index.bot.forEach((item, i) => {
index.bots.forEach((item, i) => {
if (item.host.options && item.host.options.hidden && c.verify !== 3 && c.bot.id !== i) return
let message = 'command.about.serverListItem'
if (c.bot.id === i) message = 'command.about.serverListItem.thisServer'

View file

@ -16,7 +16,7 @@ const generateUser = require('./util/usergen.js')
const EventEmitter = require('node:events')
const settings = require('./settings.json')
const secret = require('./secret.json')
module.exports.bot = []
module.exports.bots = []
const botplug = []
const bpl = fs.readdirSync('plugins')
@ -63,10 +63,10 @@ const createBot = function createBot (host, oldId) {
}
delete module.exports.bot[oldId]
bot.id = oldId
module.exports.bot[oldId] = bot
module.exports.bots[oldId] = bot
} else {
bot.id = module.exports.bot.length
module.exports.bot.push(bot)
module.exports.bot.push(bots)
}
bot.host = host

View file

@ -14,7 +14,7 @@ rl.on('line', (l) => {
const tmpcmd = l.split(' ')
const index2 = tmpcmd.splice(1, 1)[0]
if (index2 === '*') {
for (let i = 0; i < index.bot.length; i++) {
for (let i = 0; i < index.bots.length; i++) {
const cmd = new ConsoleCommand(tmpcmd.join(' '), i)
cmds[l.split(' ')[0].toLowerCase()].execute(cmd)
}

View file

@ -13,7 +13,7 @@ class ConsoleCommand {
this.msgType = '_bot_console'
this.prefix = ''
this.bot = index2 >= 0
? index.bot[index2]
? index.bots[index2]
: {}
this.type = 'console'
this.args = cmd.split(' ').slice(1)