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
+31
View File
@@ -67,6 +67,8 @@ const showTwitchCheers = GetBooleanParam("showTwitchCheers", true);
const twitchCheerAction = urlParams.get("twitchCheerAction") || "";
const showTwitchRaids = GetBooleanParam("showTwitchRaids", true);
const twitchRaidAction = urlParams.get("twitchRaidAction") || "";
const showTwitchWatchStreaks = GetBooleanParam("showTwitchWatchStreaks", true);
const twitchWatchStreaksAction = urlParams.get("twitchWatchStreaksAction") || "";
// Which Kick alerts do you want to see?
const kickUsername = urlParams.get("kickUsername") || "";
@@ -211,6 +213,11 @@ client.on('Twitch.Raid', (response) => {
TwitchRaid(response.data);
})
client.on('Twitch.WatchStreak', (response) => {
console.debug(response.data);
TwitchWatchStreak(response.data);
})
client.on('YouTube.SuperChat', (response) => {
console.debug(response.data);
YouTubeSuperChat(response.data);
@@ -721,6 +728,30 @@ async function TwitchRaid(data) {
);
}
async function TwitchWatchStreak(data) {
if (!showTwitchWatchStreaks)
return;
// Render avatars
const avatarURL = await GetAvatar(data.userName, 'twitch');
// Set the text
const username = data.displayName;
const watchStreak = data.watchStreak;
UpdateAlertBox(
'twitch',
avatarURL,
`${username}`,
`is currently on a ${watchStreak}-stream streak!`,
'',
username,
'',
twitchWatchStreaksAction,
data
);
}
function YouTubeSuperChat(data) {
if (!showYouTubeSuperChats)
return;