Handling StringSelectMenuInteraction

const value = menu.values[0];
const value = menu.values[0];
This is how I read the current selected value from a <StringSelectMenuCopmonent>. I receive an error stating menu.values is undefined. Why is that?
6 Replies
d.js toolkit
d.js toolkitā€¢2y 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.
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
DanielBA
DanielBAā€¢2y ago
const message = interaction.message;
const row2 = ActionRowBuilder.from(message.components[1]);
const menu = StringSelectMenuBuilder.from(row2.components[0]);
const message = interaction.message;
const row2 = ActionRowBuilder.from(message.components[1]);
const menu = StringSelectMenuBuilder.from(row2.components[0]);
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docsā€¢2y ago
property SelectMenuBuilder#data The API data associated with this component
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server