From 9f2353c9025d04095f9e642ad3a28a174f0e8356 Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Sat, 8 Jun 2024 23:38:44 +0300 Subject: [PATCH] Added check if botName or chatRoomID is not defined --- chatBot/includes/client.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chatBot/includes/client.js b/chatBot/includes/client.js index 7d61fbd..5033659 100644 --- a/chatBot/includes/client.js +++ b/chatBot/includes/client.js @@ -4,6 +4,9 @@ import EventEmitter from 'node:events' class Client extends EventEmitter { constructor(chatRoomID, botName) { super(); + + if(!chatRoomID || !botName) return console.error("ChatRoomID or BotName is not defined!"); + this.topicBuffer = Buffer.from(chatRoomID, 'hex'); this.botName = botName; this.swarm = new Hyperswarm();