20 lines
714 B
TypeScript
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!' });
|
|
}
|
|
} |