From 18c6cb1b3492fc90dea0e03402f390968df61a92 Mon Sep 17 00:00:00 2001 From: Killa Fish <61081555+Fiszh@users.noreply.github.com> Date: Sat, 28 Sep 2024 20:04:12 +0200 Subject: [PATCH] Update index.js --- index.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 89770e0..d6aafcc 100644 --- a/index.js +++ b/index.js @@ -533,10 +533,6 @@ async function replaceWithEmotes(inputString, TTVMessageEmoteData, userstate, ch let emoteStyle = 'style="height: 36px; position: relative;"' - if (BlockedEmotesData.find(emote => emote.url == foundEmote.url)) { - emoteStyle = 'style="filter: blur(10px); height: 36px; position: relative;"' - } - // Generate HTML for emote let emoteHTML = ` @@ -1108,6 +1104,29 @@ async function getUserColorFromUserId(userId) { } } +async function getAvatarFromUserId(userId) { + const userUrl = `https://api.twitch.tv/helix/users?id=${userId}`; + + try { + const response = await fetch(userUrl, { + headers: { + 'Client-ID': userClientId, + 'Authorization': userToken + } + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const data = await response.json(); + return data.data[0]["profile_image_url"]; + } catch (error) { + console.log('Error fetching avatar:', error); + return null; + } +} + // SevenTV async function loadSevenTV() {