LinkUp-P2P-Chat/chatBot/includes/message/IconMessage.js

21 lines
485 B
JavaScript
Raw Permalink Normal View History

2024-06-14 12:49:26 -04:00
import Message from "./Message.js";
import b4a from "b4a";
2024-06-14 12:49:26 -04:00
class IconMessage extends Message {
2024-06-14 15:09:54 -04:00
constructor(peerName, peerAvatar, timestamp) {
super("icon", peerName, peerAvatar, null, timestamp);
2024-06-14 12:49:26 -04:00
}
toJsonString() {
return JSON.stringify({
...this.toJson()
});
}
static new(bot, avatarBuffer) {
return new IconMessage(bot.botName, b4a.toString(avatarBuffer, 'base64'), Date.now());
2024-06-14 12:49:26 -04:00
}
}
export default IconMessage;