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
ender12mo ago
No description
KB
KB12mo ago
You need to use the subcommand plugin to be able to use the subcommands option.
ender
ender12mo ago
oh do i just require("@sapphire/plugin-subcommands"); im not sure how to add it
ender
ender12mo ago
my setup.js has this tho
No description
KB
KB12mo ago
Right now the command is using the Command from the framework
Solution
KB
KB12mo ago
Change that to Subcommand from the plugin
ender
ender12mo ago
thx it works
ender
ender12mo ago
damn the docs even say that
Want results from more Discord servers?
Add your server