Autocomplete options fields of the `/` command.

Good morning. I wanted to come and ask you a question about the autocompletion of the options fields of a / command. When applying autocompletion to a single option field: let's say I have the /help command with option => command, when I simply need to apply autocompletion to a single option field I manage to find the solution. However, I did some research, and when I want to apply autocompletion to several fields: Let's take the example of the /funny command, which takes the option => title, color and category, here I want to apply autocompletion to the color option and the category option but with different values ​​outside, I can't find how to achieve this. I thought of making a condition that checks if the focus option is the color option or if the focus option is the category option. But it doesn't work, I can't even get the option separately. Do you have an idea to guide me?
3 Replies
d.js toolkit
d.js toolkit12mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Squid
Squid12mo ago
getFocused(true) returns a { name, value } object: the name is either color or category, and the value is whatever the user typed into the option
🖤 • Nelson • 🖤
Ok, so from the getFocus(true) I do a .name to retrieve the value of the name of my options?