Added support for Twitch Watch Streaks

This commit is contained in:
nuttylmao
2025-11-08 05:43:49 +11:00
parent fff3e5d020
commit 38cd241122
6 changed files with 129 additions and 0 deletions
+18
View File
@@ -46,6 +46,7 @@ const showTwitchFollows = GetBooleanParam("showTwitchFollows", false);
const showTwitchSubs = GetBooleanParam("showTwitchSubs", true);
const showTwitchChannelPointRedemptions = GetBooleanParam("showTwitchChannelPointRedemptions", true);
const showTwitchRaids = GetBooleanParam("showTwitchRaids", true);
const showTwitchWatchStreaks = GetBooleanParam("showTwitchWatchStreaks", true);
const showTwitchSharedChat = GetBooleanParam("showTwitchSharedChat", true);
const kickUsername = urlParams.get("kickUsername") || "";
@@ -181,6 +182,11 @@ client.on('Twitch.Raid', (response) => {
TwitchRaid(response.data);
})
client.on('Twitch.WatchStreak', (response) => {
console.debug(response.data);
TwitchWatchStreak(response.data);
})
client.on('Twitch.ChatMessageDeleted', (response) => {
console.debug(response.data);
TwitchChatMessageDeleted(response.data);
@@ -789,6 +795,18 @@ async function TwitchRaid(data) {
ShowAlert(message, 'twitch');
}
async function TwitchWatchStreak(data) {
if (!showTwitchWatchStreaks)
return;
const displayName = data.displayName;
const watchStreak = data.watchStreak;
let message = `${displayName} is currently on a ${watchStreak}-stream streak!`;
ShowAlert(message, 'twitch');
}
function TwitchChatMessageDeleted(data) {
const messageList = document.getElementById("messageList");