3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Only load plugins that are defined in config

This commit is contained in:
Dragory 2018-07-31 19:00:17 +03:00
parent 808fa26b3d
commit b0c10b1fda

View file

@ -43,6 +43,16 @@ knex.migrate.latest().then(() => {
}, },
globalPlugins: { globalPlugins: {
bot_control: BotControlPlugin bot_control: BotControlPlugin
},
options: {
getEnabledPlugins(guildId, guildConfig): string[] {
const plugins = guildConfig.plugins || {};
const keys: string[] = Array.from(this.plugins.keys());
return keys.filter(pluginName => {
return plugins[pluginName] && plugins[pluginName].enabled !== false;
});
}
} }
}); });