mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Fix base plugins not being loaded by default
This commit is contained in:
parent
a1219d6178
commit
2b92f726e1
2 changed files with 13 additions and 1 deletions
|
@ -11,7 +11,7 @@ import { Configs } from "./data/Configs";
|
|||
import moment from "moment-timezone";
|
||||
import { Client, TextChannel } from "eris";
|
||||
import { connect } from "./data/db";
|
||||
import { globalPlugins, guildPlugins } from "./plugins/availablePlugins";
|
||||
import { baseGuildPlugins, globalPlugins, guildPlugins } from "./plugins/availablePlugins";
|
||||
import { errorMessage, isDiscordHTTPError, isDiscordRESTError, successMessage } from "./utils";
|
||||
import { startUptimeCounter } from "./uptime";
|
||||
import { AllowedGuilds } from "./data/AllowedGuilds";
|
||||
|
@ -156,8 +156,10 @@ connect().then(async () => {
|
|||
*/
|
||||
async getEnabledGuildPlugins(ctx, plugins): Promise<string[]> {
|
||||
const configuredPlugins = ctx.config.plugins || [];
|
||||
const basePluginNames = baseGuildPlugins.map(p => p.name);
|
||||
|
||||
return Array.from(plugins.keys()).filter(pluginName => {
|
||||
if (basePluginNames.includes(pluginName)) return true;
|
||||
return configuredPlugins[pluginName] && configuredPlugins[pluginName].enabled !== false;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -69,3 +69,13 @@ export const globalPlugins = [
|
|||
GuildConfigReloaderPlugin,
|
||||
BotControlPlugin,
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
export const baseGuildPlugins: Array<ZeppelinPluginBlueprint<any>> = [
|
||||
GuildInfoSaverPlugin,
|
||||
MessageSaverPlugin,
|
||||
NameHistoryPlugin,
|
||||
CasesPlugin,
|
||||
MutesPlugin,
|
||||
// TODO: Replace these with proper dependencies
|
||||
];
|
||||
|
|
Loading…
Add table
Reference in a new issue