Can I make a list of options for each user separately in Slash command?

For example, each user has different data:
{
"441331402856857601": [
"Orange",
"Green"
],
"929830815699984475": [
"Blue"
]
}
{
"441331402856857601": [
"Orange",
"Green"
],
"929830815699984475": [
"Blue"
]
}
Can I make it so that the options list only offers the colors that the user has?
option.setName('name')
.setDescription('choose color')
.setRequired(true)
.addChoices(
colors
)
option.setName('name')
.setDescription('choose color')
.setRequired(true)
.addChoices(
colors
)
6 Replies
d.js toolkit
d.js toolkit6mo ago
- 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 OP
Svitkona
Svitkona6mo ago
no, options are statically defined if you want something more dynamic you need to use autocomplete, though they aren't really equivalent
lolmak
lolmakOP6mo ago
I've seen implementations of this in other bots. Could it be that it's just not in Discord.js?
Svitkona
Svitkona6mo ago
no
d.js docs
d.js docs6mo ago
:guide: Slash Commands: Autocomplete read more
lolmak
lolmakOP6mo ago
Yes, indeed. Thanks, guys.
Want results from more Discord servers?
Add your server