Variable slash command argument parsing

Is it possible to have slash commands with a variable amount of arguments, up to perhaps 20? If not I think I will parse a string but wanted to check if there's a batter way to do this.
Solution:
I see, yeah that would work but I want it to be possible for text that is not a mention to resolve too. I've decided to write my own resolvers to that end, but thanks for the help!
Jump to solution
7 Replies
24
242y ago
No, slash commands by design cannot have arbitrary amount of arguments. You can do optional arguments, but you cannot have a variable amount of args
bomi
bomi2y ago
Now im not exactly sure what type of command you are making. But maybe you could use autocomplete to the same effect. Are you doing something like >inv group=blah name=blah ?
Ravelt
Ravelt2y ago
My use case is more like for example, a command that will send the same message to multiple channels all at once. For example /send hi #channel1 #channel2 ... #channelx. Which could be accomplished via optional arguments, but those have a limit of 10? i believe so I want a solution that would be less limited
24
242y ago
use a string argument which can resolve mentions, or use something like select menus
Ravelt
Ravelt2y ago
Is there a way to do the former already (i.e. given string and type of argument to resolve, return array of resolved objects) or would I have to implement myself
24
242y ago
It's built into discord
Solution
Ravelt
Ravelt2y ago
I see, yeah that would work but I want it to be possible for text that is not a mention to resolve too. I've decided to write my own resolvers to that end, but thanks for the help!
Want results from more Discord servers?
Add your server