mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-18 19:50:58 -04:00
Fixed GIFs for Horizontal Chat
This commit is contained in:
@@ -325,7 +325,7 @@ function RandomHex(str) {
|
||||
}
|
||||
|
||||
// Used to construct a message from "parts" variable commonly found in Streamer.bot chat messages
|
||||
function ConstructMessageFromParts(parts) {
|
||||
function ConstructMessageFromParts(parts, isHorizontalChat = false) {
|
||||
return parts.map(part => {
|
||||
if (part.emoji)
|
||||
return ` <img src="${EscapeHTML(part.image)}" alt="${EscapeHTML(part.text)}" title="${EscapeHTML(part.text)}" class="emote"> `;
|
||||
@@ -358,7 +358,10 @@ function ConstructMessageFromParts(parts) {
|
||||
case "mention":
|
||||
return part.text;
|
||||
case "gif":
|
||||
if (!isHorizontalChat)
|
||||
return `<img src="${EscapeHTML(part.url)}" class="gif">`;
|
||||
else
|
||||
return `<img src="${EscapeHTML(part.url)}" class="emote">`;
|
||||
default:
|
||||
return `<img src="${EscapeHTML(part.imageUrl)}" alt="${EscapeHTML(part.text)}" title="${EscapeHTML(part.text)}" class="emote">`;
|
||||
}
|
||||
|
||||
@@ -588,7 +588,7 @@ async function TwitchChatMessage(data) {
|
||||
}
|
||||
|
||||
// Set the message data
|
||||
let message = ConstructMessageFromParts(data.parts);
|
||||
let message = ConstructMessageFromParts(data.parts, isHorizontalChat = true);
|
||||
const messageColor = data.user.color;
|
||||
const role = data.user.role;
|
||||
|
||||
@@ -693,7 +693,7 @@ async function TwitchAnnouncement(data) {
|
||||
break;
|
||||
}
|
||||
|
||||
let message = ConstructMessageFromParts(data.parts);
|
||||
let message = ConstructMessageFromParts(data.parts, isHorizontalChat = true);
|
||||
|
||||
ShowAlert(message, background);
|
||||
}
|
||||
@@ -949,7 +949,7 @@ function YouTubeMessage(data) {
|
||||
|
||||
// Set the message data
|
||||
//let message = RenderMessageWithEmotesHTML(data.message, data.emotes);
|
||||
let message = ConstructMessageFromParts(data.parts);
|
||||
let message = ConstructMessageFromParts(data.parts, isHorizontalChat = true);
|
||||
|
||||
// Set furry mode
|
||||
if (furryMode)
|
||||
@@ -1394,7 +1394,7 @@ async function KickChatMessage(data) {
|
||||
}
|
||||
|
||||
// Set the message data
|
||||
let message = ConstructMessageFromParts(data.parts);
|
||||
let message = ConstructMessageFromParts(data.parts, isHorizontalChat = true);
|
||||
|
||||
// Set furry mode
|
||||
if (furryMode)
|
||||
|
||||
Reference in New Issue
Block a user