Fix all plugins being enabled by default
This commit is contained in:
parent
bd09c3bdf3
commit
bc4cbe9e30
1 changed files with 3 additions and 5 deletions
|
@ -138,12 +138,10 @@ connect().then(async () => {
|
|||
* - are explicitly enabled in the guild config
|
||||
* Dependencies are also automatically loaded by Knub.
|
||||
*/
|
||||
async getEnabledPlugins(this: Knub, guildId, guildConfig): Promise<string[]> {
|
||||
const configuredPlugins = guildConfig.plugins || {};
|
||||
const pluginNames: string[] = Array.from(this.guildPlugins.keys());
|
||||
const plugins = Array.from(this.guildPlugins.values()) as ZeppelinPlugin[];
|
||||
async getEnabledGuildPlugins(ctx, plugins): Promise<string[]> {
|
||||
const configuredPlugins = ctx.config.plugins || [];
|
||||
|
||||
return pluginNames.filter(pluginName => {
|
||||
return Array.from(plugins.keys()).filter(pluginName => {
|
||||
return configuredPlugins[pluginName] && configuredPlugins[pluginName].enabled !== false;
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue