Tedz
Tedz
SIASapphire - Imagine a framework
Created by Tedz on 8/2/2023 in #sapphire-support
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.
10 replies