mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added support for Twitch Channel Point Rewards
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
@@ -34,6 +34,7 @@ const ignoreChatters = urlParams.get("ignoreChatters") || "";
|
|||||||
const showTwitchMessages = GetBooleanParam("showTwitchMessages", true);
|
const showTwitchMessages = GetBooleanParam("showTwitchMessages", true);
|
||||||
const showTwitchAnnouncements = GetBooleanParam("showTwitchAnnouncements", true);
|
const showTwitchAnnouncements = GetBooleanParam("showTwitchAnnouncements", true);
|
||||||
const showTwitchSubs = GetBooleanParam("showTwitchSubs", true);
|
const showTwitchSubs = GetBooleanParam("showTwitchSubs", true);
|
||||||
|
const showTwitchChannelPointRedemptions = GetBooleanParam("showTwitchChannelPointRedemptions", true);
|
||||||
const showTwitchRaids = GetBooleanParam("showTwitchRaids", true);
|
const showTwitchRaids = GetBooleanParam("showTwitchRaids", true);
|
||||||
|
|
||||||
const showYouTubeMessages = GetBooleanParam("showYouTubeMessages", true);
|
const showYouTubeMessages = GetBooleanParam("showYouTubeMessages", true);
|
||||||
@@ -108,6 +109,11 @@ client.on('Twitch.GiftBomb', (response) => {
|
|||||||
TwitchGiftBomb(response.data);
|
TwitchGiftBomb(response.data);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
client.on('Twitch.RewardRedemption', (response) => {
|
||||||
|
console.debug(response.data);
|
||||||
|
TwitchRewardRedemption(response.data);
|
||||||
|
})
|
||||||
|
|
||||||
client.on('Twitch.Raid', (response) => {
|
client.on('Twitch.Raid', (response) => {
|
||||||
console.debug(response.data);
|
console.debug(response.data);
|
||||||
TwitchRaid(response.data);
|
TwitchRaid(response.data);
|
||||||
@@ -396,6 +402,21 @@ async function TwitchGiftBomb(data) {
|
|||||||
ShowAlert(message, 'twitch');
|
ShowAlert(message, 'twitch');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function TwitchRewardRedemption(data) {
|
||||||
|
if (!showTwitchChannelPointRedemptions)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const username = data.user_name;
|
||||||
|
const rewardName = data.reward.title;
|
||||||
|
const cost = data.reward.cost;
|
||||||
|
const userInput = data.user_input;
|
||||||
|
const channelPointIcon = `<img src="icons/badges/twitch-channel-point.png" class="platform"/>`;
|
||||||
|
|
||||||
|
let message = `${username} redeemed ${rewardName} ${channelPointIcon} ${cost}`;
|
||||||
|
|
||||||
|
ShowAlert(message, 'twitch');
|
||||||
|
}
|
||||||
|
|
||||||
async function TwitchRaid(data) {
|
async function TwitchRaid(data) {
|
||||||
if (!showTwitchRaids)
|
if (!showTwitchRaids)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -124,6 +124,14 @@
|
|||||||
"defaultValue": true,
|
"defaultValue": true,
|
||||||
"group": "Which Twitch messages do you want to see?"
|
"group": "Which Twitch messages do you want to see?"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "showTwitchChannelPointRedemptions",
|
||||||
|
"label": "Channel Point Redemptions",
|
||||||
|
"description": "",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": true,
|
||||||
|
"group": "Which Twitch messages do you want to see?"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "showTwitchRaids",
|
"id": "showTwitchRaids",
|
||||||
"label": "Raids",
|
"label": "Raids",
|
||||||
|
|||||||
Reference in New Issue
Block a user