monorepo/apps/bot/.sapphire/templates/commands/slash-command.ts
2024-12-09 12:01:58 +00:00

19 lines
642 B
TypeScript

import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';
@ApplyOptions<Command.Options>({
description: 'A basic slash command'
})
export class UserCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand((builder) =>
builder //
.setName(this.name)
.setDescription(this.description)
);
}
public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
return interaction.reply({ content: 'Hello world!' });
}
}