Fixed bot crash on file attachment, added 2 more new events and topic ID to file message #6

Merged
snxraven merged 18 commits from MiTask/LinkUp-P2P-Chat:main into main 2024-06-10 16:09:25 -04:00
6 changed files with 33 additions and 3 deletions
Showing only changes of commit edf61f0462 - Show all commits

View File

@ -1,6 +1,6 @@
import fs from 'fs';
import path from 'path';
import Client from './includes/client.js'; // Adjust the import path as necessary
import Client from './includes/Client.js'; // Adjust the import path as necessary
import 'dotenv/config';
// Create a new instance of the chatBot class with a valid botName

View File

@ -3,8 +3,6 @@ class ChatRoom {
this.topic = topic;
this.peers = peers;
}
}
export default ChatRoom;

View File

@ -0,0 +1,12 @@
class FileMessage {
public FileMessage(chatRoom, userPeer, fileName, fileUrl, fileType, timestamp) {
this.chatRoom = chatRoom;
this.userPeer = userPeer;
this.fileName = fileName;
this.fileUrl = fileUrl;
this.fileType = fileType;
this.timestamp = timestamp;
}
}
export default FileMessage;

View File

@ -0,0 +1,10 @@
class TextMessage {
public TextMessage(chatRoom, userPeer, message, timestamp) {
this.chatRoom = chatRoom;
this.userPeer = userPeer;
this.message = message;
this.timestamp = timestamp;
}
}
export default TextMessage;

View File

@ -0,0 +1,10 @@
class UserPeer {
public UserPeer(peer, topics, username, avatar) {
this.peer = peer;
this.topics = topics;
this.username = username;
this.avatar = avatar;
}
}
export default UserPeer;