mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added support for YouTube Subscriber events
This commit is contained in:
@@ -89,6 +89,8 @@ const showYouTubeSuperChats = GetBooleanParam("showYouTubeSuperChats", true);
|
||||
const youtubeSuperChatAction = urlParams.get("youtubeSuperChatAction") || "";
|
||||
const showYouTubeSuperStickers = GetBooleanParam("showYouTubeSuperStickers", true);
|
||||
const youtubeSuperStickerAction = urlParams.get("youtubeSuperStickerAction") || "";
|
||||
const showYouTubeSubscribers = GetBooleanParam("showYouTubeSubscribers", false);
|
||||
const youtubeSubscriberAction = urlParams.get("youtubeSubscriberAction") || "";
|
||||
const showYouTubeMemberships = GetBooleanParam("showYouTubeMemberships", true);
|
||||
const youtubeMembershipAction = urlParams.get("youtubeMembershipAction") || "";
|
||||
|
||||
@@ -247,6 +249,11 @@ client.on('YouTube.SuperSticker', (response) => {
|
||||
YouTubeSuperSticker(response.data);
|
||||
})
|
||||
|
||||
client.on('YouTube.NewSubscriber', (response) => {
|
||||
console.debug(response.data);
|
||||
YouTubeNewSubscriber(response.data);
|
||||
})
|
||||
|
||||
client.on('YouTube.NewSponsor', (response) => {
|
||||
console.debug(response.data);
|
||||
YouTubeNewSponsor(response.data);
|
||||
@@ -827,6 +834,29 @@ function YouTubeSuperSticker(data) {
|
||||
);
|
||||
}
|
||||
|
||||
function YouTubeNewSubscriber(data) {
|
||||
if (!showYouTubeSubscribers)
|
||||
return;
|
||||
|
||||
// Set the text
|
||||
const username = data.user.name;
|
||||
|
||||
// Render avatars
|
||||
const avatarURL = data.user.profileImageUrl;
|
||||
|
||||
UpdateAlertBox(
|
||||
'youtube',
|
||||
avatarURL,
|
||||
`${username}`,
|
||||
`subscribed`,
|
||||
``,
|
||||
username,
|
||||
``,
|
||||
youtubeSubscriberAction,
|
||||
data
|
||||
);
|
||||
}
|
||||
|
||||
function YouTubeNewSponsor(data) {
|
||||
if (!showYouTubeMemberships)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user