Decorator Style for Register Subcommands
Is there a Short Style possible for that? Like That for normal Slash-Commands
13 Replies
@! naeko.moe ‘s advanced plugin has decorators https://github.com/kaname-png/neko-plugins/tree/main/packages/subcommands-advanced
GitHub
neko-plugins/packages/subcommands-advanced at main · sawa-ko/neko-p...
Plugins for @sapphire/framework. Contribute to sawa-ko/neko-plugins development by creating an account on GitHub.
That Sounds kinda complicated. So if i dont want to use that i need to use it the Normal Way?
Solution
The official plugin doesn’t have decorators for subcommands so yes
Will it come in the future? 🥺
The primary reason it doesn’t is because decorators are (for now) TS only and the sapphire design philosophy states that code has to work for both Js and Ts. Once Ecmascript decorators are shipped in an LTS version of Node we can look into adding them to the package but when that will be I cannot say.
Once decorators are in Node we can also migrate @sapphire/decorators to be natively in the framework for example.
Just to be sure i need this core, right? Or Anthing else?
NVM I`ll try it out sorry 🙈
You cannot have both groups and non groups at the top level.
command group… subcommand…
command subcommand…
Those are the 2 valid structures (wherein … denotes multiple)
Wdym? I dont understand
You cannot have both addSubcommand and addSubcommandGroup on the top level
According to Dev Docs both is valid?
https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Why? Its in the official Sapphire Docs too btw.
Oh my bad apparently that is possible I guess
Tysm for your help it works! You are really Awesome