SlashHandler
Base class for a chat-input (slash) command handler.
Pass the route from the generated registry as the generic, the same string as @SlashRoute@SlashRoute, then read this.optionsthis.options for a single command or this.matchthis.match for several. Command authoring stays plain discord.js, seedcord codegenseedcord codegen reads its toJSON()toJSON() to type these options.
abstract class SlashHandler<
Route extends keyof SlashOptionRegistry,
Cache extends CacheType = "cached"
> extends InteractionHandler<ChatInputCommandInteraction<Cache>>abstract class SlashHandler<
Route extends keyof SlashOptionRegistry,
Cache extends CacheType = "cached"
> extends InteractionHandler<ChatInputCommandInteraction<Cache>>Member visibility
Filter class members by access level.
Route
One or more route keys from SlashOptionRegistry, e.g. 'ban''ban' or 'ban' | 'kick''ban' | 'kick'.
Route extends keyof SlashOptionRegistryRoute extends keyof SlashOptionRegistryCache
The interaction cache state, 'cached''cached' by default.
The typed options for this command's route. Required options drop the null, choices narrow to their literal union, and only the getters for kinds this command actually uses appear. Use this.event.optionsthis.event.options directly for anything outside this view, such as narrowing a channel option by type.
protected options: SlashOptions<Route, Cache>protected options: SlashOptions<Route, Cache>protected async match<Ret>(
arms: SlashMatchArms<Route, Cache, Ret>
): Promise<Ret>protected async match<Ret>(
arms: SlashMatchArms<Route, Cache, Ret>
): Promise<Ret>armsOne handler per registered route, keyed by route string.