Why do I keep getting DiscordAPIError[40060]: Interaction has already been acknowledged.

I'm trying trying to create a basic ping command for my bot but I keep getting this error:
DiscordAPIError[40060]: Interaction has already been acknowledged.
Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
DiscordAPIError[40060]: Interaction has already been acknowledged.
Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
Here's my ping command code:
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {

const sent = await interaction.reply({ content: 'Pinging...', fetchReply: true });
interaction.editReply(`Roundtrip latency: ${sent.createdTimestamp - interaction.createdTimestamp}ms`);
}
};
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {

const sent = await interaction.reply({ content: 'Pinging...', fetchReply: true });
interaction.editReply(`Roundtrip latency: ${sent.createdTimestamp - interaction.createdTimestamp}ms`);
}
};
I copied the other files like the index.js from the discord.js github with small modifications added: Index.js: https://pastebin.com/By8k1RV7 deploy-commands.js: https://pastebin.com/jggUXikN
Pastebin
Index.js - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
deploy-commands.js - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
4 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Squidward
Squidward2y ago
discord.js version: 14.7.1 node: 18.13.0
It's Manny
It's Manny2y ago
Make sure you aren't deferring the reply within your command handler
Squidward
Squidward2y ago
I don't think I'm doing that nvm i was doing that