Adding options of select menu in if statements using select menu builder before it is sent
I have a question about updating components. I have it so in the function it previously does up to this:
and then later I try this within an if statement:
and I have it do it once more after another if statement. In some cases, it'll pass through both statements. How can I solve this so it stays within the same select menu?
7 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
14.7.1, v18.1.0
How can I make it so I use part of the ActionRowBuilder() to create the select menu then later add more options to it? << is the simplified version of the question 🙂
Hm... if you are constructing the select menu before sending it, then instead of creating the entire action row, just create the select menu first
const selectMenu = new StringSelectMenuBuilder()
then in your if statements, add the new options like this selectMenu.addOptions(theoption)
finally at the end add the select menu to the action row
const row = new ActionRowBuilder().addComponents(selectMenu)
Okay I will try this out, thank you!
sure, please tell if you have any issues
Amazing, it works, thank you very much!