Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiszh authored Sep 28, 2024
1 parent 2e54d66 commit 18c6cb1
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `<span class="emote-wrapper" data-text="${foundEmote.name} (${additionalInfo}${emoteType})" style="color:${foundEmote.color || 'white'}">
<a href="${foundEmote.emote_link}" target="_blank;" style="display: inline-flex; justify-content: center">
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 18c6cb1

Please sign in to comment.