harmony/src/interactions/slashModule.ts

19 lines
431 B
TypeScript
Raw Normal View History

2021-04-04 09:29:56 +00:00
import type { SlashCommandHandler } from './slashClient.ts'
export class SlashModule {
name: string = ''
commands: SlashCommandHandler[] = []
_decoratedSlash?: SlashCommandHandler[]
constructor() {
if (this._decoratedSlash !== undefined) {
this.commands = this._decoratedSlash
}
}
add(handler: SlashCommandHandler): SlashModule {
this.commands.push(handler)
return this
}
}