-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
rbl.js
31 lines (28 loc) · 706 Bytes
/
rbl.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
const RevoltBots = require('revoltbots.js');
class RBL {
remix;
api;
constructor(remix) {
if (!remix.config.rbl.token) {
console.log("No rbl config found. Disabling stats updates.");
return this;
}
this.api = new RevoltBots.Client(remix.config.rbl.token);
this.remix = remix;
remix.client.once("ready", () => {
this.post();
});
remix.client.on("serverCreate", () => {
this.post();
});
remix.client.on("serverDelete", () => {
this.post();
});
}
post() {
this.api.postStats(this.remix.client).then(result => {
if (!result.message == "Successfully updated.") console.log(result);
});
}
}
module.exports = RBL;