#Follow Up to interaction.deferUpdate() throws error

10 messages · Page 1 of 1 (latest)

ancient depot
#

Hey guys,

When I try to followUp() to an ButtonInteraction I get the error InteractionAlreadyReplied. A print of interaction.deferred (true) and interaction.replied (false) shows that it is clearly not already replied. What am I missing here?

wraith spokeBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
ancient depot
#

DJS Version: 14.14.1
NodeJS Version: 18.17.1

#

First I call
await interaction.deferUpdate();

After that I fetch some data.
And after some lines of fetching data comes

await interaction.followUp({
  content: await resolveKey(interaction, Language.buildCommandTranslationKey(TranslationKeys.lfg.request_partyleader_cannot_join)),
  ephemeral: true
});```

I checked like 10x times. there is no interaction.reply() or anything else between those calls
coral marten
#

followUp shouldnt be able to throw that error. Can you try editReply() as a test? Or show the error stack

ancient depot
# coral marten followUp shouldnt be able to throw that error. Can you try editReply() as a test...

Sure. I am using sapphire as a framework but here you go

2024-03-14 10:59:39 - ERROR - Encountered error while handling an interaction handler parse method for interaction-handler "lfgRequestButtons" at path "C:\Users\paulh\Documents\Projects\discord-bot\dist\interaction-handlers\button\lfgRequestButtons.js" Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
2024-03-14 10:59:39 - ERROR -     at ButtonInteraction.deferUpdate (C:\Users\paulh\Documents\Projects\discord-bot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:199:46)
2024-03-14 10:59:39 - ERROR -     at LfgRequestButtons.parse (C:\Users\paulh\Documents\Projects\discord-bot\dist\interaction-handlers\button\lfgRequestButtons.js:62:35)
2024-03-14 10:59:39 - ERROR -     at C:\Users\paulh\Documents\Projects\discord-bot\node_modules\@sapphire\framework\dist\cjs\lib\structures\InteractionHandlerStore.cjs:22:68
2024-03-14 10:59:39 - ERROR -     at Object.fromAsync (C:\Users\paulh\Documents\Projects\discord-bot\node_modules\@sapphire\result\dist\cjs\index.cjs:619:46)
2024-03-14 10:59:39 - ERROR -     at _InteractionHandlerStore.run (C:\Users\paulh\Documents\Projects\discord-bot\node_modules\@sapphire\framework\dist\cjs\lib\structures\InteractionHandlerStore.cjs:22:44)
2024-03-14 10:59:39 - ERROR -     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-03-14 10:59:39 - ERROR -     at async _CoreListener.run (C:\Users\paulh\Documents\Projects\discord-bot\node_modules\@sapphire\framework\dist\cjs\listeners\CoreInteractionCreate.cjs:21:7)
2024-03-14 10:59:39 - ERROR -     at async Object.fromAsync (C:\Users\paulh\Documents\Projects\discord-bot\node_modules\@sapphire\result\dist\cjs\index.cjs:619:22)
2024-03-14 10:59:39 - ERROR -     at async _CoreListener._run (C:\Users\paulh\Documents\Projects\discord-bot\node_modules\@sapphire\framework\dist\cjs\lib\structures\Listener.cjs:27:22) {
2024-03-14 10:59:39 - ERROR -   code: 'InteractionAlreadyReplied'
2024-03-14 10:59:39 - ERROR - }

Same error with editReply() btw

coral marten
#

Well this is being thrown by deferUpdate()

#

Long before either followUp or editReply

ancient depot
coral marten
#

seems that way