mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-18 07:35:02 +00:00
Add io-ts config schemas to all guild plugins
This commit is contained in:
parent
21402b2ea4
commit
039f0452fb
23 changed files with 373 additions and 294 deletions
|
@ -16,20 +16,23 @@ import path from "path";
|
|||
import moment from "moment-timezone";
|
||||
import { GuildSavedMessages } from "../data/GuildSavedMessages";
|
||||
import { SavedMessage } from "../data/entities/SavedMessage";
|
||||
import * as t from "io-ts";
|
||||
|
||||
interface IStarboardPluginConfig {
|
||||
can_manage: boolean;
|
||||
}
|
||||
const ConfigSchema = t.type({
|
||||
can_manage: t.boolean,
|
||||
});
|
||||
type TConfigSchema = t.TypeOf<typeof ConfigSchema>;
|
||||
|
||||
export class StarboardPlugin extends ZeppelinPlugin<IStarboardPluginConfig> {
|
||||
export class StarboardPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||
public static pluginName = "starboard";
|
||||
protected static configSchema = ConfigSchema;
|
||||
|
||||
protected starboards: GuildStarboards;
|
||||
protected savedMessages: GuildSavedMessages;
|
||||
|
||||
private onMessageDeleteFn;
|
||||
|
||||
getDefaultOptions(): IPluginOptions<IStarboardPluginConfig> {
|
||||
getDefaultOptions(): IPluginOptions<TConfigSchema> {
|
||||
return {
|
||||
config: {
|
||||
can_manage: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue