Fix error on cooldown check in SelfGrantableRolesPlugin
This commit is contained in:
parent
a658ec06e7
commit
4a6f28b17b
2 changed files with 10 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { PluginOptions } from "knub";
|
import { CooldownManager, PluginOptions } from "knub";
|
||||||
import { SelfGrantableRolesPluginType, ConfigSchema, defaultSelfGrantableRoleEntry } from "./types";
|
import { SelfGrantableRolesPluginType, ConfigSchema, defaultSelfGrantableRoleEntry } from "./types";
|
||||||
import { zeppelinPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { trimPluginDescription } from "src/utils";
|
import { trimPluginDescription } from "src/utils";
|
||||||
|
@ -91,5 +91,9 @@ export const SelfGrantableRolesPlugin = zeppelinPlugin<SelfGrantableRolesPluginT
|
||||||
RoleHelpCmd,
|
RoleHelpCmd,
|
||||||
RoleRemoveCmd,
|
RoleRemoveCmd,
|
||||||
RoleAddCmd,
|
RoleAddCmd,
|
||||||
]
|
],
|
||||||
|
|
||||||
|
onLoad(pluginData) {
|
||||||
|
pluginData.state.cooldowns = new CooldownManager();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
import { BasePluginType, command } from "knub";
|
import { BasePluginType, command, CooldownManager } from "knub";
|
||||||
|
|
||||||
const RoleMap = t.record(t.string, t.array(t.string));
|
const RoleMap = t.record(t.string, t.array(t.string));
|
||||||
|
|
||||||
|
@ -26,6 +26,9 @@ export const defaultSelfGrantableRoleEntry: t.TypeOf<typeof PartialRoleEntry> =
|
||||||
|
|
||||||
export interface SelfGrantableRolesPluginType extends BasePluginType {
|
export interface SelfGrantableRolesPluginType extends BasePluginType {
|
||||||
config: TConfigSchema;
|
config: TConfigSchema;
|
||||||
|
state: {
|
||||||
|
cooldowns: CooldownManager;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const selfGrantableRolesCmd = command<SelfGrantableRolesPluginType>();
|
export const selfGrantableRolesCmd = command<SelfGrantableRolesPluginType>();
|
||||||
|
|
Loading…
Add table
Reference in a new issue