3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 04:25:01 +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,6 +1,5 @@
import { PluginOptions } from "knub";
import { GuildLogs } from "../../data/GuildLogs";
import { makeIoTsConfigParser } from "../../pluginUtils";
import { trimPluginDescription } from "../../utils";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
@ -9,13 +8,13 @@ import { AddRoleCmd } from "./commands/AddRoleCmd";
import { MassAddRoleCmd } from "./commands/MassAddRoleCmd";
import { MassRemoveRoleCmd } from "./commands/MassRemoveRoleCmd";
import { RemoveRoleCmd } from "./commands/RemoveRoleCmd";
import { ConfigSchema, RolesPluginType } from "./types";
import { RolesPluginType, zRolesConfig } from "./types";
const defaultOptions: PluginOptions<RolesPluginType> = {
config: {
can_assign: false,
can_mass_assign: false,
assignable_roles: ["558037973581430785"],
assignable_roles: [],
},
overrides: [
{
@ -41,11 +40,11 @@ export const RolesPlugin = zeppelinGuildPlugin<RolesPluginType>()({
description: trimPluginDescription(`
Enables authorised users to add and remove whitelisted roles with a command.
`),
configSchema: ConfigSchema,
configSchema: zRolesConfig,
},
dependencies: () => [LogsPlugin, RoleManagerPlugin],
configParser: makeIoTsConfigParser(ConfigSchema),
configParser: (input) => zRolesConfig.parse(input),
defaultOptions,
// prettier-ignore