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 toolkit6mo 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ɾø
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 docs6mo 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ɾø
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
More Posts
How to add support for private slash commandsNot a big Discord user so lots of common stuff I don't know. But I've made a bot for use just in oneSelecting the same Slash Command option multiple timesHello. Currently learning the basics of Discord.js, I was wondering if it supported selecting the saDiscord Error Code 10015 when using a collector to handle button eventsHello! I am working on a bot Im on the development team with and I dont know how to fix this issue. How would I send an interaction user a message DM?Currently trying to send a user a DM, I've had a quick scope at the docs and Noticed `createDM`, NoDiscord TTS botHi there I am trying to create a discord bot where it would join a vc that I am in and when I use !tHow to retrieve original command interaction options from select menu interaction?Hi people, I am trying to figure out if it's possible to retrieve CommandInteraction options from a When I interact, whether creating ephemeral messages or editing (editReply) it doesn't workWhen I interact with a dropdown or button, whether to edit or create a new ephemera message, it doesSend audio from one channel to another one in another guildHi, I'm currently making a discord bot about game events utilities, and I had an idea. Basically I wHow do i set a custom status, not a "Playing" one.I noticed that bots can now have a custom status which isn't the good old playing one, how do i do iFormat Embed DescriptionI'm having trouble formatting an embed leaderboard with the embed builder. I have the following for