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