Updating Select Menu
Hello, I need to refresh the select menu, so nothing would be selected and my description would be updated.
I saw the only solution -
interaction.update()
, but then can I better maybe have the ActionRowBuilder constructor in a different file and get it when I want to update the message?6 Replies
- 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!Structures from the API cannot be edited directly. To do so, you can create a new structure (a builder) using the
.from()
method
Not sure though, I have tried
interaction.update({ components: ActionRowBuilder.from(select(interaction)).components });
, the select function returns of the constructor of ActionRowBuilder<StringSelectMenuBuilder>
But TS doesn't like it:
I have also tried what you told about interaction.message.components
, but it isn't assignable to the types of .from()
Alright, but then why won't interaction.message.components
work? Should be raw data by now...?
ActionRowBuilder.from(interaction.message.components).components
If you want embed and menu stay the same you can try
interaction.update({})
Already doing that š
š, thank you. But still having
In TypeScript the
ActionRowBuilder
class has a generic type parameter that specifies the type of component the action row holds: