3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 04:25:01 +00:00

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,4 +1,3 @@
import * as t from "io-ts";
import { configUtils, CooldownManager } from "knub";
import { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels";
import { GuildArchives } from "../../data/GuildArchives";
@ -9,7 +8,7 @@ import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
import { MINUTES, SECONDS } from "../../utils";
import { registerEventListenersFromMap } from "../../utils/registerEventListenersFromMap";
import { unregisterEventListenersFromMap } from "../../utils/unregisterEventListenersFromMap";
import { StrictValidationError, validate } from "../../validatorUtils";
import { parseIoTsSchema, StrictValidationError } from "../../validatorUtils";
import { CountersPlugin } from "../Counters/CountersPlugin";
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
import { LogsPlugin } from "../Logs/LogsPlugin";
@ -181,12 +180,7 @@ const configParser = (input: unknown) => {
}
}
const error = validate(ConfigSchema, input);
if (error) {
throw error;
}
return input as t.TypeOf<typeof ConfigSchema>;
return parseIoTsSchema(ConfigSchema, input);
};
export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({