From 4134e20403feb82e9d4648c814e5cbcbb5ca27f8 Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Mon, 10 Jun 2024 18:06:00 +0300 Subject: [PATCH] Array of arrays got fixed but i still cant figure out the issue with topics ehh --- chatBot/includes/client.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/chatBot/includes/client.js b/chatBot/includes/client.js index 0d23bc5..e1ba9dd 100644 --- a/chatBot/includes/client.js +++ b/chatBot/includes/client.js @@ -22,12 +22,10 @@ class Client extends EventEmitter { this.swarm.on('update', () => { console.log(`Peers count: ${this.swarm.connections.size}`); if(this.swarm.connections.size > 0) { - let peers = [...this.swarm.peers].filter(peer => peer && peer.publicKey && peer.publicKey.toString('hex').startsWith("a4eb7f")) - if(peers.length > 0) { - console.log(peers[0]) - console.log([peers[0].topics]); - } else { - console.log([...peers]); + let peers = [...this.swarm.peers] + for (let peer in peers) { + console.log(peer) + console.log([peer.topics]); } } });