Some more changed to the bot structure #2

Merged
snxraven merged 5 commits from MiTask/LinkUp-P2P-Chat:main into main 2024-06-08 17:11:17 -04:00
Showing only changes of commit 9f2353c902 - Show all commits

View File

@ -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();