LinkUp-P2P-Chat/chatBot/includes/Message.js

22 lines
507 B
JavaScript
Raw Normal View History

2024-06-14 09:43:17 -04:00
class Message {
constructor(messageType, peerName, peerAvatar, topic, timestamp) {
this.type = messageType;
2024-06-14 09:43:17 -04:00
this.peerName = peerName;
this.peerAvatar = peerAvatar;
this.topic = topic;
this.timestamp = timestamp;
}
toJson() {
return {
type: this.type,
2024-06-14 09:43:17 -04:00
name: this.peerName,
avatar: this.peerAvatar,
topic: this.topic,
timestamp: this.timestamp
};
}
}
export default Message;