Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
fix: check if interaction has timed out or can be replied to
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusbegby committed Aug 13, 2023
1 parent 78752c3 commit c0894d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/events/interactions/interactionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ module.exports = {
`[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' throwed and error and might have failed to execute properly.`
);

if (!interaction.deferred || !interaction.replied) {
logger.warn(error, 'Interaction was not deferred or replied to, and an error was thrown.');
return;
}

if (interaction.replied) {
// If the interaction has already been replied to, most likely command executed successfully or error is already handled.
return;
Expand Down

0 comments on commit c0894d2

Please sign in to comment.