2024-05-11 02:31:13 -04:00
|
|
|
shouldLog = false;
|
|
|
|
function log(content) {
|
|
|
|
if (shouldLog) console.log(content);
|
|
|
|
}
|
2024-05-10 18:02:26 -04:00
|
|
|
function onUpdate(data) {
|
|
|
|
// set status
|
2024-05-11 02:31:13 -04:00
|
|
|
log(data)
|
2024-05-10 18:02:26 -04:00
|
|
|
const pfp = document.getElementById("pfp");
|
|
|
|
switch(data["discord_status"]) {
|
|
|
|
case "online":
|
|
|
|
pfp.style.borderColor = "var(--online-color)";
|
|
|
|
break;
|
|
|
|
case "idle":
|
|
|
|
pfp.style.borderColor = "var(--idle-color)";
|
|
|
|
break;
|
|
|
|
case "dnd":
|
|
|
|
pfp.style.borderColor = "var(--dnd-color)";
|
|
|
|
break;
|
|
|
|
case "offline":
|
|
|
|
pfp.style.borderColor = "var(--offline-color)";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LanyardWrapper.connectWebSocket("886685857560539176", onUpdate)
|
|
|
|
.catch(err => {
|
|
|
|
console.error(err);
|
|
|
|
});
|