Disable select menu after use - interaction.update()

const tempComponent = interaction.message.components[0];
tempComponent.components[0].disabled = true;

await interaction.update({
components: [tempComponent],
});
const tempComponent = interaction.message.components[0];
tempComponent.components[0].disabled = true;

await interaction.update({
components: [tempComponent],
});
Hello, I want to disable a select menu after use with the interaction.update() function, because it didn't work with an interaction.message.edit(). I think it's over for me :')
6 Replies
d.js toolkit
d.js toolkit12mo 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
Wissem.
Wissem.OP12mo ago
I suppose that the update function is not correctly used
No description
Wissem.
Wissem.OP12mo ago
Hmm okey i see I will test :p Thanks y! So, what are differents uses of interaction.update() ?
Wissem.
Wissem.OP12mo ago
Something like that ? I think i'm very lost
No description
Wissem.
Wissem.OP12mo ago
DiscordAPIError[10008]: Unknown Message
New\src\components\selects\contact_select.js:16:5) (=> FIRST IN CODEPART)
DiscordAPIError[10008]: Unknown Message
New\src\components\selects\contact_select.js:16:5) (=> FIRST IN CODEPART)
duck
duck12mo ago
without seeing more of your code, I'd assume the message is ephemeral this error is exactly the reason you'd prefer interaction.update() over interaction.message.edit() ephemeral messages can only be edited through interactions they cannot be edited through the normal "Edit message" endpoint <MessageComponentInteraction>.update() responds to the interaction by editing the component's message <Message>.edit() will attempt to edit the message as normal, unrelated to any interaction especially since all interactions need responses in order to prevent the user from receiving some "The application did not respond" error, you'd definitely want to use interaction.update() since you don't appear to be responding to it elsewhere
Want results from more Discord servers?
Add your server