Fixed toke saves.
This commit is contained in:
parent
7436626df7
commit
3deb2e2d52
2 changed files with 11 additions and 2 deletions
|
|
@ -148,6 +148,15 @@ class tokebot{
|
|||
|
||||
//Add the toking user to the tokers map
|
||||
this.tokers.set(commandObj.socket.user.user, commandObj.argumentArray[0].toLowerCase());
|
||||
|
||||
if(this.tokeCounter <= 3){
|
||||
//Drop the toke timer
|
||||
clearTimeout(this.tokeTimer);
|
||||
//Roll the toke counter back to 3
|
||||
this.tokeCounter = 3;
|
||||
//Re-start the toke timer
|
||||
this.tokeTimer = setTimeout(this.countdown.bind(this), 1000);
|
||||
}
|
||||
//If the user is already in the toke
|
||||
}else{
|
||||
//Tell them to fuck off
|
||||
|
|
@ -210,7 +219,7 @@ class tokebot{
|
|||
//Decrement toke time
|
||||
this.tokeCounter--;
|
||||
//try again in another second
|
||||
this.tokeTimer = setTimeout(this.countdown.bind(this), 1000)
|
||||
this.tokeTimer = setTimeout(this.countdown.bind(this), 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue