Remove top.gg, add bots.gg

This commit is contained in:
Dragon Fire
2021-03-21 20:38:59 -04:00
parent 99864b1bcd
commit 3e8de6fefd
4 changed files with 24 additions and 2 deletions
+15 -1
View File
@@ -17,7 +17,8 @@ const {
XIAO_WEBHOOK_ID,
XIAO_WEBHOOK_TOKEN,
REPORT_CHANNEL_ID,
JOIN_LEAVE_CHANNEL_ID
JOIN_LEAVE_CHANNEL_ID,
BOTS_GG_TOKEN
} = process.env;
module.exports = class XiaoClient extends CommandoClient {
@@ -57,6 +58,19 @@ module.exports = class XiaoClient extends CommandoClient {
return this.fonts;
}
async postBotsGGStats() {
try {
const { body } = await request
.post(`https://discord.bots.gg/api/bots/${this.user.id}/stats`)
.set({ Authorization: BOTS_GG_TOKEN })
.send({ guildCount: this.guilds.size });
this.logger.info('[BOTS.GG] Posted stats.');
return body;
} catch (err) {
this.logger.error(`[BOTS.GG] Failed to post stats:\n${err.stack}`);
}
}
importBlacklist() {
const read = fs.readFileSync(path.join(__dirname, '..', 'blacklist.json'), { encoding: 'utf8' });
const file = JSON.parse(read);