summaryrefslogtreecommitdiff
path: root/twitch.html
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-10-26 22:32:49 +0500
committerilotterytea <iltsu@alright.party>2025-10-26 22:32:49 +0500
commit94e74ac79e775253b56384748c619a764d31e091 (patch)
tree403969aba0a764a2dad89da47d3d4764654c6873 /twitch.html
parent051ec346e7e0f2581d15ffd8a696caa195c989e4 (diff)
feat: fetch recent messages
Diffstat (limited to 'twitch.html')
-rw-r--r--twitch.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/twitch.html b/twitch.html
index 9adc40c..504c752 100644
--- a/twitch.html
+++ b/twitch.html
@@ -16,7 +16,9 @@
<script>
let user = null;
const params = {
- "tinyemotesinstances": null
+ "channel": null,
+ "tinyemotesinstances": null,
+ "fetchrecentmessages": null
};
const badges = {};
const emotes = {};
@@ -26,7 +28,7 @@
params[k] = v;
}
- if (!("channel" in params)) {
+ if (params.channel == null) {
addSystemMessage("No channel specified!");
return;
}
@@ -38,7 +40,13 @@
addSystemMessage(`Channel #${params["channel"]} does not exist.`);
return;
}
+
user = json[0];
+
+ if (params.fetchrecentmessages != null) {
+ getRecentMessages(user["login"]);
+ }
+
connectToChat("wss://irc-ws.chat.twitch.tv", "justinfan12345", "65432", user["login"]);
getTwitchBadges(user["login"], badges);