mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Fixed 'TwitchRewardRedemption' for SB v1.1.0a
This commit is contained in:
@@ -782,12 +782,12 @@ async function TwitchRewardRedemption(data) {
|
|||||||
if (!showTwitchChannelPointRedemptions)
|
if (!showTwitchChannelPointRedemptions)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let username = data.user_name;
|
let username = data.user_name ?? data.user.name;
|
||||||
if (data.user_name.toLowerCase() != data.user_login.toLowerCase())
|
if (username.toLowerCase() != (data.user_login ?? data.user.login).toLowerCase())
|
||||||
username = `${data.user_name} (${data.user_login})`;
|
username = `${username} (${data.user_login ?? data.user.login})`;
|
||||||
const rewardName = data.reward.title;
|
const rewardName = data.reward.title;
|
||||||
const cost = data.reward.cost;
|
const cost = data.reward.cost;
|
||||||
const userInput = data.user_input;
|
const userInput = data.user_input ?? data.userInput;
|
||||||
const channelPointIcon = `<img src="icons/badges/twitch-channel-point.png" class="platform"/>`;
|
const channelPointIcon = `<img src="icons/badges/twitch-channel-point.png" class="platform"/>`;
|
||||||
|
|
||||||
let message = `${username} redeemed ${rewardName} ${channelPointIcon} ${cost}`;
|
let message = `${username} redeemed ${rewardName} ${channelPointIcon} ${cost}`;
|
||||||
|
|||||||
@@ -1154,7 +1154,7 @@ async function TwitchRewardRedemption(data) {
|
|||||||
|
|
||||||
if (showAvatar) {
|
if (showAvatar) {
|
||||||
// Render avatars
|
// Render avatars
|
||||||
const username = data.user_login;
|
const username = data.user_login ?? data.user.login;
|
||||||
const avatarURL = await GetAvatar(username, 'twitch');
|
const avatarURL = await GetAvatar(username, 'twitch');
|
||||||
const avatar = new Image();
|
const avatar = new Image();
|
||||||
avatar.src = avatarURL;
|
avatar.src = avatarURL;
|
||||||
@@ -1163,12 +1163,12 @@ async function TwitchRewardRedemption(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the text
|
// Set the text
|
||||||
let username = data.user_name;
|
let username = data.user_name ?? data.user.name;
|
||||||
if (data.user_name.toLowerCase() != data.user_login.toLowerCase())
|
if (username.toLowerCase() != (data.user_login ?? data.user.login).toLowerCase())
|
||||||
username = `${data.user_name} (${data.user_login})`;
|
username = `${username} (${data.user_login ?? data.user.login})`;
|
||||||
const rewardName = data.reward.title;
|
const rewardName = data.reward.title;
|
||||||
const cost = data.reward.cost;
|
const cost = data.reward.cost;
|
||||||
const userInput = data.user_input;
|
const userInput = data.user_input ?? data.userInput;
|
||||||
const channelPointIcon = `<img src="icons/badges/twitch-channel-point.png" class="platform"/>`;
|
const channelPointIcon = `<img src="icons/badges/twitch-channel-point.png" class="platform"/>`;
|
||||||
|
|
||||||
titleDiv.innerHTML = `${username} redeemed ${rewardName} ${channelPointIcon} ${cost}`;
|
titleDiv.innerHTML = `${username} redeemed ${rewardName} ${channelPointIcon} ${cost}`;
|
||||||
|
|||||||
@@ -687,14 +687,14 @@ async function TwitchRewardRedemption(data) {
|
|||||||
if (!showTwitchChannelPointRedemptions)
|
if (!showTwitchChannelPointRedemptions)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const username = data.user_name;
|
const username = data.user_name ?? data.user.name;
|
||||||
const rewardName = data.reward.title;
|
const rewardName = data.reward.title;
|
||||||
const cost = data.reward.cost;
|
const cost = data.reward.cost;
|
||||||
const userInput = data.user_input;
|
const userInput = data.user_input ?? data.userInput;
|
||||||
const channelPointIcon = `<img src="icons/badges/twitch-channel-point.png" class="platform" style="height: 1em"/>`;
|
const channelPointIcon = `<img src="icons/badges/twitch-channel-point.png" class="platform" style="height: 1em"/>`;
|
||||||
|
|
||||||
// Render avatars
|
// Render avatars
|
||||||
const avatarURL = await GetAvatar(data.user_login, 'twitch');
|
const avatarURL = await GetAvatar(data.user_login ?? data.user.login, 'twitch');
|
||||||
|
|
||||||
UpdateAlertBox(
|
UpdateAlertBox(
|
||||||
'twitch',
|
'twitch',
|
||||||
|
|||||||
Reference in New Issue
Block a user