custom emoji reaction rendering support

This commit is contained in:
MathMan05 2024-08-11 18:26:59 -05:00
parent 95942c7f50
commit a748e923fd
7 changed files with 107 additions and 29 deletions

View file

@ -10,7 +10,6 @@ import {File} from "./file.js";
import { SnowFlake } from "./snowflake.js";
import { messagejson } from "./jsontypes.js";
import {Emoji} from "./emoji.js";
new Emoji();
class Message{
static contextmenu=new Contextmenu("message menu");
@ -387,9 +386,14 @@ class Message{
if(thing.me){
reaction.classList.add("meReacted")
}
const emoji=document.createElement("p");
emoji.textContent=thing.emoji.name;
let emoji:HTMLElement;
if(thing.emoji.id){
const emo=new Emoji(thing.emoji as {name:string,id:string,animated:boolean},this.guild);
emoji=emo.getHTML(false);
}else{
emoji=document.createElement("p");
emoji.textContent=thing.emoji.name;
}
const count=document.createElement("p");
count.textContent=""+thing.count;
count.classList.add("reactionCount");