import { CooldownManager, guildPlugin, PluginOptions } from "knub"; import { RoleAddCmd } from "./commands/RoleAddCmd"; import { RoleHelpCmd } from "./commands/RoleHelpCmd"; import { RoleRemoveCmd } from "./commands/RoleRemoveCmd"; import { SelfGrantableRolesPluginType, zSelfGrantableRolesConfig } from "./types"; const defaultOptions: PluginOptions = { config: { entries: {}, mention_roles: false, }, }; export const SelfGrantableRolesPlugin = guildPlugin()({ name: "self_grantable_roles", configParser: (input) => zSelfGrantableRolesConfig.parse(input), defaultOptions, // prettier-ignore messageCommands: [ RoleHelpCmd, RoleRemoveCmd, RoleAddCmd, ], beforeLoad(pluginData) { pluginData.state.cooldowns = new CooldownManager(); }, });