1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 03:33:17 +00:00
This commit is contained in:
MatteZ02 2020-04-25 12:56:13 +03:00
parent 6c44051a9d
commit f3fb31466d
2 changed files with 25 additions and 19 deletions

View File

@ -4,6 +4,7 @@ module.exports = {
token: process.env.TOKEN, token: process.env.TOKEN,
devToken: process.env.DEVTOKEN, devToken: process.env.DEVTOKEN,
dblKey: process.env.DBLKEY, dblKey: process.env.DBLKEY,
bodKey: process.env.BODKEY,
api_key: process.env.GOOGLE_API_KEY, api_key: process.env.GOOGLE_API_KEY,
genius_api_key: process.env.GENIUS_API_KEY, genius_api_key: process.env.GENIUS_API_KEY,
soundCloud_api_key: process.env.SOUNDCLOUD_API_KEY, soundCloud_api_key: process.env.SOUNDCLOUD_API_KEY,

View File

@ -1,16 +1,25 @@
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("Your api token", client); const bod = new bod_api("Your api token", client);*/
let guildCount
client.shard
.broadcastEval("this.guilds.cache.size")
.then((results) => {
guildCount = results.reduce((prev, val) => prev + val, 0)
dbl.postStats(guildCount * 7, client.shard.ids, client.config.shards);
})
.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",
@ -22,10 +31,6 @@ module.exports = function (client) {
} }
}*/ }*/
setInterval(() => { setInterval(() => {
dbl.postStats( dbl.postStats(guildCount * 7, client.shard.ids, client.config.shards);
client.guilds.cache.size,
client.shard.ids,
client.config.shards
);
}, 1800000); }, 1800000);
}; };