3
0
Fork 0
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:
Dragory 2024-01-14 14:25:42 +00:00
parent fafaefa1fb
commit 28692962bc
No known key found for this signature in database
161 changed files with 1450 additions and 2105 deletions

View file

@ -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: [

View file

@ -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;