mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 18:05:01 +02:00
Remove top.gg, add bots.gg
This commit is contained in:
@@ -10,6 +10,9 @@ XIAO_WEBHOOK_TOKEN=
|
|||||||
REPORT_CHANNEL_ID=
|
REPORT_CHANNEL_ID=
|
||||||
JOIN_LEAVE_CHANNEL_ID=
|
JOIN_LEAVE_CHANNEL_ID=
|
||||||
|
|
||||||
|
# Bot list tokens
|
||||||
|
BOTS_GG_TOKEN=
|
||||||
|
|
||||||
# Redis info
|
# Redis info
|
||||||
REDIS_HOST=
|
REDIS_HOST=
|
||||||
REDIS_PASS=
|
REDIS_PASS=
|
||||||
|
|||||||
@@ -147,6 +147,10 @@ client.on('ready', async () => {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
client.logger.error(`[ADULT SITES] Failed to fetch list\n${err.stack}`);
|
client.logger.error(`[ADULT SITES] Failed to fetch list\n${err.stack}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Post bot list stats
|
||||||
|
await client.postBotsGGStats();
|
||||||
|
setInterval(() => client.postBotsGGStats(), 1.8e+6);
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('message', async msg => {
|
client.on('message', async msg => {
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ module.exports = class InfoCommand extends Command {
|
|||||||
.addField('❯ Home Server',
|
.addField('❯ Home Server',
|
||||||
this.client.options.invite ? embedURL('Invite', this.client.options.invite) : 'None', true)
|
this.client.options.invite ? embedURL('Invite', this.client.options.invite) : 'None', true)
|
||||||
.addField('❯ Invite', embedURL('Add Me', invite), true)
|
.addField('❯ Invite', embedURL('Add Me', invite), true)
|
||||||
.addField('❯ Top.gg', embedURL('Vote!', `https://top.gg/bot/${this.client.user.id}`), true)
|
.addField('❯ Bot List',
|
||||||
|
embedURL('discord.bots.gg', `https://discord.bots.gg/bots/${this.client.user.id}`), true)
|
||||||
.addField('❯ Memory Usage', `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB`, true)
|
.addField('❯ Memory Usage', `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB`, true)
|
||||||
.addField('❯ Uptime', moment.duration(this.client.uptime).format('d:hh:mm:ss'), true)
|
.addField('❯ Uptime', moment.duration(this.client.uptime).format('d:hh:mm:ss'), true)
|
||||||
.addField('❯ Version', `v${version}`, true)
|
.addField('❯ Version', `v${version}`, true)
|
||||||
|
|||||||
+15
-1
@@ -17,7 +17,8 @@ const {
|
|||||||
XIAO_WEBHOOK_ID,
|
XIAO_WEBHOOK_ID,
|
||||||
XIAO_WEBHOOK_TOKEN,
|
XIAO_WEBHOOK_TOKEN,
|
||||||
REPORT_CHANNEL_ID,
|
REPORT_CHANNEL_ID,
|
||||||
JOIN_LEAVE_CHANNEL_ID
|
JOIN_LEAVE_CHANNEL_ID,
|
||||||
|
BOTS_GG_TOKEN
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
module.exports = class XiaoClient extends CommandoClient {
|
module.exports = class XiaoClient extends CommandoClient {
|
||||||
@@ -57,6 +58,19 @@ module.exports = class XiaoClient extends CommandoClient {
|
|||||||
return this.fonts;
|
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() {
|
importBlacklist() {
|
||||||
const read = fs.readFileSync(path.join(__dirname, '..', 'blacklist.json'), { encoding: 'utf8' });
|
const read = fs.readFileSync(path.join(__dirname, '..', 'blacklist.json'), { encoding: 'utf8' });
|
||||||
const file = JSON.parse(read);
|
const file = JSON.parse(read);
|
||||||
|
|||||||
Reference in New Issue
Block a user