discord-api-docs icon indicating copy to clipboard operation
discord-api-docs copied to clipboard

Auto-complete options will fail if the next option is required and has length requirements

Open Snazzah opened this issue 3 years ago • 2 comments

Description

So I have a command /rename command with two options:

  • player which has autocomplete options and is required
  • name which is also required, and has to be between 8 and 32 characters

Turns out, the second option needs to be filled in before autocomplete options can be shown to the user if that second option has length requirements. Without doing this, any autocomplete request will 400 for the user (showing "Loading options failed") and won't even be requested from the bot.

Steps to Reproduce

  1. Create a command with the above specifications, make sure to give the first option autocomplete where you respond with some options
  2. Type within the first option

Expected Behavior

Auto-complete functions as usual, with requests to the bot returning options to the user.

Current Behavior

Auto-complete requests will return a 400 for the user (showing "Loading options failed") and won't even be requested from the bot.

Screenshots/Videos

Client and System Information

Canary 145123 (02ff179)

Snazzah avatar Sep 01 '22 19:09 Snazzah

I have this same issue but in the opposite order:

First arg deck is required with a min_length of 6, and a max_length of 6. Second arg language is optional, but uses autocomplete.

language doesn't autocomplete until the first required arg has first been filled out to 6 characters.

KevinNovak avatar Sep 05 '22 04:09 KevinNovak

I met the same problem in a different condition. I have a top level command with a single autocomplete option and it works as usual. However, when I use autocomplete in subcommands (with the only autocomplete option), it fails.

For example, /toplevelcmd autocomplete-option works well, while /somegroup subcmd autocomplete-option fails.

gimi65536 avatar Sep 21 '22 16:09 gimi65536

@gimi65536 I cant reproduce the issue youre describing, can you open a separate issue with:

  • Full application command payload
  • Create interaction payload that is failing in the client

yonilerner avatar Oct 06 '22 21:10 yonilerner

fixed in next api deploy

yonilerner avatar Oct 07 '22 21:10 yonilerner

Has this been deployed yet? I'm still experiencing the issue

KevinNovak avatar Nov 05 '22 20:11 KevinNovak

@KevinNovak Can you provide a specific example of an application command JSON and ideally an interaction create payload if you can get it from your client? Im not able to reproduce this error

yonilerner avatar Nov 08 '22 19:11 yonilerner

@yonilerner That was still a problem in Oct. 5 when I reboot my bot last time, but it has somehow been fixed now after I reboot my bot today.

gimi65536 avatar Nov 09 '22 05:11 gimi65536