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

Did you find this page helpful?