Cooldown Lib
Use this Lib to make cooldown.
Cooldown have name and can be for user or for chat.
Example
Command /bonus
function onEnding(time){
// can give bonus now
Bot.sendMessage("You have bonus now");
// your other code here
//..
return true; // if false - cooldown is not restarted
}
function onStarting(){
// cooldown just started
Bot.sendMessage("You will have bonus later");
}
function onWaiting(waitTime){
// we have active cooldown
Bot.sendMessage("Please wait: " + waitTime + " secs" );
}
Libs.CooldownLib.user.watch({
// you need name for cooldown
name: "GemBonusCooldown",
time: 120, // cooldown time, 120 secs - 2 minute
onStarting: onStarting,
onEnding: onEnding,
onWaiting: onWaiting
})or cool down for chat:
get cool down:
Command /bust
Last updated
Was this helpful?