How to Fix Discord Error 40060 Interaction Has Already Been Acknowledged
🔍 WiseChecker

How to Fix Discord Error 40060 Interaction Has Already Been Acknowledged

Discord error 40060 appears when a bot or application tries to respond to a slash command or button interaction that has already received a reply. This happens because Discord enforces a strict one-time acknowledgment rule for interactions. Each interaction, like a slash command or a button press, can only be acknowledged once. When a bot attempts to defer, update, or follow up on an interaction that has already been acknowledged, Discord returns error 40060. This article explains the technical cause of this error and provides clear steps to fix it by adjusting bot code or server settings.

Key Takeaways: Fixing Discord Error 40060 for Bot Developers

  • Interaction acknowledgment rules in Discord API: Each interaction can be acknowledged only once using deferReply(), reply(), or update(). Calling these methods more than once triggers error 40060.
  • Using isAcknowledged property in discord.js: Check interaction.isAcknowledged before calling acknowledgment methods to avoid duplicate calls.
  • Using editReply() and followUp() correctly: After deferring, use editReply() to edit the deferred message and followUp() to send additional messages without re-acknowledging.

ADVERTISEMENT

Why Discord Error 40060 Occurs

Discord interactions follow a specific lifecycle. When a user sends a slash command or clicks a button, Discord sends an interaction object to your bot. Your bot must acknowledge this interaction within 3 seconds using one of these methods:

  • interaction.reply() – Sends a response and acknowledges the interaction.
  • interaction.deferReply() – Acknowledges the interaction without sending a message yet, giving you up to 15 minutes to respond.
  • interaction.update() – Updates the original message from a component interaction and acknowledges it.

Once any of these methods is called, the interaction is marked as acknowledged. Calling any acknowledgment method a second time on the same interaction object causes Discord to reject the request and return error 40060. The most common scenarios that trigger this error are:

  • Calling reply() after already calling deferReply().
  • Calling deferReply() twice in the same handler.
  • Calling update() after already acknowledging a button interaction with deferUpdate().
  • Using editReply() before acknowledging the interaction.

Steps to Fix Error 40060 in Your Bot Code

The fix depends on which library you use. The examples below use discord.js v14, but the logic applies to any Discord library.

Method 1: Check interaction.isAcknowledged Before Acknowledging

Before calling any acknowledgment method, check if the interaction has already been acknowledged using the built-in property.

  1. Add a guard condition at the start of your interaction handler
    Insert this check at the top of your interactionCreate event listener: if (interaction.isAcknowledged) return; This prevents any further acknowledgment code from running if the interaction was already handled by another part of your code.
  2. Use the guard before every acknowledgment call
    Wrap each reply(), deferReply(), or update() call inside an if (!interaction.isAcknowledged) block. Example: if (!interaction.isAcknowledged) await interaction.deferReply();

Method 2: Use editReply() After Deferring

If you call deferReply() first, you must use editReply() to modify the deferred response. Do not call reply() after deferring.

  1. Call deferReply() once
    At the start of your command handler, call await interaction.deferReply(); This acknowledges the interaction and gives you 15 minutes to respond.
  2. Use editReply() to send the final response
    After performing your logic, call await interaction.editReply('Your message here'); Do not call reply() again.

Method 3: Use followUp() for Additional Messages

After acknowledging an interaction with reply() or deferReply(), you can send extra messages using followUp() without acknowledging again.

  1. Acknowledge the interaction
    Call await interaction.reply('First response'); or await interaction.deferReply();
  2. Send follow-up messages
    Call await interaction.followUp('Additional message'); This works regardless of whether you used reply() or deferReply() for the initial acknowledgment.

Method 4: Review Your Code for Duplicate Acknowledgments

Sometimes error 40060 occurs because the same interaction handler runs multiple times, especially in modal submissions or button collectors.

  1. Check for loops or recursive calls
    Ensure your interactionCreate event listener does not call itself. If you use a MessageComponentCollector, make sure the collector’s collect event does not trigger the same handler that created the collector.
  2. Add a unique identifier check
    Store the interaction ID in a Set and skip processing if the ID already exists. Example: if (processedInteractions.has(interaction.id)) return; processedInteractions.add(interaction.id);

ADVERTISEMENT

If Discord Error 40060 Persists After Code Fixes

Bot Uses an Outdated Library Version

Older versions of discord.js or other libraries may not properly handle interaction acknowledgment states. Update your library to the latest stable release. For discord.js, run npm install discord.js@latest in your bot project folder.

Interaction Collector Still Running After Acknowledgment

If you use awaitInteractionReply() or a modal submit collector, the collector may try to acknowledge the same interaction twice. Stop the collector after the first acknowledgment using collector.stop() or set a filter that rejects already-handled interactions.

Multiple Bot Instances Responding to the Same Interaction

If your bot runs on multiple processes or servers, two instances may try to acknowledge the same interaction. Use a shared state store like Redis to track which instance has acknowledged each interaction. Alternatively, use Discord’s interaction.token to deduplicate in a central database.

Item Correct Approach Incorrect Approach
After deferReply() Use editReply() to send response Call reply() again
After reply() Use followUp() for extra messages Call deferReply() or reply() again
Before any acknowledgment Check interaction.isAcknowledged Assume interaction is not acknowledged
Multiple bot instances Use shared state store Let each instance respond independently

After applying these fixes, error 40060 should no longer appear in your bot logs. Test each command and button interaction to confirm the acknowledgment flow works correctly. For advanced debugging, enable Discord’s gateway events for interaction creation and log the acknowledgment status at each step. This helps identify unexpected duplicate calls in complex interaction chains.

ADVERTISEMENT