Fixed bug with flair in chat.

This commit is contained in:
rainbow napkin 2025-04-15 05:40:42 -04:00
parent ee68dba673
commit e226d45dce

View file

@ -112,22 +112,22 @@ class chatBox{
highLevel.textContent = utils.unescapeEntities(`${data.highLevel}`);
chatEntry.appendChild(highLevel);
//Create username label
var userLabel = document.createElement('p');
userLabel.classList.add("chat-panel-buffer","chat-entry-username");
//If we're not using classic flair
if(data.flair != "classic"){
//Use flair
var flair = `flair-${data.flair}`;
//Otherwise
}else{
//Pull user's assigned color from the color map
var flair = this.client.userList.colorMap.get(data.user);
}
//Create color span
var colorSpan = document.createElement('span');
colorSpan.classList.add("chat-entry-flair-span", flair);
colorSpan.textContent = utils.unescapeEntities(`${data.user}`);
userLabel.textContent = utils.unescapeEntities(`${colorSpan.outerHTML}: `);
//Create username label
var userLabel = document.createElement('p');
userLabel.classList.add("chat-panel-buffer", "chat-entry-username", flair);
userLabel.textContent = utils.unescapeEntities(data.user)
//Append user label
chatEntry.appendChild(userLabel);
//Create chat body