plugin-subcommands "No subcommand was matched"

I'm configuring my subcommand with:
@ApplyOptions<Subcommand.Options>({
name: "config",
subcommands: [
{
...
},
{
name: "logs",
entries: [
{ name: "on", chatInputRun: "chatInputLogsOn" },
{ name: "off", chatInputRun: "chatInputLogsOff" },
],
},
],
})
@ApplyOptions<Subcommand.Options>({
name: "config",
subcommands: [
{
...
},
{
name: "logs",
entries: [
{ name: "on", chatInputRun: "chatInputLogsOn" },
{ name: "off", chatInputRun: "chatInputLogsOff" },
],
},
],
})
No errors occur, but /config logs on (which yes, i have registered) spits out "UserError: No subcommand was matched with the provided command."
Solution:
The solution: ```diff { name: "logs",...
Jump to solution
14 Replies
log(n)
log(n)2y ago
WAIT, let me see if it could be a ts5 issue
Favna
Favna2y ago
Silly question maybe but have you called the /register of the plugin?
log(n)
log(n)2y ago
Yes, I originally thought this was the issue because I forgot it, but it's there now
Favna
Favna2y ago
Otherwise set debug breakpoints in the JS code in node_modules tbh. Can't really give any other tips seeing as you seem to have covered all bases. Well other than dumping all code here and me or someone else would do the same but if you can do it yourself it's 1. A very good learning experience 2. Saves other people work kekw
log(n)
log(n)2y ago
I was having issues with my database due to a typescript version (breaking decorator changes), what TS version should i be on?
Favna
Favna2y ago
5 is fine Just make sure you use the experimental decorator compiler option Setting those to true uses legacy decorators still
log(n)
log(n)2y ago
Hmm.. looks like mapping.type is set to method automatically in @sapphire/plugin-subcommands/dist/lib/Subcommand.js:189 which bypasses the check on :192
log(n)
log(n)2y ago
log(n)
log(n)2y ago
log(n)
log(n)2y ago
Am I supposed to explicitly pass type: group? I am. That would be my issue!
Solution
log(n)
log(n)2y ago
The solution:
{
name: "logs",
+ type: "group",
entries: [
{
name: "logs",
+ type: "group",
entries: [
Favna
Favna2y ago
Oh haha Yes I forgot Pretty sure the documentation specify that Well typedoc so on hover
Favna
Favna2y ago
Docs say it too
Want results from more Discord servers?
Add your server