Error please help

import { ApplyOptions } from '@sapphire/decorators';
import { Command, RegisterBehavior } from '@sapphire/framework';
import { send } from '@sapphire/plugin-editable-commands';
import { Subcommand } from '@sapphire/plugin-subcommands';
import type { Message } from 'discord.js';

@ApplyOptions<Subcommand.Options>({
aliases: ['sollicitatie'],
description: 'Solliciteer bij Dirk Giveaway',
subcommands: [
{
name: 'marketing',
messageRun: 'messageReset'
},
{
name: 'support',
messageRun: 'messageShow',
default: true
}
]
})


export class UserCommand extends Subcommand {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(builder => builder
.setName('sollicitatie')
.setDescription(this.description)

, { behaviorWhenNotIdentical: RegisterBehavior.Overwrite }
);
}
public async messageShow(message: Message) {
return send(message, 'Test - Support!');
}

public async messageReset(message: Message) {
return send(message, 'Test - Marketing!');
}
}
import { ApplyOptions } from '@sapphire/decorators';
import { Command, RegisterBehavior } from '@sapphire/framework';
import { send } from '@sapphire/plugin-editable-commands';
import { Subcommand } from '@sapphire/plugin-subcommands';
import type { Message } from 'discord.js';

@ApplyOptions<Subcommand.Options>({
aliases: ['sollicitatie'],
description: 'Solliciteer bij Dirk Giveaway',
subcommands: [
{
name: 'marketing',
messageRun: 'messageReset'
},
{
name: 'support',
messageRun: 'messageShow',
default: true
}
]
})


export class UserCommand extends Subcommand {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(builder => builder
.setName('sollicitatie')
.setDescription(this.description)

, { behaviorWhenNotIdentical: RegisterBehavior.Overwrite }
);
}
public async messageShow(message: Message) {
return send(message, 'Test - Support!');
}

public async messageReset(message: Message) {
return send(message, 'Test - Marketing!');
}
}
2024-04-23 21:57:10 - ERROR - Encountered error on chat input command "sollicitatie" at path "C:\Users\femke\OneDrive\Documents\BOTDIRK\DirkBot\dist\commands\General\sollicitatie.js" UserError: No subcommand was matched with the provided command.
19 Replies
Lioness100
Lioness100•4mo ago
I'm not sure if this is your error, but you need to add subcommands to the builder. Ex:
registry.registerChatInputCommand(builder => builder
.setName('sollicitatie')
.setDescription(this.description)
.addSubcommand(builder => builder
.setName('marketing')
// ...
)
, { behaviorWhenNotIdentical: RegisterBehavior.Overwrite }
);
registry.registerChatInputCommand(builder => builder
.setName('sollicitatie')
.setDescription(this.description)
.addSubcommand(builder => builder
.setName('marketing')
// ...
)
, { behaviorWhenNotIdentical: RegisterBehavior.Overwrite }
);
Favna
Favna•4mo ago
oh no not enough Dutch person in this server @A guy named Jensbot
A guy named Jensbot
A guy named Jensbot•4mo ago
oh
Favna
Favna•4mo ago
inb4 applying for a job at the Dirk shop or something
A guy named Jensbot
A guy named Jensbot•4mo ago
Dirk 🤔
BigBrainAFK
BigBrainAFK•4mo ago
lol Dirk bot look out in a few week AH comes knocking and asks for help with their bot
Favna
Favna•4mo ago
lmao
Favna
Favna•4mo ago
Labs | Albert Heijn
Bonusaanbiedingen, recepten, openingstijden en online boodschappen doen. Gewoon bij Albert Heijn.
BigBrainAFK
BigBrainAFK•4mo ago
really wonder if this is actually for dirk. ngl getting discounts in discord sound like a likely future
Favna
Favna•4mo ago
btw @Tessa on topic I think @Lioness100 answered your question already, you can ignore our banter. Or join I guess. We Dutch are weird like that tbh.
Indium
Indium•4mo ago
This is not for dirk It's also a male name It's for my friends server
Favna
Favna•4mo ago
I think we all know, it's a very common name after all 🙂 btw assuming you're tracking the code with git I recommend moving it out of your OneDrive folder. OneDrive can be fucky with git.
Indium
Indium•4mo ago
Exactly Oh damn
Favna
Favna•4mo ago
there's too many tiny files in the .git folder for OneDrive (or any drive sync for that matter) to properly track
Indium
Indium•4mo ago
Ag Ah I'm used to Linux I didn't even install onedrive rip
Favna
Favna•4mo ago
btw you were also mixing messageRun (mesage based commands) and Chat Input Commands above
Indium
Indium•4mo ago
I'm new to this framework xd
Favna
Favna•4mo ago
your subcommands config suggests message commands but your question suggests chat input commands
Favna
Favna•4mo ago
https://sapphirejs.dev that's what we have a guide for
Sapphire Framework
Home | Sapphire
Sapphire is a next-gen Discord bot framework for developers of all skill levels to make the best JavaScript/TypeScript based bots possible.