hi! i'm trying to figure out how to pull the username of whoever sent a message, but i'm not having any luck-- i'm guessing its because the js is looking at the templates and not seeing the usernames, because i have the widget working fine otherwise... this is the code i have for the icons, what am i missing?
Code:
//icon array
// iconName["USERNAMEHERE"] = "assets/ICONHERE.png;"
const iconName = [];
iconName["arcadearia"] = "assets/aria.png;"
iconName["arlydarkfire"] = "assets/arly.png;"
iconName["banchavt"] = "assets/bancha.png;"
iconName["streamsbene"] = "assets/bene.png;"
iconName["cadmuslochlan"] = "assets/cadmus.png;"
iconName["kalmia_amanita"] = "assets/kalmia.png;"
iconName["lionelvt"] = "assets/lionel.png;"
iconName["misadeluxe"] = "assets/misa.png;"
iconName["nebpunk"] = "assets/neb.png;"
iconName["nekomancyenv"] = "assets/riko.png;"
iconName["starbornstarlight"] = "assets/star.png;"
// insert icon
function buildIcon(icon) {
const image = iconName[name.textContent]
const iconClone = $(slime2.cloneTemplate('icon-template'))
iconClone.find('.icon-pic').attr('src', image)
return iconClone
}