fixed 7tv requirement

This commit is contained in:
2025-04-07 17:24:28 +10:00
parent 4ab18f1a59
commit 5f45c76657

View File

@@ -45,7 +45,10 @@ class ChatApp {
async fetch7TVEmotes(userId) { async fetch7TVEmotes(userId) {
try { try {
const response = await fetch(`https://7tv.io/v3/users/twitch/${userId}`); const response = await fetch(`https://7tv.io/v3/users/twitch/${userId}`);
if (!response.ok) throw new Error(`Error fetching 7TV emotes: ${response.status}`); if (!response.ok) {
console.warn(`7TV emotes fetch failed with status ${response.status}. Continuing without 7TV emotes.`);
return {};
}
const emotesData = await response.json(); const emotesData = await response.json();
if (!emotesData?.emote_set?.emotes) return {}; if (!emotesData?.emote_set?.emotes) return {};