Fix all plugins being enabled by default

This commit is contained in:
Dragory 2020-07-30 22:00:08 +03:00
parent bd09c3bdf3
commit bc4cbe9e30
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -138,12 +138,10 @@ connect().then(async () => {
* - are explicitly enabled in the guild config * - are explicitly enabled in the guild config
* Dependencies are also automatically loaded by Knub. * Dependencies are also automatically loaded by Knub.
*/ */
async getEnabledPlugins(this: Knub, guildId, guildConfig): Promise<string[]> { async getEnabledGuildPlugins(ctx, plugins): Promise<string[]> {
const configuredPlugins = guildConfig.plugins || {}; const configuredPlugins = ctx.config.plugins || [];
const pluginNames: string[] = Array.from(this.guildPlugins.keys());
const plugins = Array.from(this.guildPlugins.values()) as ZeppelinPlugin[];
return pluginNames.filter(pluginName => { return Array.from(plugins.keys()).filter(pluginName => {
return configuredPlugins[pluginName] && configuredPlugins[pluginName].enabled !== false; return configuredPlugins[pluginName] && configuredPlugins[pluginName].enabled !== false;
}); });
}, },