forked from Magnimont/Mikuni-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats.js
24 lines (23 loc) · 994 Bytes
/
stats.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function fetchData() {
fetch('https://api.statcord.com/v3/884467910494535741').then(response => {
return response.json();
}).then(data => {
let Data = true;
let servers = 519;
console.log(data.data[0].servers);
document.querySelector('#server-count').innerHTML = Data ? `<h4>${servers}` : `<h4>${data.data[0].servers}`
console.log(data.data[0].users);
document.querySelector('#user-count').innerHTML = `<h4>${data.data[0].users}`
console.log(data.data[0].users);
document.querySelector('#cmd-count').innerHTML = `<h4>${data.data[0].commands}`
// console.log(data.popular);
// if (data.popular[0].name === "help") {
// return document.querySelector('#most-pop-cmd').innerHTML = `<h4>Most Used Command</h4><br /><p>e!${data.popular[1].name}</p>`
// } else {
// return document.querySelector('#most-pop-cmd').innerHTML = `<h4>Most Used Command</h4><br /><p>e!${data.popular[0].name}</p>`
// }
}).catch(error => {
console.log(error);
});
}
fetchData();