summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-10-26 00:56:39 +0500
committerilotterytea <iltsu@alright.party>2025-10-26 00:56:39 +0500
commit747f552eee9e45d017b810ab438ac91d1dbd2b70 (patch)
tree4c8724c1cabccbd8cd4afd23106ece92f811bb4e /scripts
parent0ac966b46700a725b155309147912c7dc53740b2 (diff)
feat: ffz emotes
Diffstat (limited to 'scripts')
-rw-r--r--scripts/emotes.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/emotes.js b/scripts/emotes.js
index 84f9901..f99bb44 100644
--- a/scripts/emotes.js
+++ b/scripts/emotes.js
@@ -46,4 +46,43 @@ function get7TVGlobalEmotes(emotes) {
emotes[e["name"]] = `https://cdn.7tv.app/emote/${e["id"]}/1x.webp`;
}
});
+}
+
+function getFFZChannelEmotes(twitchId, emotes) {
+ return fetch(`https://api.frankerfacez.com/v1/room/id/${twitchId}`)
+ .then((r) => r.json())
+ .then((json) => {
+ if ("error" in json) {
+ addSystemMessage(`${json["error"]} (FFZ)`);
+ return;
+ }
+
+ const room = json["room"];
+
+ if ("moderator_badge" in room) {
+ badges["moderator/1"] = room["moderator_badge"];
+ }
+
+ if ("vip_badge" in room) {
+ badges["vip/1"] = room["vip_badge"]["1"];
+ }
+
+ if (room["set"] in json["sets"]) {
+ for (const e of json["sets"][room["set"]]["emoticons"]) {
+ emotes[e["name"]] = e["urls"]["1"];
+ }
+ }
+ });
+}
+
+function getFFZGlobalEmotes(emotes) {
+ return fetch(`https://api.frankerfacez.com/v1/set/global`)
+ .then((r) => r.json())
+ .then((json) => {
+ for (const id of json["default_sets"]) {
+ for (const e of json["sets"][id]["emoticons"]) {
+ emotes[e["name"]] = e["urls"]["1"];
+ }
+ }
+ });
} \ No newline at end of file