This commit is contained in:
2024-09-27 22:57:22 -04:00
parent 2ab44224b4
commit 84c45695b7
4 changed files with 94 additions and 32 deletions

View File

@ -277,11 +277,15 @@ class CJbot{
async say(...messages){
for(let message of messages){
if(this.nextChatTime > Date.now()){
await sleep(this.nextChatTime-Date.now()+1)
}
console.log('next chat time:', this.nextChatTime > Date.now(), Date.now()+1, this.nextChatTime-Date.now()+1);
(async (message)=>{
if(this.nextChatTime > Date.now()){
console.log('am sleeping');
await sleep(this.nextChatTime-Date.now()+1)
}
this.bot.chat(message);
})(message);
this.bot.chat(message);
this.nextChatTime = Date.now() + this.__chatCoolDown();
}
}