-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (33 loc) · 916 Bytes
/
index.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const { Plugin } = require("powercord/entities");
const pingTimeouts = [];
module.exports = class MessageLogger extends Plugin {
startPlugin() {
this.runNextTimeout();
}
pluginWillUnload() {
for (let timeout of pingTimeouts) {
clearTimeout(timeout);
}
}
runNextTimeout() {
let thisTimeout;
pingTimeouts.push(
(thisTimeout = setTimeout(() => {
pingTimeouts.splice(pingTimeouts.indexOf(thisTimeout), 1);
// If the current date is April 1st...
if (new Date().getMonth() == 3 && new Date().getDate() == 1) {
new Audio(
"https://discord.com/assets/dd920c06a01e5bb8b09678581e29d56f.mp3"
).play();
if (pingTimeouts.length < 1024) {
this.runNextTimeout();
}
}
this.runNextTimeout();
}, this.rand(1e2, 60e3 * 5)))
);
}
rand(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
};