harmony/src/interactions/slashModule.ts

18 lines
416 B
TypeScript

import type { SlashCommandHandler } from './slashClient.ts'
export class SlashModule {
name: string = ''
commands: SlashCommandHandler[] = []
constructor() {
if ((this as any)._decoratedSlash !== undefined) {
;(this as any).commands = (this as any)._decoratedSlash
}
}
add(handler: SlashCommandHandler): SlashModule {
this.commands.push(handler)
return this
}
}