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

configPreprocessor => configParser

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
metal 2023-03-12 00:37:07 +00:00 committed by GitHub
parent cd68a6083c
commit ddec78b929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 25 additions and 26 deletions

View file

@ -1,6 +1,6 @@
import { EventEmitter } from "events";
import { PluginOptions } from "knub";
import { ConfigPreprocessorFn } from "knub/dist/config/configTypes";
import { ConfigParserFn } from "knub/dist/config/configTypes";
import {
buildCounterConditionString,
CounterTrigger,
@ -55,7 +55,8 @@ const defaultOptions: PluginOptions<CountersPluginType> = {
],
};
const configPreprocessor: ConfigPreprocessorFn<CountersPluginType> = (options) => {
// TODO: Fix `any` typing
const configParser: ConfigParserFn<CountersPluginType> = (options: any) => {
for (const [counterName, counter] of Object.entries(options.config?.counters || {})) {
counter.name = counterName;
counter.per_user = counter.per_user ?? false;
@ -117,7 +118,7 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
configSchema: ConfigSchema,
defaultOptions,
configPreprocessor,
configParser,
public: {
counterExists: mapToPublicFn(counterExists),