mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-19 08:05:01 +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
|
@ -4,18 +4,21 @@ import { Member, Message } from "eris";
|
|||
import { createChunkedMessage, disableCodeBlocks } from "../utils";
|
||||
import { ZeppelinPlugin } from "./ZeppelinPlugin";
|
||||
import { MAX_USERNAME_ENTRIES_PER_USER, UsernameHistory } from "../data/UsernameHistory";
|
||||
import * as t from "io-ts";
|
||||
|
||||
interface INameHistoryPluginConfig {
|
||||
can_view: boolean;
|
||||
}
|
||||
const ConfigSchema = t.type({
|
||||
can_view: t.boolean,
|
||||
});
|
||||
type TConfigSchema = t.TypeOf<typeof ConfigSchema>;
|
||||
|
||||
export class NameHistoryPlugin extends ZeppelinPlugin<INameHistoryPluginConfig> {
|
||||
export class NameHistoryPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||
public static pluginName = "name_history";
|
||||
protected static configSchema = ConfigSchema;
|
||||
|
||||
protected nicknameHistory: GuildNicknameHistory;
|
||||
protected usernameHistory: UsernameHistory;
|
||||
|
||||
getDefaultOptions(): IPluginOptions<INameHistoryPluginConfig> {
|
||||
getDefaultOptions(): IPluginOptions<TConfigSchema> {
|
||||
return {
|
||||
config: {
|
||||
can_view: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue