counters: add !counter view command
This commit is contained in:
parent
78ff2641d4
commit
91fde47c97
4 changed files with 153 additions and 1 deletions
|
@ -14,14 +14,32 @@ import { initCounterTrigger } from "./functions/initCounterTrigger";
|
|||
import { decayCounter } from "./functions/decayCounter";
|
||||
import { validateCondition } from "./functions/validateCondition";
|
||||
import { StrictValidationError } from "../../validatorUtils";
|
||||
import { PluginOptions } from "knub";
|
||||
import { ViewCounterCmd } from "./commands/ViewCounterCmd";
|
||||
|
||||
const MAX_COUNTERS = 5;
|
||||
const DECAY_APPLY_INTERVAL = 5 * MINUTES;
|
||||
|
||||
const defaultOptions = {
|
||||
const defaultOptions: PluginOptions<CountersPluginType> = {
|
||||
config: {
|
||||
counters: {},
|
||||
can_view: false,
|
||||
can_edit: false,
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
level: ">=50",
|
||||
config: {
|
||||
can_view: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
level: ">=100",
|
||||
config: {
|
||||
can_edit: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const configPreprocessor: ConfigPreprocessorFn<CountersPluginType> = options => {
|
||||
|
@ -69,6 +87,8 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()("counter
|
|||
offCounterEvent: mapToPublicFn(offCounterEvent),
|
||||
},
|
||||
|
||||
commands: [ViewCounterCmd],
|
||||
|
||||
async onLoad(pluginData) {
|
||||
pluginData.state.counters = new GuildCounters(pluginData.guild.id);
|
||||
pluginData.state.events = new EventEmitter();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue