From 3a76b57b333292adef082e3b18a6ba0468ed77c8 Mon Sep 17 00:00:00 2001 From: 7cc5c4f330d47060 Date: Sat, 17 Aug 2024 09:56:26 -0400 Subject: [PATCH] Chgange plugin loakder --- index.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 0c9d584..df126e4 100755 --- a/index.js +++ b/index.js @@ -6,17 +6,18 @@ const fs = require('fs') module.exports.bot = [] -const loadplug = (botno) => { - const botplug = [] - const bpl = fs.readdirSync('plugins') - for (const i in bpl) { - if (!bpl[i].endsWith('.js')) { - continue - } - try { - botplug.push(require(`./plugins/${bpl[i]}`)) - } catch (e) { console.log(e) } +const botplug = [] +const bpl = fs.readdirSync('plugins') +for (const i in bpl) { + if (!bpl[i].endsWith('.js')) { + continue } + try { + botplug.push(require(`./plugins/${bpl[i]}`)) + } catch (e) { console.log(e) } +} + +const loadplug = (botno) => { botplug.forEach((plug) => { try { if (plug.load) {