diff --git a/chat.html b/chat.html index 61df50d..7c0d0a0 100644 --- a/chat.html +++ b/chat.html @@ -75,4 +75,4 @@ - + \ No newline at end of file diff --git a/css/app.css b/css/app.css index f55cee1..b33c015 100644 --- a/css/app.css +++ b/css/app.css @@ -392,7 +392,7 @@ body { #statistics .platform { background: #000; color: #FFF; - padding: 10px 15px; + padding: 5px 10px; border-radius: 100px; display: flex; diff --git a/index.html b/index.html index 1be89cc..663ffef 100644 --- a/index.html +++ b/index.html @@ -139,6 +139,7 @@

TikTok

+
diff --git a/js/app-mockup.js b/js/app-mockup.js index 149026b..152e907 100644 --- a/js/app-mockup.js +++ b/js/app-mockup.js @@ -838,4 +838,4 @@ function randomString(length) { function randomColor() { const randomColor = "hsl(" + Math.random() * 360 + ", 100%, 75%)"; return randomColor; -} +} \ No newline at end of file diff --git a/js/kick/module.js b/js/kick/module.js index c6d1032..c7f8237 100644 --- a/js/kick/module.js +++ b/js/kick/module.js @@ -393,7 +393,7 @@ async function kickChatMessageDeleted(data) { async function kickUserBanned(data) { - chatContainer.querySelectorAll(`[data-user="${data.user.slug}"]`).forEach(element => { + chatContainer.querySelectorAll(`[data-user="${data.user.slug}"]:not(.event)`).forEach(element => { element.remove(); }); } @@ -401,7 +401,7 @@ async function kickUserBanned(data) { async function kickChatClearMessages() { - chatContainer.querySelectorAll(`.kick`).forEach(element => { + chatContainer.querySelectorAll(`.kick:not(.event)`).forEach(element => { element.remove(); }); } @@ -567,4 +567,4 @@ async function getKickBadges(badges) { }); return badgesArray.join(' '); -} +} \ No newline at end of file diff --git a/js/tiktok/module.js b/js/tiktok/module.js index cdf7755..0080f84 100644 --- a/js/tiktok/module.js +++ b/js/tiktok/module.js @@ -32,8 +32,8 @@ streamerBotClient.on('General.Custom', (response) => { break; case 'like' : tiktokUpdateStatistics(jsonData, 'likes'); - /*console.log('TikTok Likes', jsonData); - tiktokLikesMessage(jsonData);*/ + //console.log('TikTok Likes', jsonData); + tiktokLikesMessage(jsonData); break; case 'chat' : console.log('TikTok Chat', jsonData); @@ -148,6 +148,7 @@ async function tiktokLikesMessage(data) { if (showTikTokLikes == false) return; + const { userId: userID, msgId: messageID, @@ -183,6 +184,28 @@ async function tiktokLikesMessage(data) { }; addEventToChat(userID, messageID, 'tiktok', messageData); + + + + /*const likedivs = chatContainer.querySelectorAll('div.message.likes'); + + if (likedivs.length == 6) { + // Mapeia os likedivs com seus respectivos valores de like + const likedivsWithCounts = Array.from(likedivs) + .map(div => { + const likeCountEl = div.querySelector('em.likecount'); + const count = likeCountEl ? parseInt(likeCountEl.textContent.trim(), 10) : 0; + return { div, count }; + }); + + // Ordena do menor para o maior like + likedivsWithCounts.sort((a, b) => a.count - b.count); + + // Remove os 3 com menor contagem + for (let i = 0; i < 3 && i < likedivsWithCounts.length; i++) { + likedivsWithCounts[i].div.remove(); + } + }*/ } diff --git a/js/twitch/module.js b/js/twitch/module.js index 6830415..4bcaa91 100644 --- a/js/twitch/module.js +++ b/js/twitch/module.js @@ -512,7 +512,7 @@ async function twitchUserBanned(data) { async function twitchChatClearMessages() { - chatContainer.querySelectorAll(`.twitch`).forEach(element => { + chatContainer.querySelectorAll(`.twitch:not(.event)`).forEach(element => { element.remove(); }); } diff --git a/js/youtube/module.js b/js/youtube/module.js index 0e8ab09..d0b6d18 100644 --- a/js/youtube/module.js +++ b/js/youtube/module.js @@ -119,7 +119,7 @@ async function youTubeChatMessage(data) { async function youTubeUserBanned(data) { - chatContainer.querySelectorAll(`[data-user="${data.bannedUser.id}"]`).forEach(element => { + chatContainer.querySelectorAll(`[data-user="${data.bannedUser.id}"]:not(.event)`).forEach(element => { element.remove(); }); }