Slash Commands Integer Option max and min #3327
-
Description Why This is Needed Alternatives Considered |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
I would like to improve on this suggestion by adding the following: There is currently no option to select the acceptable range of integers for the The ideal option would be to have an extra method on the integer to select ranges of integers that are acceptable for the option. The method should default to the full range when no ranges are provided. The builder should provide warnings when integer ranges overlap in some method to the developer. In addition, the builder should allow a step feature for cases that the developer wants to only select ranges in steps of 2, 3, 4, 5, etc. The alternative option would be to manually check the integer option(s) passed with their acceptable range and send an ephemeral message to the user who invocated the slash command to let them the number is out of range. This, however, is very clunky because it includes about five extra lines per option to validate. Discord Slash commands are useful for bot builders because they simplified interactions with users through a select range of options making it unnecessary to lint all responses with a regular expression for correctness. This problem seems like something that would be best fixed on Discord's side rather than on the consumer side of the library. In addition to that, I think that adding a similar option for the |
Beta Was this translation helpful? Give feedback.
-
While this does not give you what you want. The obvious choice is to instead request a new slider component rather than what you are asking for. (Using slash commands for something like this is analogous to using js for a discord bot..... aka bringing a hammer to a chess game 🦆 ) edit: what kind of volume dial goes from 0 to 200? no wonder your users are confused. make it go from 0 to 100 like a normal person. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
What about min_value & max_value for STRING types. So a character length limit. |
Beta Was this translation helpful? Give feedback.
min_value
andmax_value
have been implemented on slash command options: https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure