Replaced 'setTimeOut' with bot.on('onBotJoinRoom', () => {}); for sending ON_READY_MESSAGE to the chat

This commit is contained in:
MrMasrozYTLIVE
2024-06-08 23:36:00 +03:00
parent 164efc5b72
commit cd5cfb20a4
2 changed files with 2 additions and 7 deletions

View File

@ -27,8 +27,8 @@ class Client extends EventEmitter {
joinChatRoom() {
this.discovery = this.swarm.join(this.topicBuffer, {client: true, server: true});
this.discovery.flushed().then(() => {
this.emit('onBotJoinRoom')
console.log(`Bot ${this.botName} joined the chat room.`);
this.emit('onBotJoinRoom');
});
}