Refresh autocomplete options with that's dependent on the other parameter
I have a slash command with two parameters, first is the user and the second parameter is an autocomplete that is based on the selected user. But if I selected the wrong user and go back and change to a different user, the second parameter doesn't get updated? Is there a way to fix this without having the user to delete everything and restart?
e.g. if I pick user1, second parameter should have options [1, 2, 3]
if I pick user2, second paramenter should have options [4, 5, 6]
If I pick user1, and move on to second parameter, it shows 1, 2, 3; but if I go back to the first parameter and update that to user2, the second parameter does not get refreshed and still show [4, 5, 6].
5 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by staffdiscord.js version - 14.12.1
node -v - 19.6.0
No, that's how Discord's autocomplete options caching works.
you could make both options autocomplete and store their values in temp variables
That won't fix the issue. Discord Client will still cache choices per option.