mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
remove in plugins
This commit is contained in:
parent
8ffd15d343
commit
b6ab196a02
1 changed files with 12 additions and 26 deletions
|
@ -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};
|
||||
|
|
Loading…
Reference in a new issue