From a0ade1f5d55922350640763b176db6a868af990e Mon Sep 17 00:00:00 2001 From: 7cc5c4f330d47060 Date: Thu, 24 Oct 2024 00:43:22 -0400 Subject: [PATCH] Bugfix --- index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index f3c051c..bd26676 100644 --- a/index.js +++ b/index.js @@ -17,13 +17,17 @@ for (const plugin of bpl) { for(const bot of bots){ pluginItem.default(bot) } - plugins.push(pluginItem) // For rejoining + plugins.push(pluginItem.default) // For rejoining }) } catch (e) { console.log(e) } } const createBot = function createBot (host, oldId) { const bot = new EventEmitter() + + bot.host = host + bot.interval = {} + bot._client = createClient({ host: host.host, port: host.port ? host.port : 25565, @@ -38,15 +42,12 @@ const createBot = function createBot (host, oldId) { bot.id = oldId bots[oldId] = bot for(const pluginItem of plugins){ - pluginItem.load(bot) + pluginItem(bot) } } else { bot.id = bots.length bots.push(bot) } - - bot.host = host - bot.interval = {} bot.info = (msg) => { console.log(`[${bot.id}] [info] ${msg}`)