diff --git a/assets/js/splitstat.js b/assets/js/splitstat.js new file mode 100644 index 0000000..f09303f --- /dev/null +++ b/assets/js/splitstat.js @@ -0,0 +1,18 @@ +async function checkForOutage() { + Global = {} + Global.error = false + await fetch(`https://api-splitstat.awexxx.xyz/heartbeat`).then(response => response.json()).catch(err => { + Global.error = true; + document.getElementById(`status`).innerText = `offline!` + document.getElementById(`addon`).innerText = `API returned nothing when sent a heartbeat.` + }) + + if (Global.error === false) { + document.getElementById(`status`).innerText = `online!` + document.getElementById(`addon`).innerText = `API responded when sent a heartbeat!` + } + + console.log(`Checked, checking in 10s`) + + setTimeout(checkForOutage, 10000); +} \ No newline at end of file diff --git a/splitstat.html b/splitstat.html index bd9a7b1..357abb8 100644 --- a/splitstat.html +++ b/splitstat.html @@ -1,139 +1,6 @@ - -
-Get some stats with one command! Splitstat is the free, open-source Discord bot to check up on how you're doing in-game!
- Note: This can only look up Steam users at the moment until XBL & PSN support is implemented on Tracker.gg's side.
To learn how to find your profile, see spl!idhelp!
-Prefix is spl!
- ping
- stat
- cat
-idhelp
-help

Click on this to add it to your server!
- - - - - - - \ No newline at end of file +