mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 13:53:12 +02:00
Remove top.gg, add bots.gg
This commit is contained in:
+15
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user