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(), orupdate(). Calling these methods more than once triggers error 40060. - Using
isAcknowledgedproperty in discord.js: Checkinteraction.isAcknowledgedbefore calling acknowledgment methods to avoid duplicate calls. - Using
editReply()andfollowUp()correctly: After deferring, useeditReply()to edit the deferred message andfollowUp()to send additional messages without re-acknowledging.
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 callingdeferReply(). - Calling
deferReply()twice in the same handler. - Calling
update()after already acknowledging a button interaction withdeferUpdate(). - 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.
- Add a guard condition at the start of your interaction handler
Insert this check at the top of yourinteractionCreateevent 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. - Use the guard before every acknowledgment call
Wrap eachreply(),deferReply(), orupdate()call inside anif (!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.
- Call
deferReply()once
At the start of your command handler, callawait interaction.deferReply();This acknowledges the interaction and gives you 15 minutes to respond. - Use
editReply()to send the final response
After performing your logic, callawait interaction.editReply('Your message here');Do not callreply()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.
- Acknowledge the interaction
Callawait interaction.reply('First response');orawait interaction.deferReply(); - Send follow-up messages
Callawait interaction.followUp('Additional message');This works regardless of whether you usedreply()ordeferReply()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.
- Check for loops or recursive calls
Ensure yourinteractionCreateevent listener does not call itself. If you use aMessageComponentCollector, make sure the collector’scollectevent does not trigger the same handler that created the collector. - 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);
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.