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:
parent
cd68a6083c
commit
ddec78b929
9 changed files with 25 additions and 26 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue