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

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
* 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;
});
},