Get Option Label

I have a command with an option that has pre-defined text choices people can choose from. I get the value of the selected option on an interactionCreate event, but would it be possible to get the name / label of the option? Thanks!
3 Replies
d.js toolkit
d.js toolkit7mo 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!
Syjalo
Syjalo7mo ago
Make an array of the options outside of the builder. Pass it to the builder and you'll be able to use that array to find the option by its value
Octoboomer
Octoboomer6mo ago
You can access the component data from interaction.data

Did you find this page helpful?