Rename index.bot to index.bots
This commit is contained in:
parent
9c6eb5ee4e
commit
b8a6883933
4 changed files with 6 additions and 6 deletions
|
@ -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'
|
||||
|
|
6
index.js
6
index.js
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue