Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

Commit

Permalink
Solve weird edge case that shouldn't exist in the first place, but meh (
Browse files Browse the repository at this point in the history
  • Loading branch information
bdistin authored and CyberiumShadow committed Jun 10, 2017
1 parent 22fb8dc commit 867b13d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inhibitors/commandCooldown.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ exports.run = (client, msg, cmd) => {
if (!instance) return false;

const remaining = ((cmd.conf.cooldown * 1000) - (Date.now() - instance)) / 1000;

if (remaining < 0) {
cmd.cooldown.delete(msg.author.id);
return false;
}

return `You have just used this command. You can use this command again in ${Math.ceil(remaining)} seconds.`;
};

0 comments on commit 867b13d

Please sign in to comment.