mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added toggles for TikTok
This commit is contained in:
@@ -68,6 +68,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);
|
||||
@@ -402,6 +407,9 @@ window.addEventListener('load', KickConnect);
|
||||
let tikfinityWebsocket = null;
|
||||
|
||||
function TikfinityConnect() {
|
||||
if (!enableTikTokSupport)
|
||||
return;
|
||||
|
||||
if (tikfinityWebsocket) return; // Already connected
|
||||
|
||||
tikfinityWebsocket = new WebSocket("ws://localhost:21213/");
|
||||
@@ -2497,6 +2505,9 @@ function KickUserBanned(data) {
|
||||
|
||||
|
||||
async function TikTokChat(data) {
|
||||
if (!showTikTokMessages)
|
||||
return;
|
||||
|
||||
// Don't post messages starting with "!"
|
||||
if (data.comment.startsWith("!") && excludeCommands)
|
||||
return;
|
||||
@@ -2631,6 +2642,9 @@ async function TikTokChat(data) {
|
||||
}
|
||||
|
||||
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}`);
|
||||
@@ -2663,6 +2677,9 @@ function TikTokGift(data) {
|
||||
}
|
||||
|
||||
function TikTokSubscribe(data) {
|
||||
if (!showTikTokSubs)
|
||||
return;
|
||||
|
||||
// Get a reference to the template
|
||||
const template = document.getElementById('cardTemplate');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user