diff options
Diffstat (limited to 'scripts/emotes.js')
| -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 |
