Bot list stuff

This commit is contained in:
Daniel Odendahl Jr
2018-04-28 21:13:30 +00:00
parent 9a6c39e567
commit f8b0d36030
3 changed files with 27 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
const snekfetch = require('snekfetch');
const { DISCORD_BOTS_TOKEN } = process.env;
class BotListUtil {
static async discordBots(client) {
try {
const { body } = await snekfetch
.post(`https://bots.discord.pw/api/bots/${client.user.id}/stats`)
.set({ Authorization: DISCORD_BOTS_TOKEN })
.send({ server_count: client.guilds.size });
console.log('[DISCORD BOTS] Posted to Discord Bots.');
return body;
} catch (err) {
console.error('[DISCORD BOTS] Failed to post to Discord Bots.', err);
return err;
}
}
}
module.exports = BotListUtil;