diff --git a/src/index.js b/src/index.js index 80cb66b..57dd98f 100644 --- a/src/index.js +++ b/src/index.js @@ -443,7 +443,7 @@ async function replaceWithEmotes(inputString, TTVMessageEmoteData, userstate, ch let emoteStyle = 'style="height: 36px; position: relative;"' // Generate HTML for emote - let emoteHTML = ` + let emoteHTML = ` ${foundEmote.name} @@ -478,7 +478,7 @@ async function replaceWithEmotes(inputString, TTVMessageEmoteData, userstate, ch } } - return ` + return ` ${part} `; } else { @@ -612,7 +612,7 @@ async function handleMessage(userstate, message, channel) { } if (badge) { - badges += ` + badges += ` ${badge.title} `; } @@ -623,7 +623,7 @@ async function handleMessage(userstate, message, channel) { const badge = TTVSubBadgeData.find(badge => badge.id === userstate.badges.subscriber); if (badge) { - badges += ` + badges += ` ${badge.title} `; } @@ -633,7 +633,7 @@ async function handleMessage(userstate, message, channel) { const badge = TTVBitBadgeData.find(badge => badge.id === userstate.badges.bits); if (badge) { - badges += ` + badges += ` ${badge.title} `; } @@ -648,7 +648,7 @@ async function handleMessage(userstate, message, channel) { const foundChatterinoBadge = ChatterinoBadgeData.find(badge => badge.owner_id == userstate["user-id"]); if (foundChatterinoBadge) { - badges += ` + badges += ` ${foundChatterinoBadge.title} `; } @@ -658,7 +658,7 @@ async function handleMessage(userstate, message, channel) { const foundFFZBadge = FFZBadgeData.find(badge => badge.owner_username == userstate.username); if (foundFFZBadge) { - badges += ` + badges += ` ${foundFFZBadge.title} `; } @@ -666,15 +666,16 @@ async function handleMessage(userstate, message, channel) { // 7tv Badges if (foundUser && foundUser.sevenTVData && foundUser.sevenTVData.badge.url) { - badges += ` - ${foundUser.sevenTVData.badge.title} + const foundBadge = foundUser.sevenTVData.badge + badges += ` + ${foundBadge.title} `; } // Determine the message HTML based on user information let messageHTML = `
${badges} - + ${finalUsername} ${message} @@ -683,7 +684,7 @@ async function handleMessage(userstate, message, channel) { if (foundUser && foundUser.avatar) { messageHTML = `
${badges} - + ${finalUsername} ${message} @@ -729,7 +730,7 @@ async function handleMessage(userstate, message, channel) { let finalMessageHTML = `
${prefix} ${badges} - + ${finalUsername} ${results} (${hours}:${minutes}:${seconds}) @@ -750,8 +751,8 @@ async function handleMessage(userstate, message, channel) { finalMessageHTML = `
${prefix} ${badges} - - ${finalUsername} + + ${finalUsername} ${results} (${hours}:${minutes}:${seconds})
`; @@ -1276,16 +1277,16 @@ async function update(updateInfo) { } streamTitles[i].innerHTML = `
-
- - ${'avatar'} - -
- ${streamInfo.username} -
-
${results}
-
-
`; +
+ + avatar + +
+ ${streamInfo.username} +
+
${results}
+
+
`; let nameWrapper = streamTitles[i].querySelector('.name-wrapper'); @@ -1308,11 +1309,8 @@ async function update(updateInfo) { } for (let i = 0; i < streamCategories.length; i++) { - streamCategories[i].innerHTML = ` + streamCategories[i].innerHTML = ` ${streamInfo.category} - - ${streamInfo.category} - `; } } catch { }