diff options
| author | ilotterytea <iltsu@alright.party> | 2025-10-26 21:48:53 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-10-26 21:48:53 +0500 |
| commit | 5069975b6987d42a2c3d15a8e95d546cd8c743eb (patch) | |
| tree | bf6563c18e1d293e7a3e91badfe76a0fcc5bd493 /scripts | |
| parent | c3465bddcbb1da935160b0f0612e6616ab927279 (diff) | |
feat: tinyemotes support
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/emotes.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/scripts/emotes.js b/scripts/emotes.js index f0b329a..7f73688 100644 --- a/scripts/emotes.js +++ b/scripts/emotes.js @@ -85,4 +85,49 @@ function getFFZGlobalEmotes(emotes) { } } }); +} + +function getTinyemotesChannelEmotes(instance, twitchId, emotes) { + fetch(`${instance}/users.php?alias_id=${twitchId}`, { + headers: { + 'Accept': 'application/json' + } + }) + .then((r) => r.json()) + .then((json) => { + if (json.status_code != 200) { + addSystemMessage(`${json.message} (${instance})`); + return; + } + + const data = json["data"]; + + const set_id = data["active_emote_set_id"]; + + const emote_set = data["emote_sets"].find((x) => x["id"] == set_id); + if (emote_set) { + for (const e of emote_set["emotes"]) { + emotes[e["code"]] = `${instance}/static/userdata/emotes/${e["id"]}/1x.webp`; + } + } + }); +} + +function getTinyemotesGlobalEmotes(instance, emotes) { + fetch(`${instance}/emotesets.php?id=global`, { + headers: { + 'Accept': 'application/json' + } + }) + .then((r) => r.json()) + .then((json) => { + if (json.status_code != 200) { + addSystemMessage(`${json.message} (${instance})`); + return; + } + + for (const e of json["data"]["emotes"]) { + emotes[e["code"]] = `${instance}/static/userdata/emotes/${e["id"]}/1x.webp`; + } + }); }
\ No newline at end of file |
