From d604f0ad8e322c6394e94520f93d042b49e20397 Mon Sep 17 00:00:00 2001 From: Supositware Date: Wed, 28 Aug 2024 00:13:14 +0200 Subject: [PATCH] Remove from ratelimiter if command crash (Untested because I live on the edge) --- events/client/interactionCreate.js | 2 ++ events/client/messageCreate.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/events/client/interactionCreate.js b/events/client/interactionCreate.js index a571050..dda8b9e 100644 --- a/events/client/interactionCreate.js +++ b/events/client/interactionCreate.js @@ -120,6 +120,8 @@ export default { } catch (error) { console.error(error); + const hasPrallelLimit = await ratelimiter.checkParallel(interaction.user, commandName, command); + if (hasPrallelLimit) ratelimiter.removeParallel(commandName); await interaction.followUp({ content: `There was an error while executing this command!\n\`${error}\``, ephemeral: true }); } }, diff --git a/events/client/messageCreate.js b/events/client/messageCreate.js index 979e54f..9496fb4 100644 --- a/events/client/messageCreate.js +++ b/events/client/messageCreate.js @@ -459,6 +459,8 @@ export default { } catch (error) { console.error(error); + const hasPrallelLimit = await ratelimiter.checkParallel(message.author, commandName, command); + if (hasPrallelLimit) ratelimiter.removeParallel(commandName); await message.reply({ content: `There was an error while executing this command!\n\`${error}\`` }) .catch(async () => { await message.channel.send({ content: `There was an error while executing this command!\n\`${error}\`` });