forked from Supositware/Haha-Yes
Remove from ratelimiter if command crash
(Untested because I live on the edge)
This commit is contained in:
parent
19855f82f0
commit
d604f0ad8e
2 changed files with 4 additions and 0 deletions
|
@ -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 });
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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}\`` });
|
||||
|
|
Loading…
Reference in a new issue