From b6ab196a02b49df65e9e1c7cff936fa4a6e869d5 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Thu, 17 Nov 2022 20:05:47 +0700 Subject: [PATCH] remove in plugins --- util/loadPlugins.js | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/util/loadPlugins.js b/util/loadPlugins.js index 66d81db..7767e41 100644 --- a/util/loadPlugins.js +++ b/util/loadPlugins.js @@ -13,32 +13,18 @@ const path = require('path'); * @param {object} client proxy client * @param {boolean} proxy is proxy */ -async function loadPlugins(bot, dcclient, config, rl, targetClient, client, proxy) { - if (!proxy) { - const plugins = await fs.readdir(path.join(__dirname, '..', 'plugins')); - plugins.forEach((plugin) => { - if (!plugin.endsWith('.js')) return; - try { - const plug = require(path.join(__dirname, '..', 'plugins', plugin)); - plug.inject(bot, dcclient, config, rl); - } catch (e) { - console.log(`Plugin ${plugin} is having exception loading the plugin:`); - console.log(util.inspect(e)); - } - }); - } else { - const plugins = await fs.readdir(path.join(__dirname, '..', 'plugins', 'proxy')); - plugins.forEach((plugin) => { - if (!plugin.endsWith('.js')) return; - try { - const plug = require(path.join(__dirname, '..', 'plugins', 'proxy', plugin)); - plug.inject(bot, client, targetClient, config); - } catch (e) { - console.log(`Proxy Plugin ${plugin} is having exception loading the plugin:`); - console.log(util.inspect(e)); - } - }); - } +async function loadPlugins(bot, dcclient, config, rl) { + const plugins = await fs.readdir(path.join(__dirname, '..', 'plugins')); + plugins.forEach((plugin) => { + if (!plugin.endsWith('.js')) return; + try { + const plug = require(path.join(__dirname, '..', 'plugins', plugin)); + plug.inject(bot, dcclient, config, rl); + } catch (e) { + console.log(`Plugin ${plugin} is having exception loading the plugin:`); + console.log(util.inspect(e)); + } + }); }; module.exports = {loadPlugins};