mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-15 14:15:03 +00:00
refactor: replace io-ts with zod
This commit is contained in:
parent
fafaefa1fb
commit
28692962bc
161 changed files with 1450 additions and 2105 deletions
|
@ -1,16 +1,14 @@
|
|||
import * as t from "io-ts";
|
||||
import { Queue } from "../../Queue";
|
||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts";
|
||||
import { UsernameSaverPluginType } from "./types";
|
||||
import { UsernameSaverPluginType, zUsernameSaverConfig } from "./types";
|
||||
|
||||
export const UsernameSaverPlugin = zeppelinGuildPlugin<UsernameSaverPluginType>()({
|
||||
name: "username_saver",
|
||||
showInDocs: false,
|
||||
|
||||
configParser: makeIoTsConfigParser(t.type({})),
|
||||
configParser: (input) => zUsernameSaverConfig.parse(input),
|
||||
|
||||
// prettier-ignore
|
||||
events: [
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
import { BasePluginType, guildPluginEventListener } from "knub";
|
||||
import z from "zod";
|
||||
import { Queue } from "../../Queue";
|
||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||
|
||||
export const zUsernameSaverConfig = z.strictObject({});
|
||||
|
||||
export interface UsernameSaverPluginType extends BasePluginType {
|
||||
config: z.infer<typeof zUsernameSaverConfig>;
|
||||
state: {
|
||||
usernameHistory: UsernameHistory;
|
||||
updateQueue: Queue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue