LinkUp-P2P-Chat/chatBot/includes/IconMessage.js
2024-06-14 19:50:10 +03:00

20 lines
468 B
JavaScript

import Message from "./Message.js";
class IconMessage extends Message {
constructor(peerName, avatarBuffer, topic, timestamp) {
super("icon", peerName, avatarBuffer, topic, timestamp);
}
toJsonString() {
return JSON.stringify({
...this.toJson()
});
}
static new(bot, avatarBuffer) {
return new IconMessage(bot.botName, avatarBuffer, bot.currentTopic, Date.now());
}
}
export default IconMessage;