Interaction already deferred.

https://github.com/KiraKenjiro/bot The bot at the moment works almost perfectly. qj's been a saviour and helped me with it but i am struggling with once thing. as the model embed is sent, (via clicking on the modalsEmbed button that was sent in the embed command) there is a 5 minute timer that is started. After 5 minutes has elapsed, if the user hasn’t filled in the consent form (checked by ckecing if there is a value in the consent field in the (i think) accounts table). (at the moment it's set to i think 45 seconds just for testing. e.g. 0.45 * 60 * 1000) But when the timer elapsed I got this error. (Provided half log)
[04-01-2024_08-12-24] • Registered Button submitConsent
[04-01-2024_08-12-24] • Registered Button submitDemographics
[04-01-2024_08-12-25] • Accounts table already exists. Skipping.
[04-01-2024_08-12-25] • Demographics table already exists. Skipping.
[04-01-2024_08-12-25] • UserFlags table already exists. Skipping.
[04-01-2024_08-12-25] • UserFlagsDetail table already exists. Skipping.
[04-01-2024_08-12-25] • Database and tables checked/created.
[04-01-2024_08-12-25] • Logged in as bot1184173006159872080#3072
Timer Started
Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at ButtonInteraction.update (/Users/kirakenjiro/Desktop/bots/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:225:46)
at Timeout._onTimeout (/Users/kirakenjiro/Desktop/bots/buttons/modalsEmbed.js:86:31) {
code: 'InteractionAlreadyReplied'
}
[04-01-2024_08-12-24] • Registered Button submitConsent
[04-01-2024_08-12-24] • Registered Button submitDemographics
[04-01-2024_08-12-25] • Accounts table already exists. Skipping.
[04-01-2024_08-12-25] • Demographics table already exists. Skipping.
[04-01-2024_08-12-25] • UserFlags table already exists. Skipping.
[04-01-2024_08-12-25] • UserFlagsDetail table already exists. Skipping.
[04-01-2024_08-12-25] • Database and tables checked/created.
[04-01-2024_08-12-25] • Logged in as bot1184173006159872080#3072
Timer Started
Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at ButtonInteraction.update (/Users/kirakenjiro/Desktop/bots/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:225:46)
at Timeout._onTimeout (/Users/kirakenjiro/Desktop/bots/buttons/modalsEmbed.js:86:31) {
code: 'InteractionAlreadyReplied'
}
I think... It's talking about this section of code from lines 81 to 89 in the file modalsEmbed.js (There is an issue where i forgot to update it with the right description but, you get the idea it would update it to something like, oops, form timed out) I'm not entirely too sure whats happening but it may be due to the embed being sent at 102 to 106 as, i have a slight feeling thats the interaction i want to update and im trying to update the interaction before. This is just a guess but i'd love a second opinion on this <3 --- Edit: I'm pretty sure im trying to edit the interaction before the interaction i want to edit. not too sure if thats worded right but alas
GitHub
GitHub - KiraKenjiro/bot
Contribute to KiraKenjiro/bot development by creating an account on GitHub.
4 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
Kiɾʌ Kenjiɾø
Kiɾʌ KenjiɾøOP12mo ago
Someone please fact check me but to get the interaction of the embed from 102 to 106. I can do this
newInteraction = await interaction.reply({
embeds: [modalsEmbed],
components: [row],
ephemeral: true,
});
newInteraction = await interaction.reply({
embeds: [modalsEmbed],
components: [row],
ephemeral: true,
});
Then i can just move the timer logic after that reply.
d.js docs
d.js docs12mo ago
- DiscordAPIError: Interaction has already been acknowledged - [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred. You have already replied to the interaction. - Use <Interaction>.followUp() to send a new message - If you deferred reply it's better to use <Interaction>.editReply() - Responding to slash commands / message components
Kiɾʌ Kenjiɾø
Kiɾʌ KenjiɾøOP12mo ago
Ohhh!! Alright i'll give that a try <3 Yeah that worked, Turns out you can update, Edit if you deferred! Thanks krum :D
Want results from more Discord servers?
Add your server