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() {