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:
parent
808fa26b3d
commit
b0c10b1fda
1 changed files with 10 additions and 0 deletions
10
src/index.ts
10
src/index.ts
|
@ -43,6 +43,16 @@ knex.migrate.latest().then(() => {
|
|||
},
|
||||
globalPlugins: {
|
||||
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;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue