Message Context Menu Command Not Registering

I am attempting to create a command that shows up when selecting a message. The command code (in src/commands) is:
import { Command } from '@sapphire/framework';
import { ApplicationCommandType } from 'discord.js';

export class RequestDeleteCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
super(context, { ...options, description: 'Request message be deleted.' });
}

public override registerApplicationCommands(registry: Command.Registry) {
registry.registerContextMenuCommand((builder) =>
builder //
.setName('Request Delete')
.setType(ApplicationCommandType.Message)
);
}

public async contextMenuRun(interaction: Command.ContextMenuCommandInteraction) {
return interaction.reply('Pong');
}
}
import { Command } from '@sapphire/framework';
import { ApplicationCommandType } from 'discord.js';

export class RequestDeleteCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
super(context, { ...options, description: 'Request message be deleted.' });
}

public override registerApplicationCommands(registry: Command.Registry) {
registry.registerContextMenuCommand((builder) =>
builder //
.setName('Request Delete')
.setType(ApplicationCommandType.Message)
);
}

public async contextMenuRun(interaction: Command.ContextMenuCommandInteraction) {
return interaction.reply('Pong');
}
}
However no command shows up in Discord and no evidence of the application being registed showed in the console.
5 Replies
b1nzee
b1nzee17mo ago
Hmmm I'm on mobile so I may be overlooking Have you put this command inside the "commands" directory?
Tedz
TedzOP17mo ago
yes
Tedz
TedzOP17mo ago
No description
Tedz
TedzOP17mo ago
Ah its fixed i think Its because I hadnt set a main value in package.json so it probably wasnt seeing the commands folder
b1nzee
b1nzee17mo ago
Yeah, that was the issue then 100%
Want results from more Discord servers?
Add your server