fix: check if interaction has timed out or can be replied to

This commit is contained in:
Marius Begby committed 2023-08-13 21:28:06 +02:00
1 parent 78752c33ae
commit c0894d214a
1 file changed
+5
@@ -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;