forked from wmantly/mc-bot-town
		
	new
This commit is contained in:
		| @ -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(); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
		Reference in New Issue
	
	Block a user