diff options
| author | ilotterytea <iltsu@alright.party> | 2025-10-26 00:17:05 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-10-26 00:17:05 +0500 |
| commit | 0ac966b46700a725b155309147912c7dc53740b2 (patch) | |
| tree | 990283caa9db921b20b4dedc71568c7c67837822 /scripts/emotes.js | |
| parent | 73c9099e90e1a279f65567cfe751afdc11adcbb2 (diff) | |
feat: 7tv emotes
Diffstat (limited to 'scripts/emotes.js')
| -rw-r--r-- | scripts/emotes.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/emotes.js b/scripts/emotes.js index 96bc103..84f9901 100644 --- a/scripts/emotes.js +++ b/scripts/emotes.js @@ -21,4 +21,29 @@ function getBetterTTVGlobalEmotes(emotes) { emotes[e["code"]] = `https://cdn.betterttv.net/emote/${e["id"]}/1x.webp`; } }); +} + +function get7TVChannelEmotes(twitchId, emotes) { + return fetch(`https://7tv.io/v3/users/twitch/${twitchId}`) + .then((r) => r.json()) + .then((json) => { + if ("error" in json) { + addSystemMessage(`${json["error"]} (7TV)`); + return; + } + + for (const e of json["emote_set"]["emotes"]) { + emotes[e["name"]] = `https://cdn.7tv.app/emote/${e["id"]}/1x.webp`; + } + }); +} + +function get7TVGlobalEmotes(emotes) { + return fetch(`https://7tv.io/v3/emote-sets/global`) + .then((r) => r.json()) + .then((json) => { + for (const e of json["emotes"]) { + emotes[e["name"]] = `https://cdn.7tv.app/emote/${e["id"]}/1x.webp`; + } + }); }
\ No newline at end of file |
