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

Solve weird edge case that shouldn't exist in the first place, but meh #264

Merged
merged 1 commit into from
Jun 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.`;
};