Components V2 Select menu

how to make a select menu using Components V2 ? cuz i try smth and it return me an error
const notificationSelectMenu = new StringSelectMenuBuilder()
.setCustomId("notification_roles")
.setMinValues(1)
.setMaxValues(3)
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel("Creator Notifications")
.setValue("1194780165713166347")
.setEmoji(":Twitch:"),
new StringSelectMenuOptionBuilder()
.setLabel("Alliance Updates")
.setValue("1194781137885737092")
.setEmoji("🤝")
// Ajouter d'autres options ici
);

container.addSectionComponents(
new SectionBuilder().addTextDisplayComponents(
new TextDisplayBuilder().setContent(
"## 📢 What CnR-related content are you interested in?"
)
)
);

container.addActionRowComponents((row) =>
row.addComponents(notificationSelectMenu)
);
const notificationSelectMenu = new StringSelectMenuBuilder()
.setCustomId("notification_roles")
.setMinValues(1)
.setMaxValues(3)
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel("Creator Notifications")
.setValue("1194780165713166347")
.setEmoji(":Twitch:"),
new StringSelectMenuOptionBuilder()
.setLabel("Alliance Updates")
.setValue("1194781137885737092")
.setEmoji("🤝")
// Ajouter d'autres options ici
);

container.addSectionComponents(
new SectionBuilder().addTextDisplayComponents(
new TextDisplayBuilder().setContent(
"## 📢 What CnR-related content are you interested in?"
)
)
);

container.addActionRowComponents((row) =>
row.addComponents(notificationSelectMenu)
);
No description
9 Replies
d.js toolkit
d.js toolkit3d 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
treble/luna
treble/luna3d ago
a section needs an accessory that being a button or thumbnail
Baldy
BaldyOP3d ago
oh so i absolutely need a button or thumbnail to add a select after ?
treble/luna
treble/luna3d ago
for sections, yes
Baldy
BaldyOP3d ago
oh okay will check this ah true xD btw i want to add a thumbnail but dont know is possible before so i can keep the section xD last question, how did u add thumbnail to a section ?
d.js docs
d.js docs3d ago
:method: SectionBuilder#setThumbnailAccessory() [email protected] Sets the accessory of this section to a thumbnail.
Baldy
BaldyOP3d ago
thx oh okay my bad i put the accessory in wrong spot xD
Baldy
BaldyOP3d ago
apparently it work (wrong url but it work xD)
No description
Baldy
BaldyOP3d ago
thx :>

Did you find this page helpful?