-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.js
More file actions
42 lines (36 loc) · 971 Bytes
/
commands.js
File metadata and controls
42 lines (36 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var loaded = false;
var fill = false;
var data = getData();
window.onload = function()
{
let days = getDate(totalDays, -1, true);
let today = days[totalDays];
days.push(getDate(1)[0]);
data.data.labels = days;
fetch("https://bolo-cors.herokuapp.com/https://discorddb.000webhostapp.com/get?k=&e=json&f=serverActivity").then((d) => d.json()).then((d) => {
let commands = [ [ ], [ ] ];
for (let i = 0; i <= totalDays; i++)
for (let j = 0; j < 2; j++)
commands[j].push(d[days[i]] ? d[days[i]].b[j] : 0);
data.data.datasets = [
{
label: "Bot",
backgroundColor: hexToRGBA("#BE64C4"),
borderColor: "#BE64C4",
data: commands[0]
},
{
label: "Global",
backgroundColor: hexToRGBA("#FFC472"),
borderColor: "#FFC472",
data: commands[1]
}
];
loaded = create();
});
}
window.onkeypress = function(k){
if (!loaded) return;
if (k.keyCode == 32)
create(fill = !fill);
}