Add files via upload

This commit is contained in:
Rodrigo Emanuel
2025-05-11 02:34:38 -03:00
committed by GitHub
parent 594abf2dc1
commit 9f6fdfc691
22 changed files with 1249 additions and 79 deletions

View File

@@ -11,6 +11,8 @@ const showTwitchRaids = getURLParam("showTwitchRaids", true);
const showTwitchSharedChat = getURLParam("showTwitchSharedChat", true);
const showTwitchViewers = getURLParam("showTwitchViewers", true);
const avatars = new Map();
if (showTwitchViewers == false) { document.querySelector('#statistics #twitch').style.display = 'none'; }
const twitchMessageHandlers = {
@@ -510,7 +512,9 @@ async function twitchUserBanned(data) {
async function twitchChatClearMessages() {
chatContainer.innerHTML = '';
chatContainer.querySelectorAll(`.twitch`).forEach(element => {
element.remove();
});
}
@@ -567,11 +571,11 @@ async function getTwitchBadges(data) {
async function getTwitchAvatar(user) {
if (showAvatar == true) {
if (avatars.has(user)) {
console.debug(`Avatar found for ${user}!`);
console.debug(`Twitch avatar found for ${user}!`);
return avatars.get(user);
}
else {
console.debug(`Avatar not found for ${user}! Getting it from DECAPI!`);
console.debug(`Twitch avatar not found for ${user}! Getting it from DECAPI!`);
var decapi = await fetch('https://decapi.me/twitch/avatar/' + user);
var newavatar = await decapi.text()
avatars.set(user, newavatar);