Rename bot to bots

This commit is contained in:
7cc5c4f330d47060 2024-08-20 09:14:21 -04:00
parent a19acec354
commit b0d40c3e75
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
4 changed files with 8 additions and 9 deletions

View file

@ -4,7 +4,6 @@ import { getMessage, formatTime } from '../util/lang.mjs'
import { readdirSync, readFileSync } from "fs" import { readdirSync, readFileSync } from "fs"
import { default as botVersion } from "../util/version.js" import { default as botVersion } from "../util/version.js"
import { default as version } from "../version.json" with { type: "json" } import { default as version } from "../version.json" with { type: "json" }
import { bot } from "../index.mjs"
const aboutBot = function (c) { const aboutBot = function (c) {
c.reply({ c.reply({

View file

@ -1,4 +1,4 @@
import { bot } from '../index.mjs' import { bots } from '../index.mjs'
import { getMessage } from '../util/lang.mjs' import { getMessage } from '../util/lang.mjs'
export default { export default {
execute: (c) => { execute: (c) => {
@ -36,9 +36,9 @@ export default {
], ],
color: 'white' color: 'white'
} }
for (const i in bot) { for (const i in bots) {
if (bot[i].host.options.hidden) continue if (bots[i].host.options.hidden) continue
bot[i].tellraw('@a', json) bots[i].tellraw('@a', json)
} }
} }
} }

View file

@ -1,5 +1,5 @@
import * as readln from 'readline' import * as readln from 'readline'
import { bot } from '../index.mjs' import { bots } from '../index.mjs'
import { default as ConsoleCommand } from '../util/ConsoleCommand.mjs' import { default as ConsoleCommand } from '../util/ConsoleCommand.mjs'
import { default as cmds } from '../util/commands.mjs' import { default as cmds } from '../util/commands.mjs'
const rl = readln.createInterface({ const rl = readln.createInterface({
@ -14,7 +14,7 @@ rl.on('line', (l) => {
const tmpcmd = l.split(' ') const tmpcmd = l.split(' ')
const index2 = tmpcmd.splice(1, 1)[0] const index2 = tmpcmd.splice(1, 1)[0]
if (index2 === '*') { if (index2 === '*') {
for (let i = 0; i < bot.length; i++) { for (let i = 0; i < bots.length; i++) {
const cmd = new ConsoleCommand(tmpcmd.join(' '), i) const cmd = new ConsoleCommand(tmpcmd.join(' '), i)
cmds[l.split(' ')[0].toLowerCase()].execute(cmd) cmds[l.split(' ')[0].toLowerCase()].execute(cmd)
} }

View file

@ -1,4 +1,4 @@
import { bot } from '../index.mjs' import { bots } from '../index.mjs'
import { default as parse } from './chatparse_console.mjs' import { default as parse } from './chatparse_console.mjs'
import { default as settings } from '../settings.json' with {type: "json"} import { default as settings } from '../settings.json' with {type: "json"}
class ConsoleCommand { class ConsoleCommand {
@ -12,7 +12,7 @@ class ConsoleCommand {
this.msgType = '_bot_console' this.msgType = '_bot_console'
this.prefix = '' this.prefix = ''
this.bot = index2 >= 0 this.bot = index2 >= 0
? bot[index2] ? bots[index2]
: {} : {}
this.type = 'console' this.type = 'console'
this.args = cmd.split(' ').slice(1) this.args = cmd.split(' ').slice(1)