From b8a688393350ecbc90989dd55d4582e6e3e27b98 Mon Sep 17 00:00:00 2001 From: 7cc5c4f330d47060 Date: Wed, 11 Sep 2024 23:44:17 -0400 Subject: [PATCH] Rename index.bot to index.bots --- commands/about.js | 2 +- index.js | 6 +++--- plugins/console.js | 2 +- util/ConsoleCommand.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/about.js b/commands/about.js index 22f8664..d9f6c1f 100644 --- a/commands/about.js +++ b/commands/about.js @@ -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' diff --git a/index.js b/index.js index 6cbeded..d9d249d 100755 --- a/index.js +++ b/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 diff --git a/plugins/console.js b/plugins/console.js index f025f92..029cea3 100644 --- a/plugins/console.js +++ b/plugins/console.js @@ -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) } diff --git a/util/ConsoleCommand.js b/util/ConsoleCommand.js index 0b7e59e..2b375dd 100644 --- a/util/ConsoleCommand.js +++ b/util/ConsoleCommand.js @@ -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)