Sapphire - Imagine a framework
Sapphire - Imagine a framework

discordjs-support

Root Question Message

floppyyy
floppyyy12/24/2022
Varying parsing options?

With slash commands, is it possible to have a varying input option depending on a condition?

Say there are two input options:
The first one may ask for a channel or a role
The second one would then take a channel or a role depending on what the user picked on the first argument
Favna
Favna12/24/2022
It ain't possible
floppyyy
floppyyy12/24/2022
Would there be a good workaround for this? I'm thinking of probably handling the second argument as a string instead and check whether it's a role or a channel instead. But I'm wondering if there's a better approach
Favna
Favna12/24/2022
Wild idea but you could have both use autocomplete and then build the results based on the input of the first?
Favna
Favna12/24/2022
Seeing as slash commands don't even have a concept of "first option" and "second option". They can be provided in either order.
floppyyy
floppyyy12/24/2022
Yes, it's for a config command and I do plan on using autocomplete on the first argument for the configurable options, and have the second argument take whatever what the user wanted to configure
Favna
Favna12/24/2022
Well I have nothing but that idea :\
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy