#The reply to this interaction has already been sent or deferred with a new command

1 messages · Page 1 of 1 (latest)

atomic pasture
#

Hello I've got this error when I reuse the same slash command.

The reply to this interaction has already been sent or deferred.

My command have a extern request to an API, and for work, I added at the start :

  async execute(interaction, client) {
    await interaction.deferReply({ ephemeral: true })

When I click on the button, the embed was edited and the button disabled :

client.on('interactionCreate', async (interaction) => {
      if (interaction.customId === 'saveThePhoto') {
        // send in private message
        await interaction.deferUpdate()
        return await interaction.editReply({content:'cool content'})

But the issue is when I resend the same command after this processus, the error show up.

spice oyster
#

Don’t add event listeners inside of your command execute, only have one single interactionCreate handler that handles all of them