mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added support for Twitch Power Ups
This commit is contained in:
@@ -46,6 +46,7 @@ const showTwitchAnnouncements = GetBooleanParam("showTwitchAnnouncements", true)
|
||||
const showTwitchFollows = GetBooleanParam("showTwitchFollows", false);
|
||||
const showTwitchSubs = GetBooleanParam("showTwitchSubs", true);
|
||||
const showTwitchChannelPointRedemptions = GetBooleanParam("showTwitchChannelPointRedemptions", true);
|
||||
const showTwitchPowerUpRedemptions = GetBooleanParam("showTwitchPowerUpRedemptions", true);
|
||||
const showTwitchRaids = GetBooleanParam("showTwitchRaids", true);
|
||||
const showTwitchWatchStreaks = GetBooleanParam("showTwitchWatchStreaks", true);
|
||||
const showTwitchSharedChat = GetBooleanParam("showTwitchSharedChat", true);
|
||||
@@ -181,6 +182,11 @@ client.on('Twitch.RewardRedemption', (response) => {
|
||||
TwitchRewardRedemption(response.data);
|
||||
})
|
||||
|
||||
client.on('Twitch.CustomPowerUpRedemption', (response) => {
|
||||
console.debug(response.data);
|
||||
TwitchCustomPowerUpRedemption(response.data);
|
||||
})
|
||||
|
||||
client.on('Twitch.Raid', (response) => {
|
||||
console.debug(response.data);
|
||||
TwitchRaid(response.data);
|
||||
@@ -788,6 +794,23 @@ async function TwitchRewardRedemption(data) {
|
||||
ShowAlert(message, 'twitch');
|
||||
}
|
||||
|
||||
async function TwitchCustomPowerUpRedemption(data) {
|
||||
if (!showTwitchPowerUpRedemptions)
|
||||
return;
|
||||
|
||||
let username = data.user.name;
|
||||
if (data.user.name.toLowerCase() != data.user.login.toLowerCase())
|
||||
username = `${data.user.name} (${data.user.login})`;
|
||||
const powerUpName = data.custom_power_up.title;
|
||||
const cost = data.custom_power_up.bits_cost;
|
||||
const prompt = data.custom_power_up.prompt;
|
||||
const bitIcon = `<img src="icons/badges/twitch-bit.svg" class="platform"/>`;
|
||||
|
||||
let message = `${username} redeemed ${powerUpName} ${bitIcon} ${cost}`;
|
||||
|
||||
ShowAlert(message, 'twitch');
|
||||
}
|
||||
|
||||
async function TwitchRaid(data) {
|
||||
if (!showTwitchRaids)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user