forked from snxraven/LinkUp-P2P-Chat
Added check if botName or chatRoomID is not defined
This commit is contained in:
parent
cd5cfb20a4
commit
9f2353c902
@ -4,6 +4,9 @@ import EventEmitter from 'node:events'
|
|||||||
class Client extends EventEmitter {
|
class Client extends EventEmitter {
|
||||||
constructor(chatRoomID, botName) {
|
constructor(chatRoomID, botName) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
if(!chatRoomID || !botName) return console.error("ChatRoomID or BotName is not defined!");
|
||||||
|
|
||||||
this.topicBuffer = Buffer.from(chatRoomID, 'hex');
|
this.topicBuffer = Buffer.from(chatRoomID, 'hex');
|
||||||
this.botName = botName;
|
this.botName = botName;
|
||||||
this.swarm = new Hyperswarm();
|
this.swarm = new Hyperswarm();
|
||||||
|
Loading…
Reference in New Issue
Block a user