discord-api-docs
discord-api-docs copied to clipboard
String options can have min_length be set to more than max_length
Description
String options can have min_length be set to more than max_length, making the option impossible to provide, and possibly the entire command if this argument is required.
Steps to Reproduce
register a slash command with an option that has max_length set to less than the min_length. A payload has been provided below.
{
"type": 1,
"name": "str_length_go_brr",
"dm_permission": true,
"default_permission": true,
"default_member_permissions": null,
"description": "-",
"options": [
{
"name": "option",
"description": "-",
"type": 3,
"required": true,
"min_length": 3000,
"max_length": 1
}
]
}
Expected Behavior
registration error
Current Behavior
command gets registered with an option that can never be provided.
Screenshots/Videos

Client and System Information
disnake 2.6.0a
Suggested fix: In such cases, quietly swap minimum and maximum length and treat the request as successful if there are no other errors.
Suggested fix: In such cases, quietly swap minimum and maximum length and treat the request as successful if there are no other errors.
Secretly change user input instead of properly 400ing telling them the input is in fact, incorrect?
A fix should be out soonish.