mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Fully implemented Kick settings
This commit is contained in:
@@ -42,6 +42,11 @@ const showTwitchChannelPointRedemptions = GetBooleanParam("showTwitchChannelPoin
|
|||||||
const showTwitchRaids = GetBooleanParam("showTwitchRaids", true);
|
const showTwitchRaids = GetBooleanParam("showTwitchRaids", true);
|
||||||
const showTwitchSharedChat = GetIntParam("showTwitchSharedChat", 2);
|
const showTwitchSharedChat = GetIntParam("showTwitchSharedChat", 2);
|
||||||
|
|
||||||
|
const showKickMessages = GetBooleanParam("showKickMessages", true);
|
||||||
|
const showKickSubs = GetBooleanParam("showKickSubs", true);
|
||||||
|
const showKickChannelPointRedemptions = GetBooleanParam("showKickChannelPointRedemptions", true);
|
||||||
|
const showKickHosts = GetBooleanParam("showKickHosts", true);
|
||||||
|
|
||||||
const showYouTubeMessages = GetBooleanParam("showYouTubeMessages", true);
|
const showYouTubeMessages = GetBooleanParam("showYouTubeMessages", true);
|
||||||
const showYouTubeSuperChats = GetBooleanParam("showYouTubeSuperChats", true);
|
const showYouTubeSuperChats = GetBooleanParam("showYouTubeSuperChats", true);
|
||||||
const showYouTubeSuperStickers = GetBooleanParam("showYouTubeSuperStickers", true);
|
const showYouTubeSuperStickers = GetBooleanParam("showYouTubeSuperStickers", true);
|
||||||
@@ -1838,11 +1843,14 @@ function CustomCodeEvent(data) {
|
|||||||
case "kickRewardRedeemed":
|
case "kickRewardRedeemed":
|
||||||
KickRewardRedeemed(eventArgs);
|
KickRewardRedeemed(eventArgs);
|
||||||
break;
|
break;
|
||||||
|
case "kickIncomingRaid":
|
||||||
|
KickIncomingRaid(eventArgs);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function KickChatMessage(data) {
|
async function KickChatMessage(data) {
|
||||||
if (!showTwitchMessages)
|
if (!showKickMessages)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Don't post messages starting with "!"
|
// Don't post messages starting with "!"
|
||||||
@@ -2093,7 +2101,7 @@ async function KickChatMessage(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function KickSub(data) {
|
async function KickSub(data) {
|
||||||
if (!showTwitchSubs)
|
if (!showKickSubs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get a reference to the template
|
// Get a reference to the template
|
||||||
@@ -2147,7 +2155,7 @@ async function KickSub(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function KickGift(data) {
|
async function KickGift(data) {
|
||||||
if (!showTwitchSubs)
|
if (!showKickSubs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get a reference to the template
|
// Get a reference to the template
|
||||||
@@ -2194,7 +2202,7 @@ async function KickGift(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function KickGifts(data) {
|
async function KickGifts(data) {
|
||||||
if (!showTwitchSubs)
|
if (!showKickSubs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get a reference to the template
|
// Get a reference to the template
|
||||||
@@ -2241,7 +2249,7 @@ async function KickGifts(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function KickRewardRedeemed(data) {
|
async function KickRewardRedeemed(data) {
|
||||||
if (!showTwitchChannelPointRedemptions)
|
if (!showKickChannelPointRedemptions)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get a reference to the template
|
// Get a reference to the template
|
||||||
@@ -2287,6 +2295,50 @@ async function KickRewardRedeemed(data) {
|
|||||||
AddMessageItem(instance, data.redeemId);
|
AddMessageItem(instance, data.redeemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function KickIncomingRaid(data) {
|
||||||
|
if (!showKickHosts)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Get a reference to the template
|
||||||
|
const template = document.getElementById('cardTemplate');
|
||||||
|
|
||||||
|
// Create a new instance of the template
|
||||||
|
const instance = template.content.cloneNode(true);
|
||||||
|
|
||||||
|
// Get divs
|
||||||
|
const cardDiv = instance.querySelector("#card");
|
||||||
|
const headerDiv = instance.querySelector("#header");
|
||||||
|
const avatarDiv = instance.querySelector("#avatar");
|
||||||
|
const iconDiv = instance.querySelector("#icon");
|
||||||
|
const titleDiv = instance.querySelector("#title");
|
||||||
|
const contentDiv = instance.querySelector("#content");
|
||||||
|
|
||||||
|
// Set the card background colors
|
||||||
|
cardDiv.classList.add('kick');
|
||||||
|
|
||||||
|
if (showAvatar) {
|
||||||
|
// Render avatars
|
||||||
|
const username = data.user;
|
||||||
|
const avatarURL = await GetAvatar(username, 'kick');
|
||||||
|
const avatar = new Image();
|
||||||
|
avatar.src = avatarURL;
|
||||||
|
avatar.classList.add("avatar");
|
||||||
|
avatarDiv.appendChild(avatar);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Set the text
|
||||||
|
let username = data.user;
|
||||||
|
// if (data.from_broadcaster_user_name.toLowerCase() != data.from_broadcaster_user_login.toLowerCase())
|
||||||
|
// username = `${data.from_broadcaster_user_name} (${data.from_broadcaster_user_login})`;
|
||||||
|
const viewers = data.viewers;
|
||||||
|
|
||||||
|
titleDiv.innerText = `${username} is raiding`;
|
||||||
|
contentDiv.innerText = `with a party of ${viewers}`;
|
||||||
|
|
||||||
|
AddMessageItem(instance, data.messageId);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
function GeneralCustom(data) {
|
function GeneralCustom(data) {
|
||||||
const target = data.target;
|
const target = data.target;
|
||||||
|
|||||||
@@ -259,6 +259,38 @@
|
|||||||
"defaultValue": 2,
|
"defaultValue": 2,
|
||||||
"group": "Which Twitch messages do you want to see?"
|
"group": "Which Twitch messages do you want to see?"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "showKickMessages",
|
||||||
|
"label": "Chat Messages",
|
||||||
|
"description": "",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": true,
|
||||||
|
"group": "Which Kick messages do you want to see?"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "showKickSubs",
|
||||||
|
"label": "New Subscribers",
|
||||||
|
"description": "",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": true,
|
||||||
|
"group": "Which Kick messages do you want to see?"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "showKickChannelPointRedemptions",
|
||||||
|
"label": "Channel Point Redemptions",
|
||||||
|
"description": "",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": true,
|
||||||
|
"group": "Which Kick messages do you want to see?"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "showKickHosts",
|
||||||
|
"label": "Raids",
|
||||||
|
"description": "",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": true,
|
||||||
|
"group": "Which Kick messages do you want to see?"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "showYouTubeMessages",
|
"id": "showYouTubeMessages",
|
||||||
"label": "Chat Messages",
|
"label": "Chat Messages",
|
||||||
|
|||||||
Reference in New Issue
Block a user