1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 03:33:17 +00:00

Update botListApi.js

This commit is contained in:
MatteZ02 2020-04-27 15:54:37 +03:00
parent b33b82936d
commit 83b449e17f

View File

@ -1,26 +1,26 @@
module.exports = function (client) { module.exports = function (client) {
const DBL = require("dblapi.js"); const DBL = require("dblapi.js");
const dbl = new DBL(client.config.dblKey, client); const dbl = new DBL(client.config.dblKey, client);
const bod_api = require("bodapi.js"); const bod_api = require("bodapi.js");
const bod = new bod_api(client.config.bodKey, client); const bod = new bod_api(client.config.bodKey, client);
let guildCount; let guildCount;
client.shard client.shard
.broadcastEval("this.guilds.cache.size") .broadcastEval("this.guilds.cache.size")
.then((results) => { .then((results) => {
guildCount = results.reduce((prev, val) => prev + val, 0); guildCount = results.reduce((prev, val) => prev + val, 0);
dbl.postStats(guildCount * 7, client.shard.ids, client.config.shards); dbl.postStats(0, client.shard.ids, client.config.shards);
bod.postStats(guildCount * 7, client.shard.ids, client.config.shards); bod.postStats(0, client.shard.ids, client.config.shards);
}) })
.catch(console.error); .catch(console.error);
dbl.on("error", (e) => { dbl.on("error", (e) => {
console.log(`DBL error: ${e}`); console.log(`DBL error: ${e}`);
}); });
bod.on("error", (e) => { bod.on("error", (e) => {
console.log(`BOD error ${e}`); console.log(`BOD error ${e}`);
}); });
/*const authOptions = { /*const authOptions = {
url: "https://discord.bots.gg/bots/607266889537945605/stats", url: "https://discord.bots.gg/bots/607266889537945605/stats",
headers: { headers: {
Host: "https://discord.bots.gg/api/v1", Host: "https://discord.bots.gg/api/v1",
@ -31,8 +31,8 @@ module.exports = function (client) {
} }
} }
}*/ }*/
setInterval(() => { setInterval(() => {
dbl.postStats(guildCount * 7, client.shard.ids, client.config.shards); /*dbl.postStats(guildCount * 7, client.shard.ids, client.config.shards);
bod.postStats(guildCount * 7, client.shard.ids, client.config.shards) bod.postStats(guildCount * 7, client.shard.ids, client.config.shards)*/
}, 1800000); }, 1800000);
}; };