Rename loadBot to load
This commit is contained in:
parent
bacfdfad49
commit
ea9e866cd8
11 changed files with 12 additions and 12 deletions
4
index.js
4
index.js
|
@ -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) }
|
||||
})
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
loadBot: (b) => {
|
||||
load: (b) => {
|
||||
b.cloops = []
|
||||
b.addCloop = function (command, rate) {
|
||||
b.cloops.push({
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -40,7 +40,7 @@ function consoleWrite (text) {
|
|||
rl.prompt(true)
|
||||
}
|
||||
module.exports = {
|
||||
loadBot: (b) => {
|
||||
load: (b) => {
|
||||
b.info = (msg) => {
|
||||
consoleWrite(`[${b.id}] [info] ${msg}`)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
loadBot: (b) => {
|
||||
load: (b) => {
|
||||
b._client.on('login', () => {
|
||||
b.interval.chatQueue = setInterval(() => {
|
||||
if (b.chatqueue.length !== 0) {
|
||||
|
|
|
@ -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 = {}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
loadBot: (b) => {
|
||||
load: (b) => {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue