Slash Command - The application did not respond - nothing in console.

I've set up a slash command, it appears in discord, but when I run it I get "The application did not respond". The application log doesn't show any activity. This is a shortened version of my command.
import {Command, container} from "@sapphire/framework";
import {ChannelType} from "discord-api-types/v10";

class SalCommand extends Command {
constructor(context, options) {
super(context, {
...options,
name: 'sal',
subcommands: [
{
name: 'create-event',
chatInputRun: 'chatInputCreateEvent'
},
]
});
}

async chatInputCreateEvent(interaction, context) {
console.info('Creating Event');
const name = 'Event Name';
return interaction.reply({
content: `Your event, ${name}, has been created`
})
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription('The root command')
.addSubcommand((builder) =>
builder
.setName('create-event')
.setDescription('Create a new Snakes and Ladders event')
.addChannelOption((option) =>
option
.setName('watch-channel')
.setDescription('The channel to watch for drops')
.setRequired(true)
.addChannelTypes(ChannelType.GuildText)
)
.addChannelOption((option) =>
option
.setName('message-channel')
.setDescription('The channel where update messages should be sent')
.setRequired(true)
.addChannelTypes(ChannelType.GuildText)
)
.addStringOption((option) =>
option
.setName('event-json')
.setDescription('The json representing the event')
.setRequired(true)
)
)
)
}
}

export {SalCommand};
import {Command, container} from "@sapphire/framework";
import {ChannelType} from "discord-api-types/v10";

class SalCommand extends Command {
constructor(context, options) {
super(context, {
...options,
name: 'sal',
subcommands: [
{
name: 'create-event',
chatInputRun: 'chatInputCreateEvent'
},
]
});
}

async chatInputCreateEvent(interaction, context) {
console.info('Creating Event');
const name = 'Event Name';
return interaction.reply({
content: `Your event, ${name}, has been created`
})
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription('The root command')
.addSubcommand((builder) =>
builder
.setName('create-event')
.setDescription('Create a new Snakes and Ladders event')
.addChannelOption((option) =>
option
.setName('watch-channel')
.setDescription('The channel to watch for drops')
.setRequired(true)
.addChannelTypes(ChannelType.GuildText)
)
.addChannelOption((option) =>
option
.setName('message-channel')
.setDescription('The channel where update messages should be sent')
.setRequired(true)
.addChannelTypes(ChannelType.GuildText)
)
.addStringOption((option) =>
option
.setName('event-json')
.setDescription('The json representing the event')
.setRequired(true)
)
)
)
}
}

export {SalCommand};
Solution:
If you want to use subcommands you need to extend the class Subcommand from @sapphire/plugin-subcommands, not Comand from @sapphire/framework.
Jump to solution
3 Replies
Ashachor
AshachorOP6mo ago
Framework and plugins
"dependencies": {
"@sapphire/framework": "^5.2.1",
"@sapphire/plugin-subcommands": "^6.0.3",
"@sapphire/utilities": "^3.16.2",
"discord-api-types": "^0.37.91",
"discord.js": "^14.15.3",
"dotenv": "^16.4.5",
"sqlite3": "^5.1.7"
}
"dependencies": {
"@sapphire/framework": "^5.2.1",
"@sapphire/plugin-subcommands": "^6.0.3",
"@sapphire/utilities": "^3.16.2",
"discord-api-types": "^0.37.91",
"discord.js": "^14.15.3",
"dotenv": "^16.4.5",
"sqlite3": "^5.1.7"
}
Solution
Favna
Favna6mo ago
If you want to use subcommands you need to extend the class Subcommand from @sapphire/plugin-subcommands, not Comand from @sapphire/framework.
Ashachor
AshachorOP6mo ago
Totally missed that in the documentation. Thank you so much!
Want results from more Discord servers?
Add your server