mirror of
https://github.com/musix-org/musix-oss
synced 2024-11-10 02:00:20 +00:00
Update botListApi.js
This commit is contained in:
parent
f3fb31466d
commit
cfee618ae1
@ -1,14 +1,15 @@
|
||||
module.exports = function (client) {
|
||||
if (client.shard.ids !== 0) return;
|
||||
const DBL = require("dblapi.js");
|
||||
const dbl = new DBL(client.config.dblKey, client);
|
||||
/*const bod_api = require("bodapi.js");
|
||||
const bod = new bod_api("Your api token", client);*/
|
||||
let guildCount
|
||||
const bod_api = require("bodapi.js");
|
||||
const bod = new bod_api(client.config.bodKey, client);
|
||||
let guildCount;
|
||||
|
||||
client.shard
|
||||
.broadcastEval("this.guilds.cache.size")
|
||||
.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);
|
||||
})
|
||||
.catch(console.error);
|
||||
@ -16,21 +17,34 @@ module.exports = function (client) {
|
||||
dbl.on("error", (e) => {
|
||||
console.log(`DBL error: ${e}`);
|
||||
});
|
||||
/*bod.on("error", (e) => {
|
||||
bod.on("posted", (m) => {
|
||||
console.log(m);
|
||||
});
|
||||
bod.on("error", (e) => {
|
||||
console.log(`BOD error ${e}`);
|
||||
});
|
||||
const authOptions = {
|
||||
url: "https://discord.bots.gg/bots/607266889537945605/stats",
|
||||
headers: {
|
||||
Host: "https://discord.bots.gg/api/v1",
|
||||
Authorization: client.config.botListKey,
|
||||
Content - Type: "application/json",
|
||||
{
|
||||
"guildCount": 10
|
||||
}
|
||||
}
|
||||
}*/
|
||||
/*const authOptions = {
|
||||
url: "https://discord.bots.gg/bots/607266889537945605/stats",
|
||||
headers: {
|
||||
Host: "https://discord.bots.gg/api/v1",
|
||||
Authorization: client.config.botListKey,
|
||||
Content - Type: "application/json",
|
||||
{
|
||||
"guildCount": 10
|
||||
}
|
||||
}
|
||||
}*/
|
||||
setInterval(() => {
|
||||
dbl.postStats(guildCount * 7, client.shard.ids, client.config.shards);
|
||||
}, 1800000);
|
||||
};
|
||||
};
|
||||
const bod_api = require("bodapi.js");
|
||||
|
||||
const bod = new bod_api("ApeUyjSHi0tmMYybVwai3PxKvFvq3S", client);
|
||||
|
||||
bod.on("posted", (m) => {
|
||||
console.log(m);
|
||||
});
|
||||
bod.on("error", (e) => {
|
||||
console.log(`BOD error ${e}`);
|
||||
});
|
Loading…
Reference in New Issue
Block a user