idk bunch of plugins did not load so changed back

This commit is contained in:
ChomeNS 2023-01-23 19:34:25 +07:00
parent 508b6a64c7
commit ed928977aa

View file

@ -17,7 +17,7 @@ const path = require('path')
async function loadPlugins (bot, dcclient, config, rl, target, client, proxy, clientPacketBlacklist, targetPacketBlacklist) { async function loadPlugins (bot, dcclient, config, rl, target, client, proxy, clientPacketBlacklist, targetPacketBlacklist) {
const dir = path.join(__dirname, '..', 'plugins', proxy ? 'proxy' : '') const dir = path.join(__dirname, '..', 'plugins', proxy ? 'proxy' : '')
const plugins = await fs.readdir(dir) const plugins = await fs.readdir(dir)
for (const plugin of plugins) { plugins.forEach((plugin) => {
if (!plugin.endsWith('.js')) return if (!plugin.endsWith('.js')) return
try { try {
const plug = require(path.join(dir, plugin)) const plug = require(path.join(dir, plugin))
@ -27,7 +27,7 @@ async function loadPlugins (bot, dcclient, config, rl, target, client, proxy, cl
console.log(`Plugin ${plugin} is having exception loading the plugin:`) console.log(`Plugin ${plugin} is having exception loading the plugin:`)
console.log(util.inspect(e)) console.log(util.inspect(e))
} }
} })
}; };
module.exports = { loadPlugins } module.exports = { loadPlugins }