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;
|
||||
|
||||
@@ -312,6 +312,23 @@
|
||||
"showIf": "showTwitchRaids",
|
||||
"group": "Which Twitch alerts do you want to see?"
|
||||
},
|
||||
{
|
||||
"id": "showTwitchWatchStreaks",
|
||||
"label": "Watch Streaks",
|
||||
"description": "",
|
||||
"type": "checkbox",
|
||||
"defaultValue": true,
|
||||
"group": "Which Twitch alerts do you want to see?"
|
||||
},
|
||||
{
|
||||
"id": "twitchWatchStreaksAction",
|
||||
"label": "",
|
||||
"description": "Also run this Streamer.bot Action",
|
||||
"type": "sb-actions",
|
||||
"defaultValue": "",
|
||||
"showIf": "showTwitchWatchStreaks",
|
||||
"group": "Which Twitch alerts do you want to see?"
|
||||
},
|
||||
{
|
||||
"id": "showYouTubeSuperChats",
|
||||
"label": "Super Chats",
|
||||
|
||||
Reference in New Issue
Block a user