Slash Commands: add variadic arguments #3286
Replies: 18 comments 6 replies
-
this:tm: I was wondering the same thing as in my bot you can mute up to 5 people at once but I dont want to do the whole [required] (optional) (optional) (optional) (optional) thing |
Beta Was this translation helpful? Give feedback.
-
Seeing as arguments can be passed in any order, I'm editing this proposal to allow making all arguments variadic. |
Beta Was this translation helpful? Give feedback.
-
Totally valid suggestion. There's a couple ways to probably solve this:
Both have pros and cons, mostly around UX on both the dev and the user side of things. If you wanted to ban a bunch of users, for example, getting an array of users is probably better than getting 50 |
Beta Was this translation helpful? Give feedback.
-
One example command I have that's variadic is my With slash commands, it could be notated as something like |
Beta Was this translation helpful? Give feedback.
-
I would imagine the poll command to look something like this More generally speaking: The type of the received value of variadic arguments is an array of |
Beta Was this translation helpful? Give feedback.
-
👋 Would like to +1 this and provide another use-case example -- I'd like to rewrite the 1.1.1.1 DNS over Discord bot to use interactions, and the command format I'm aiming for would be |
Beta Was this translation helpful? Give feedback.
-
👀 Given the announcement that message content access is being deprecated, just wanted to bump to see if there had been any progress in terms of variadic support? It'd be nice to be able to have first-class support for arrays rather than simply just porting over custom list parsing from existing message-content-based workflows. |
Beta Was this translation helpful? Give feedback.
-
My bot has several commands that allow to define multiple users through mentions. Most people that use my bot enjoy the fact that they f.e. can hug or pat more than one user, as it allows them to "Spread happiness and love to multiple people" to quote one user. |
Beta Was this translation helpful? Give feedback.
-
My use case is assigning multiple users and labels to a github issue. I can temporarily work around this by adding multiple options named |
Beta Was this translation helpful? Give feedback.
-
could also be useful for flags. I.e. /ban user:@user flags:["save-messages", "delete-attachments"] |
Beta Was this translation helpful? Give feedback.
-
Since "editable pills" (as Mason has described them) are going to become a thing in the future for slash commands, what if we had a UX system very much like how doing the image shown below could be viewed, and we're returned back a list example as @Mineinjava said e.g. |
Beta Was this translation helpful? Give feedback.
-
Yes, please add this. For my use case, I need to be able to mention multiple roles that I can ping to notify them of a new giveaway.
|
Beta Was this translation helpful? Give feedback.
-
This would be quite useful, is there any update on this? |
Beta Was this translation helpful? Give feedback.
-
desperately need this for variadic choice parameters - the other options are:
|
Beta Was this translation helpful? Give feedback.
-
Figured I'd check to see if anyone knows if progress has been made on this feature in the year+ since the last activity. I would love to use it for my /input_mined_resources command so I can have a user input many pairs of . |
Beta Was this translation helpful? Give feedback.
-
I'd love to see this implemented. Would be extremely useful! |
Beta Was this translation helpful? Give feedback.
-
Almost 3 years and the request continues to be ignored... |
Beta Was this translation helpful? Give feedback.
-
I'd love to see this made possible ! I did it as a prefix command, but would love to make it possible as a slash command too... |
Beta Was this translation helpful? Give feedback.
-
Description
Add the possibility to make arguments variadic, i.e making them useable more than once.
Required variadic arguments need to be specified at least once, optional ones don't need to specified at all.
Why This is Needed
Variadic arguments can be often be used to make the usage of commands easier, and remove the need to execute a command multiple times. A very basic example would be a
mute
command that takes in multiple users, to mute all of them simultaneously.While in this example the variadic argument could simply be replaced by multiple calls to
mute
, there are also cases where variadic arguments act as additional data. For example, apoll create
command could take in a variadicpoll options
argument, which allows the user to specifies multiple possible answers.Alternatives Considered
There is no real alternative. The only way to use variadic arguments would be to parse the last argument manually.
Beta Was this translation helpful? Give feedback.
All reactions