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:Jump to 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!
7 Replies
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
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
?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
use a string argument which can resolve mentions, or use something like select menus
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
It's built into discord
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!