Added toggles for TikTok

This commit is contained in:
nuttylmao
2025-07-21 08:34:51 +10:00
parent aa228b608f
commit d3abd7a133
6 changed files with 227 additions and 63 deletions
+17
View File
@@ -64,6 +64,11 @@ const showYouTubeSuperChats = GetBooleanParam("showYouTubeSuperChats", true);
const showYouTubeSuperStickers = GetBooleanParam("showYouTubeSuperStickers", true);
const showYouTubeMemberships = GetBooleanParam("showYouTubeMemberships", true);
const enableTikTokSupport = GetBooleanParam("enableTikTokSupport", false);
const showTikTokMessages = GetBooleanParam("showTikTokMessages", false);
const showTikTokGifts = GetBooleanParam("showTikTokGifts", false);
const showTikTokSubs = GetBooleanParam("showTikTokSubs", false);
const showStreamlabsDonations = GetBooleanParam("showStreamlabsDonations", true)
const showStreamElementsTips = GetBooleanParam("showStreamElementsTips", true);
const showPatreonMemberships = GetBooleanParam("showPatreonMemberships", true);
@@ -379,6 +384,9 @@ window.addEventListener('load', KickConnect);
let tikfinityWebsocket = null;
function TikfinityConnect() {
if (!enableTikTokSupport)
return;
if (tikfinityWebsocket) return; // Already connected
tikfinityWebsocket = new WebSocket("ws://localhost:21213/");
@@ -1400,6 +1408,9 @@ function KickUserBanned(data) {
}
async function TikTokChat(data) {
if (!showTikTokMessages)
return;
// Don't post messages starting with "!"
if (data.comment.startsWith("!") && excludeCommands)
return;
@@ -1498,6 +1509,9 @@ async function TikTokChat(data) {
}
async function TikTokGift(data) {
if (!showTikTokGifts)
return;
if (data.giftType === 1 && !data.repeatEnd) {
// Streak in progress => show only temporary
console.debug(`${data.uniqueId} is sending gift ${data.giftName} x${data.repeatCount}`);
@@ -1515,6 +1529,9 @@ async function TikTokGift(data) {
}
async function TikTokSubscribe(data) {
if (!showTikTokSubs)
return;
let username = data.nickname;
const message = `${username} subscribed on TikTok`;
+51 -16
View File
@@ -175,6 +175,38 @@
"defaultValue": true,
"group": "Which Twitch messages do you want to see?"
},
{
"id": "showYouTubeMessages",
"label": "Chat Messages",
"description": "",
"type": "checkbox",
"defaultValue": true,
"group": "Which YouTube messages do you want to see?"
},
{
"id": "showYouTubeSuperChats",
"label": "Super Chats",
"description": "",
"type": "checkbox",
"defaultValue": true,
"group": "Which YouTube messages do you want to see?"
},
{
"id": "showYouTubeSuperStickers",
"label": "Super Stickers",
"description": "",
"type": "checkbox",
"defaultValue": true,
"group": "Which YouTube messages do you want to see?"
},
{
"id": "showYouTubeMemberships",
"label": "Memberships",
"description": "",
"type": "checkbox",
"defaultValue": true,
"group": "Which YouTube messages do you want to see?"
},
{
"id": "enableKickSupport",
"label": "Enable Kick Support",
@@ -229,36 +261,39 @@
"group": "Which Kick messages do you want to see?"
},
{
"id": "showYouTubeMessages",
"id": "enableTikTokSupport",
"label": "Enable TikTok Support",
"description": "",
"type": "checkbox",
"defaultValue": false,
"group": "Which TikTok messages do you want to see?"
},
{
"id": "showTikTokMessages",
"label": "Chat Messages",
"description": "",
"type": "checkbox",
"defaultValue": true,
"group": "Which YouTube messages do you want to see?"
"showIf": "enableTikTokSupport",
"group": "Which TikTok messages do you want to see?"
},
{
"id": "showYouTubeSuperChats",
"label": "Super Chats",
"id": "showTikTokGifts",
"label": "Gifts",
"description": "",
"type": "checkbox",
"defaultValue": true,
"group": "Which YouTube messages do you want to see?"
"showIf": "enableTikTokSupport",
"group": "Which TikTok messages do you want to see?"
},
{
"id": "showYouTubeSuperStickers",
"label": "Super Stickers",
"id": "showTikTokSubs",
"label": "New Subscribers",
"description": "",
"type": "checkbox",
"defaultValue": true,
"group": "Which YouTube messages do you want to see?"
},
{
"id": "showYouTubeMemberships",
"label": "Memberships",
"description": "",
"type": "checkbox",
"defaultValue": true,
"group": "Which YouTube messages do you want to see?"
"showIf": "enableTikTokSupport",
"group": "Which TikTok messages do you want to see?"
},
{
"id": "showStreamlabsDonations",