counters: add '!counters add' and '!counters set' commands

This commit is contained in:
Dragory 2021-02-13 22:43:33 +02:00
parent a18b093419
commit 0f14f75020
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
3 changed files with 289 additions and 1 deletions

View file

@ -16,6 +16,8 @@ import { validateCondition } from "./functions/validateCondition";
import { StrictValidationError } from "../../validatorUtils";
import { PluginOptions } from "knub";
import { ViewCounterCmd } from "./commands/ViewCounterCmd";
import { AddCounterCmd } from "./commands/AddCounterCmd";
import { SetCounterCmd } from "./commands/SetCounterCmd";
const MAX_COUNTERS = 5;
const DECAY_APPLY_INTERVAL = 5 * MINUTES;
@ -87,7 +89,12 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()("counter
offCounterEvent: mapToPublicFn(offCounterEvent),
},
commands: [ViewCounterCmd],
// prettier-ignore
commands: [
ViewCounterCmd,
AddCounterCmd,
SetCounterCmd,
],
async onLoad(pluginData) {
pluginData.state.counters = new GuildCounters(pluginData.guild.id);