mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 05:45:02 +00:00
feat: update knub; update public interfaces for new knub
This commit is contained in:
parent
c2ae6d53d8
commit
c89c5ea430
15 changed files with 193 additions and 241 deletions
|
@ -2,7 +2,7 @@ import { EventEmitter } from "events";
|
|||
import { PluginOptions, guildPlugin } from "knub";
|
||||
import { GuildCounters } from "../../data/GuildCounters";
|
||||
import { CounterTrigger, parseCounterConditionString } from "../../data/entities/CounterTrigger";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { makePublicFn } from "../../pluginUtils";
|
||||
import { MINUTES, convertDelayStringToMS, values } from "../../utils";
|
||||
import { AddCounterCmd } from "./commands/AddCounterCmd";
|
||||
import { CountersListCmd } from "./commands/CountersListCmd";
|
||||
|
@ -62,20 +62,16 @@ export const CountersPlugin = guildPlugin<CountersPluginType>()({
|
|||
// TODO: Separate input and output types
|
||||
configParser: (input) => zCountersConfig.parse(input),
|
||||
|
||||
public: {
|
||||
counterExists: mapToPublicFn(counterExists),
|
||||
|
||||
// Change a counter's value by a relative amount, e.g. +5
|
||||
changeCounterValue: mapToPublicFn(changeCounterValue),
|
||||
|
||||
// Set a counter's value to an absolute value
|
||||
setCounterValue: mapToPublicFn(setCounterValue),
|
||||
|
||||
getPrettyNameForCounter: mapToPublicFn(getPrettyNameForCounter),
|
||||
getPrettyNameForCounterTrigger: mapToPublicFn(getPrettyNameForCounterTrigger),
|
||||
|
||||
onCounterEvent: mapToPublicFn(onCounterEvent),
|
||||
offCounterEvent: mapToPublicFn(offCounterEvent),
|
||||
public(pluginData) {
|
||||
return {
|
||||
counterExists: makePublicFn(pluginData, counterExists),
|
||||
changeCounterValue: makePublicFn(pluginData, changeCounterValue),
|
||||
setCounterValue: makePublicFn(pluginData, setCounterValue),
|
||||
getPrettyNameForCounter: makePublicFn(pluginData, getPrettyNameForCounter),
|
||||
getPrettyNameForCounterTrigger: makePublicFn(pluginData, getPrettyNameForCounterTrigger),
|
||||
onCounterEvent: makePublicFn(pluginData, onCounterEvent),
|
||||
offCounterEvent: makePublicFn(pluginData, offCounterEvent),
|
||||
};
|
||||
},
|
||||
|
||||
// prettier-ignore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue