fix: broken config regex parsing

This commit is contained in:
Dragory 2023-04-02 03:18:55 +03:00
parent d231c72a5b
commit 9d4e9cf364
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
8 changed files with 29 additions and 54 deletions

View file

@ -1,7 +1,6 @@
import * as t from "io-ts";
import { CooldownManager, PluginOptions } from "knub";
import { trimPluginDescription } from "../../utils";
import { validate } from "../../validatorUtils";
import { parseIoTsSchema } from "../../validatorUtils";
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
import { RoleAddCmd } from "./commands/RoleAddCmd";
import { RoleHelpCmd } from "./commands/RoleHelpCmd";
@ -84,12 +83,7 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
}
}
const error = validate(ConfigSchema, input);
if (error) {
throw error;
}
return input as t.TypeOf<typeof ConfigSchema>;
return parseIoTsSchema(ConfigSchema, input);
},
defaultOptions,