diff options
| author | ilotterytea <iltsu@alright.party> | 2025-10-27 00:06:35 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-10-27 00:06:35 +0500 |
| commit | afd99384d0ca224907901a92a87963663559589d (patch) | |
| tree | 98577634eecc10994820fd54e82640e0f5892ec9 /twitch.html | |
| parent | 94e74ac79e775253b56384748c619a764d31e091 (diff) | |
feat: generate twitch chat via form
Diffstat (limited to 'twitch.html')
| -rw-r--r-- | twitch.html | 20 |
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> |
