summaryrefslogtreecommitdiff
path: root/twitch.html
diff options
context:
space:
mode:
Diffstat (limited to 'twitch.html')
-rw-r--r--twitch.html20
1 files changed, 15 insertions, 5 deletions
diff --git a/twitch.html b/twitch.html
index 504c752..109c676 100644
--- a/twitch.html
+++ b/twitch.html
@@ -16,15 +16,23 @@
<script>
let user = null;
const params = {
+ "ircserver": "wss://irc-ws.chat.twitch.tv",
+ "ircuser": "justinfan12345",
+ "ircpass": "65432",
"channel": null,
"tinyemotesinstances": null,
- "fetchrecentmessages": null
+ "fetchrecentmessages": null,
+ "membership": null,
+ "thirdpartyemotes": null
};
const badges = {};
const emotes = {};
window.addEventListener("load", () => {
for (const [k, v] of new URLSearchParams(window.location.search)) {
+ if (v.trim().length == 0) {
+ continue;
+ }
params[k] = v;
}
@@ -47,7 +55,7 @@
getRecentMessages(user["login"]);
}
- connectToChat("wss://irc-ws.chat.twitch.tv", "justinfan12345", "65432", user["login"]);
+ connectToChat(params.ircserver, params.ircuser, params.ircpass, user["login"]);
getTwitchBadges(user["login"], badges);
// adding emotes
@@ -67,9 +75,11 @@
}
}
- emotePromises
- .reduce((p, fn) => p.then(fn), Promise.resolve())
- .then(() => addSystemMessage("All emotes loaded"));
+ if (params.thirdpartyemotes) {
+ emotePromises
+ .reduce((p, fn) => p.then(fn), Promise.resolve())
+ .then(() => addSystemMessage("All emotes loaded"));
+ }
});
});
</script>