command failing, no errors

const { Command } = require("@sapphire/framework");
const { EmbedBuilder } = require("discord.js");

class SettingsCommand extends Command {
constructor(context, options) {
super(context, {
...options,
description: "Edit or view server-specific settings.",
subcommands: [
{
name: "view",
chatInputRun: "chatInputView",
}
]
});
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addSubcommand((command) =>
command
.setName("view")
.setDescription("View your current settings."))
);
}

async chatInputView(interaction) {
const embed = new EmbedBuilder()
.setDescription(`**Panel URL:** link\n**Panel API Key:** ||api key||`)

return interaction.reply({ embeds: [embed] });
}
}

module.exports = {
SettingsCommand
};
const { Command } = require("@sapphire/framework");
const { EmbedBuilder } = require("discord.js");

class SettingsCommand extends Command {
constructor(context, options) {
super(context, {
...options,
description: "Edit or view server-specific settings.",
subcommands: [
{
name: "view",
chatInputRun: "chatInputView",
}
]
});
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addSubcommand((command) =>
command
.setName("view")
.setDescription("View your current settings."))
);
}

async chatInputView(interaction) {
const embed = new EmbedBuilder()
.setDescription(`**Panel URL:** link\n**Panel API Key:** ||api key||`)

return interaction.reply({ embeds: [embed] });
}
}

module.exports = {
SettingsCommand
};
this is the code for my command, and for some odd reason it just fails without giving me an errors
Solution:
Change that to Subcommand from the plugin
Jump to solution
8 Replies
ender
ender7mo ago
No description
KB
KB7mo ago
You need to use the subcommand plugin to be able to use the subcommands option.
ender
ender7mo ago
oh do i just require("@sapphire/plugin-subcommands"); im not sure how to add it
ender
ender7mo ago
my setup.js has this tho
No description
KB
KB7mo ago
Right now the command is using the Command from the framework
Solution
KB
KB7mo ago
Change that to Subcommand from the plugin
ender
ender7mo ago
thx it works
ender
ender7mo ago
damn the docs even say that