Unknown interaction for some commands in only one server

I have a bot that is sharded and is in a couple thousand servers and for some reason, in one server whenever a command is run, it shows "Unknown interaction" in the console while for the user it shows "Sending Command..." for a few seconds before updating to "This application did not respond.", I can't seem to figure out why this is happening as it even happens for commands that have deferReply on the first line and the error says unknown interaction right on that first line that defers the reply.
7 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
d.js docs
d.js docs2y ago
Common causes of DiscordAPIError[10062]: Unknown interaction: • Initial response took more than 3 seconds ➞ defer the response *. • Wrong interaction object inside a collector. * Note: you cannot defer modal or autocomplete value responses
RobbyV
RobbyVOP2y ago
Like I mentioned, the response is being deferred right on the first line and it still happens, it also can't be the wrong interaction object because it works completely fine in other servers.
Syjalo
Syjalo2y ago
Could you show your command handler?
RobbyV
RobbyVOP2y ago
Sure
client.on("interactionCreate", async (interaction) => {
if (interaction.type != Discord.InteractionType.ApplicationCommand) return;

const command = client.commands.get(interaction.commandName);

if (!command) return;

try {
await command.execute(interaction);
} catch (error) {
console.error(error);
let minifiedError = error.toString().split('\n', 1)[0];
return services.Utility.errorEmbed(interaction, 'A fatal error occured.')
}
})
client.on("interactionCreate", async (interaction) => {
if (interaction.type != Discord.InteractionType.ApplicationCommand) return;

const command = client.commands.get(interaction.commandName);

if (!command) return;

try {
await command.execute(interaction);
} catch (error) {
console.error(error);
let minifiedError = error.toString().split('\n', 1)[0];
return services.Utility.errorEmbed(interaction, 'A fatal error occured.')
}
})
Syjalo
Syjalo2y ago
Do you have other interactionCreate listeners? Maybe collectors for that server?
RobbyV
RobbyVOP2y ago
No, just that one Issue fixed, I did indeed have another interactionCreate listener hidden in my code which was taking to long to return the data.
Want results from more Discord servers?
Add your server