mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added support for Twitch + TikTok follows
This commit is contained in:
@@ -46,6 +46,7 @@ const groupConsecutiveMessages = GetBooleanParam("groupConsecutiveMessages", tru
|
|||||||
|
|
||||||
const showTwitchMessages = GetBooleanParam("showTwitchMessages", true);
|
const showTwitchMessages = GetBooleanParam("showTwitchMessages", true);
|
||||||
const showTwitchAnnouncements = GetBooleanParam("showTwitchAnnouncements", true);
|
const showTwitchAnnouncements = GetBooleanParam("showTwitchAnnouncements", true);
|
||||||
|
const showTwitchFollows = GetBooleanParam("showTwitchFollows", false);
|
||||||
const showTwitchSubs = GetBooleanParam("showTwitchSubs", true);
|
const showTwitchSubs = GetBooleanParam("showTwitchSubs", true);
|
||||||
const showTwitchChannelPointRedemptions = GetBooleanParam("showTwitchChannelPointRedemptions", true);
|
const showTwitchChannelPointRedemptions = GetBooleanParam("showTwitchChannelPointRedemptions", true);
|
||||||
const showTwitchRaids = GetBooleanParam("showTwitchRaids", true);
|
const showTwitchRaids = GetBooleanParam("showTwitchRaids", true);
|
||||||
@@ -64,6 +65,7 @@ const showYouTubeSuperStickers = GetBooleanParam("showYouTubeSuperStickers", tru
|
|||||||
const showYouTubeMemberships = GetBooleanParam("showYouTubeMemberships", true);
|
const showYouTubeMemberships = GetBooleanParam("showYouTubeMemberships", true);
|
||||||
|
|
||||||
const enableTikTokSupport = GetBooleanParam("enableTikTokSupport", false);
|
const enableTikTokSupport = GetBooleanParam("enableTikTokSupport", false);
|
||||||
|
const showTikTokFollows = GetBooleanParam("showTikTokFollows", false);
|
||||||
const showTikTokMessages = GetBooleanParam("showTikTokMessages", false);
|
const showTikTokMessages = GetBooleanParam("showTikTokMessages", false);
|
||||||
const showTikTokGifts = GetBooleanParam("showTikTokGifts", false);
|
const showTikTokGifts = GetBooleanParam("showTikTokGifts", false);
|
||||||
const showTikTokSubs = GetBooleanParam("showTikTokSubs", false);
|
const showTikTokSubs = GetBooleanParam("showTikTokSubs", false);
|
||||||
@@ -134,6 +136,11 @@ client.on('Twitch.Announcement', (response) => {
|
|||||||
TwitchAnnouncement(response.data);
|
TwitchAnnouncement(response.data);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
client.on('Twitch.Follow', (response) => {
|
||||||
|
console.debug(response.data);
|
||||||
|
TwitchFollow(response.data);
|
||||||
|
})
|
||||||
|
|
||||||
client.on('Twitch.Sub', (response) => {
|
client.on('Twitch.Sub', (response) => {
|
||||||
console.debug(response.data);
|
console.debug(response.data);
|
||||||
TwitchSub(response.data);
|
TwitchSub(response.data);
|
||||||
@@ -410,6 +417,9 @@ function TikfinityConnect() {
|
|||||||
case 'chat':
|
case 'chat':
|
||||||
TikTokChat(data);
|
TikTokChat(data);
|
||||||
break;
|
break;
|
||||||
|
case 'follow':
|
||||||
|
TikTokFollow(data);
|
||||||
|
break;
|
||||||
case 'gift':
|
case 'gift':
|
||||||
TikTokGift(data);
|
TikTokGift(data);
|
||||||
break;
|
break;
|
||||||
@@ -626,6 +636,20 @@ async function TwitchAnnouncement(data) {
|
|||||||
ShowAlert(message, background);
|
ShowAlert(message, background);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function TwitchFollow(data) {
|
||||||
|
if (!showTwitchFollows)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Set the text
|
||||||
|
let username = data.user_name;
|
||||||
|
if (data.user_name.toLowerCase() != data.user_login.toLowerCase())
|
||||||
|
username = `${data.user_name} (${data.user_login})`;
|
||||||
|
|
||||||
|
const message = `${username} followed`;
|
||||||
|
|
||||||
|
ShowAlert(message, 'twitch');
|
||||||
|
}
|
||||||
|
|
||||||
async function TwitchSub(data) {
|
async function TwitchSub(data) {
|
||||||
if (!showTwitchSubs)
|
if (!showTwitchSubs)
|
||||||
return;
|
return;
|
||||||
@@ -1499,7 +1523,16 @@ async function TikTokChat(data) {
|
|||||||
AddMessageItem(instance, data.msgId, 'tiktok', data.userId);
|
AddMessageItem(instance, data.msgId, 'tiktok', data.userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function TikTokGift(data) {
|
function TikTokFollow(data) {
|
||||||
|
if (!showTikTokFollows)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const message = `${data.nickname} followed`;
|
||||||
|
|
||||||
|
ShowAlert(message, 'tiktok');
|
||||||
|
}
|
||||||
|
|
||||||
|
function TikTokGift(data) {
|
||||||
if (!showTikTokGifts)
|
if (!showTikTokGifts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1519,7 +1552,7 @@ async function TikTokGift(data) {
|
|||||||
ShowAlert(message, 'tiktok');
|
ShowAlert(message, 'tiktok');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function TikTokSubscribe(data) {
|
function TikTokSubscribe(data) {
|
||||||
if (!showTikTokSubs)
|
if (!showTikTokSubs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,14 @@
|
|||||||
"defaultValue": true,
|
"defaultValue": true,
|
||||||
"group": "Which Twitch messages do you want to see?"
|
"group": "Which Twitch messages do you want to see?"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "showTwitchFollows",
|
||||||
|
"label": "New Followers",
|
||||||
|
"description": "",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": false,
|
||||||
|
"group": "Which Twitch messages do you want to see?"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "showTwitchSubs",
|
"id": "showTwitchSubs",
|
||||||
"label": "New Subscribers",
|
"label": "New Subscribers",
|
||||||
@@ -264,6 +272,15 @@
|
|||||||
"showIf": "enableTikTokSupport",
|
"showIf": "enableTikTokSupport",
|
||||||
"group": "Which TikTok messages do you want to see?"
|
"group": "Which TikTok messages do you want to see?"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "showTikTokFollows",
|
||||||
|
"label": "New Followers",
|
||||||
|
"description": "",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": true,
|
||||||
|
"showIf": "enableTikTokSupport",
|
||||||
|
"group": "Which TikTok messages do you want to see?"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "showTikTokGifts",
|
"id": "showTikTokGifts",
|
||||||
"label": "Gifts",
|
"label": "Gifts",
|
||||||
|
|||||||
Reference in New Issue
Block a user