From 70655ce90172b07c26f24bcd82a6d92252fc76b2 Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:34:06 +0300 Subject: [PATCH] So messages actually broke somehow lol --- chatBot/bot.js | 2 +- chatBot/includes/Client.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chatBot/bot.js b/chatBot/bot.js index e89d03d..cb9162d 100644 --- a/chatBot/bot.js +++ b/chatBot/bot.js @@ -39,7 +39,7 @@ loadCommands().then(commands => { // We use Event Emitter here to handle new messages bot.on('onMessage', (peer, message) => { - console.log(message); + // console.log(message); console.log(`Message received from ${message.peerName}@${message.topic} at ${new Date(message.timestamp).toLocaleTimeString()}: ${message.message}`); diff --git a/chatBot/includes/Client.js b/chatBot/includes/Client.js index d5f6866..1ec2200 100644 --- a/chatBot/includes/Client.js +++ b/chatBot/includes/Client.js @@ -90,7 +90,8 @@ class Client extends EventEmitter { sendMessage(message) { if(!(message instanceof Message)) return console.log(`message does not extend Message class (TextMessage, FileMessage, AudioMessage).`, message); - console.log('Bot name:', this.botName); + // console.log('Bot name:', this.botName); + console.log("Sending message:", message); const data = message.toJsonString(); const peers = [...this.swarm.connections]; for (const peer of peers) peer.write(data);