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

20 lines
714 B
TypeScript

import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';
import { ApplicationCommandType } from 'discord.js';
@ApplyOptions<Command.Options>({
description: 'A basic contextMenu command'
})
export class UserCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerContextMenuCommand((builder) =>
builder //
.setName(this.name)
.setType(ApplicationCommandType.Message)
);
}
public override async contextMenuRun(interaction: Command.ContextMenuCommandInteraction) {
return interaction.reply({ content: 'Hello world!' });
}
}