Responding to Select Menus Options

Hey, I've made a Select Menu with 2 options, and I understand how to make the bot receive interaction as far the Select Menu goes, but I am having trouble understanding how to filter out each of the option and send an embed depending on that This is the code for the Select Menu:
let SelectMenu = new Discord.ActionRowBuilder().setComponents(
new Discord.SelectMenuBuilder()
.setCustomId("categories")
.setPlaceholder("Select a Help Category!")
.setOptions([
{ label: "General", value: "General" },
{ label: "Fun", value: "Fun" },
])
);
let SelectMenu = new Discord.ActionRowBuilder().setComponents(
new Discord.SelectMenuBuilder()
.setCustomId("categories")
.setPlaceholder("Select a Help Category!")
.setOptions([
{ label: "General", value: "General" },
{ label: "Fun", value: "Fun" },
])
);
13 Replies
d.js docs
d.js docs2y 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.
Danial
Danial2y ago
Node - 16.15.1
d.js docs
d.js docs2y ago
guide Interactions: Receiving Select menus read moreguide Interactions: Responding to select menus read more
Danial
Danial2y ago
I've been reading that exact page for a while, but I still can't seem to understand, it shows how to respond to a select menu, but not each option unless I a missing that part?
Dagan
Dagan2y ago
It does
Dagan
Dagan2y ago
Danial
Danial2y ago
Yes, but isn't that the Custom ID of the select menu?
Dagan
Dagan2y ago
Oh yeah sorry ill look firther for you
Danial
Danial2y ago
No worries, that's where I am having trouble, I tried using Custom ID for options, and that didn't work so I don't think that's how you do it
Dagan
Dagan2y ago
Ill send the code to get an array with everything thats selected I found it oh i saw wrong thing but could tou try interaction.values out I think that should work interaction.values
Danial
Danial2y ago
Okay, I'll try that I tried something, that obviously didn't work, can you tell me how I'd filter out options using that?
Dagan
Dagan2y ago
What would you like to filter out exactly? And send what youve tried ^^^ if it wasnt clear already I thought i said it pretty clear but maybe not thanks for resaying it if i didnt already
Danial
Danial2y ago
I think I understand but can you maybe send some code as an example so I can pick up everything properly? Yep, thank you so much