Subcommands, and CommandGroups/SubCommandGroups
Hey!, I was wondering whether it's possible to create subcommands and groups with sapphire i.e
?automod enable
-> enable is part of the automod command group
?automod ignore reset
-> ignore is part of the automod command group and reset is part of ignore
subcommand group
Is it possible to replicate something like this?8 Replies
Use the @sapphire/plugin-subcommands plugin
https://www.sapphirejs.dev/docs/Guide/plugins/Subcommands/getting-started
Thanks a lot!, Also another question how are they stored in the "stores" are they seperate commands or do they belong to a single group
they are stored alongside the parent command as properties on the class.
Oh okay that's good to hear, and is prompts possible with sapphire? not argument prompting, i mean it during when the command is in action
That is largely just a DJS feature but we do have a MessagePrompter class to safe on a lot of the boiletplating: https://www.sapphirejs.dev/docs/Documentation/api-utilities/classes/sapphire_discord_js_utilities.MessagePrompter
Alright thanks, again <3
Last question, i prolly disturbed you a lot. Is it not possible to have same features as the Command.Options in subcommand mapping array? such as attributes like description, aliases
and etc
The description field in options is meant for help commands. If you want descriptions for slash commands read our guide on registering commands. Subcommand aliases are by providing different input with the same output. You can also chuck anything in detailedDescription, see https://www.sapphirejs.dev/docs/Guide/commands/command-options#detaileddescription
Can't stress enough to consult the guide.
Sapphire Framework
Command Options | Sapphire
On this page we will cover the different options you can use when creating a [command]. For each option we will cover