This is a cooldown manager.
First, create the manager
const manager = new require('cooldownsManager.js')();
client.CooldownsManager = manager;
client.CooldownsManager.set({
commandName: 'your command name',
time: 5, // This number is in seconds
userID: "User id here"
});
And cooldown is automatically done !
client.CooldownsManger.check({
commandName: "Command name here",
userID: "user id here"
});
returns true
if user has a cooldown
returns false
if user has not
client.CooldownsManager.remainingTime({
commandName: 'command name',
userID: "user id"
});
returns false
if user has no cooldown
returns the number of seconds remains on the cooldown.
Now you can use my amazing module !