mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-18 19:50:58 -04:00
Added support for Twitch Watch Streaks
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user