LinkUp-P2P-Chat/chatBot/includes/message/IconMessage.js
2024-06-14 15:09:54 -04:00

21 lines
485 B
JavaScript

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