mirror of
				https://github.com/musix-org/musix-oss
				synced 2025-11-04 06:49:31 +00:00 
			
		
		
		
	Update botListApi.js
This commit is contained in:
		@@ -1,14 +1,15 @@
 | 
				
			|||||||
module.exports = function (client) {
 | 
					module.exports = function (client) {
 | 
				
			||||||
 | 
					    if (client.shard.ids !== 0) return;
 | 
				
			||||||
    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(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(guildCount * 7, client.shard.ids, client.config.shards);
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        .catch(console.error);
 | 
					        .catch(console.error);
 | 
				
			||||||
@@ -16,10 +17,13 @@ module.exports = function (client) {
 | 
				
			|||||||
    dbl.on("error", (e) => {
 | 
					    dbl.on("error", (e) => {
 | 
				
			||||||
        console.log(`DBL 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}`);
 | 
					        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",
 | 
				
			||||||
@@ -34,3 +38,13 @@ module.exports = function (client) {
 | 
				
			|||||||
        dbl.postStats(guildCount * 7, client.shard.ids, client.config.shards);
 | 
					        dbl.postStats(guildCount * 7, client.shard.ids, client.config.shards);
 | 
				
			||||||
    }, 1800000);
 | 
					    }, 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}`);
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
		Reference in New Issue
	
	Block a user