From bc4cbe9e3086412101ce6468c4cd4ee0024a23ee Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Thu, 30 Jul 2020 22:00:08 +0300 Subject: [PATCH] Fix all plugins being enabled by default --- backend/src/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 0485fe7f..c77488dd 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -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 { - 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 { + const configuredPlugins = ctx.config.plugins || []; - return pluginNames.filter(pluginName => { + return Array.from(plugins.keys()).filter(pluginName => { return configuredPlugins[pluginName] && configuredPlugins[pluginName].enabled !== false; }); },