Unknown interaction

Hello I have a problem that I can't figure out. I understand the principle of deferring an answer, but in this case I'm having trouble. What I'd like to do: Change the embed and the drop-down menu each time an answer is selected:
return selectMenu.update({
ephemeral: true,
embeds: [nextQuestion.embed],
components: [nextQuestion.selectmenu]
});
return selectMenu.update({
ephemeral: true,
embeds: [nextQuestion.embed],
components: [nextQuestion.selectmenu]
});
It works great! But from time to time (very rarely), this error is generated: DiscordAPIError[10062]: Unknown interaction How to correct it? Thanks!
12 Replies
d.js toolkit
d.js toolkit•14mo 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!
treble/luna
treble/luna•14mo ago
It means you took longer than 3s to respond
Mathias
MathiasOP•14mo ago
I can defer() an update() ?
d.js docs
d.js docs•14mo ago
method StringSelectMenuInteraction#update() Updates the original message of the component on which the interaction was received on.
treble/luna
treble/luna•14mo ago
wait
d.js docs
d.js docs•14mo ago
method StringSelectMenuInteraction#deferUpdate() Defers an update to the message to which the component was attached.
Mathias
MathiasOP•14mo ago
Thank you I'm trying to reproduce the problem: if I wait 20 seconds (for example) to select an answer, it updates correctly without using defer().
treble/luna
treble/luna•14mo ago
the time you wait has nothing to do here
Mathias
MathiasOP•14mo ago
Oh no, okay, I misunderstood: we're talking about the server that takes more than 3 sec.
treble/luna
treble/luna•14mo ago
yes
Mathias
MathiasOP•14mo ago
Sorry ! I'll test that, many thanks! 🙌 This means I can postpone my update. But when I update my component, I get the error : Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred
treble/luna
treble/luna•14mo ago
You have to use editReply
Want results from more Discord servers?
Add your server