Rename loadBot to load

This commit is contained in:
7cc5c4f330d47060 2024-07-29 01:35:26 -04:00
parent bacfdfad49
commit ea9e866cd8
11 changed files with 12 additions and 12 deletions

View file

@ -19,8 +19,8 @@ const loadplug = (botno) => {
}
botplug.forEach((plug) => {
try {
if (plug.loadBot) {
plug.loadBot(module.exports.bot[botno])
if (plug.load) {
plug.load(module.exports.bot[botno])
}
} catch (e) { console.log(e) }
})

View file

@ -12,7 +12,7 @@ const messageTypes = [
''
]
module.exports = {
loadBot: (b) => {
load: (b) => {
b._client.on('profileless_chat', (data) => {
if (data.type === 4) {
const json = parse1204(data.message)

View file

@ -1,5 +1,5 @@
module.exports = {
loadBot: (b) => {
load: (b) => {
b.cloops = []
b.addCloop = function (command, rate) {
b.cloops.push({

View file

@ -37,7 +37,7 @@ const sortHelp = function sortHelp (c1, c2) {
return level1 - level2
}
module.exports = {
loadBot: (b) => {
load: (b) => {
b.prefix = settings.prefix
b.lastCmd = 0
b.runCommand = (name, uuid, text, prefix) => {

View file

@ -2,7 +2,7 @@ const uuidToInt = require('../util/uuidtoint.js')
module.exports = {
cs: 4,
cs_v: 6,
loadBot: function (b) {
load: function (b) {
b.interval.commandFill = setInterval(() => { if (b.sc_tasks.cc) b.sc_tasks.cc.failed = 1 }, 60000)
b.ccq = []
b.blocknoX = 0

View file

@ -40,7 +40,7 @@ function consoleWrite (text) {
rl.prompt(true)
}
module.exports = {
loadBot: (b) => {
load: (b) => {
b.info = (msg) => {
consoleWrite(`[${b.id}] [info] ${msg}`)
}

View file

@ -1,5 +1,5 @@
module.exports = {
loadBot: (b) => {
load: (b) => {
b._client.on('login', () => {
b.interval.chatQueue = setInterval(() => {
if (b.chatqueue.length !== 0) {

View file

@ -1,7 +1,7 @@
const parse = require('../util/chatparse.js')
const parse1204 = require('../util/chatparse_1204.js')
module.exports = {
loadBot: (b) => {
load: (b) => {
b.players = {}
b._client.on('player_info', (data) => {
const buffer2 = {}

View file

@ -1,6 +1,6 @@
const index = require('../index.js')
module.exports = {
loadBot: (b) => {
load: (b) => {
b._client.on('end', () => {
b.info('bot ' + b.id + ' disconnected')
for (const i in b.interval) {

View file

@ -11,7 +11,7 @@ class SCTask {
}
}
module.exports = {
loadBot: (b) => {
load: (b) => {
b.sc_tasks = {}
b.interval.sc = setInterval(() => {
for (const i in b.sc_tasks) {

View file

@ -1,5 +1,5 @@
module.exports = {
loadBot: (b) => {
load: (b) => {
}
}