mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Validate override criteria and extra criteria. When loading existing configs, silently remove invalid overrides.
This commit is contained in:
parent
8ab6538744
commit
52e4b5b519
4 changed files with 62 additions and 5 deletions
|
@ -10,6 +10,8 @@ import {
|
|||
import * as t from "io-ts";
|
||||
import { getPluginConfigPreprocessor } from "../pluginUtils";
|
||||
import { TMarkdown } from "../types";
|
||||
import { Awaitable } from "knub/dist/utils";
|
||||
import { PluginOptions } from "knub/dist/config/configTypes";
|
||||
|
||||
/**
|
||||
* GUILD PLUGINS
|
||||
|
@ -26,6 +28,11 @@ export interface ZeppelinGuildPluginBlueprint<TPluginData extends GuildPluginDat
|
|||
usageGuide?: TMarkdown;
|
||||
configurationGuide?: TMarkdown;
|
||||
};
|
||||
|
||||
configPreprocessor?: (
|
||||
options: PluginOptions<TPluginData["_pluginType"]>,
|
||||
strict?: boolean,
|
||||
) => Awaitable<PluginOptions<TPluginData["_pluginType"]>>;
|
||||
}
|
||||
|
||||
export function zeppelinGuildPlugin<TBlueprint extends ZeppelinGuildPluginBlueprint>(
|
||||
|
@ -59,6 +66,7 @@ export function zeppelinGuildPlugin(...args) {
|
|||
export interface ZeppelinGlobalPluginBlueprint<TPluginType extends BasePluginType = BasePluginType>
|
||||
extends GlobalPluginBlueprint<GlobalPluginData<TPluginType>> {
|
||||
configSchema: t.TypeC<any>;
|
||||
configPreprocessor?: (options: PluginOptions<TPluginType>, strict?: boolean) => Awaitable<PluginOptions<TPluginType>>;
|
||||
}
|
||||
|
||||
export function zeppelinGlobalPlugin<TBlueprint extends ZeppelinGlobalPluginBlueprint>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue