mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Fix
This commit is contained in:
@@ -310,6 +310,7 @@ client.on('voiceStateUpdate', async (oldState, newState) => {
|
||||
client.dispatchers.delete(oldState.guild.id);
|
||||
} else {
|
||||
const channel = await client.channels.fetch(oldState.channelID);
|
||||
if (!channel) return;
|
||||
if (channel.members.size === 1 && channel.members.has(client.user.id)) {
|
||||
const dispatcher = client.dispatchers.get(oldState.guild.id);
|
||||
if (dispatcher) {
|
||||
|
||||
@@ -66,12 +66,8 @@ module.exports = class XiaoClient extends CommandoClient {
|
||||
try {
|
||||
const { body } = await request
|
||||
.post(`https://discordbotlist.com/api/v1/bots/${this.user.id}/stats`)
|
||||
.set({ Authorization: DISCORDBOTLIST_TOKEN })
|
||||
.send({
|
||||
guilds: this.guilds.size,
|
||||
users: this.users.size,
|
||||
voice_connections: this.dispatchers.size
|
||||
});
|
||||
.set({ Authorization: BOTS_GG_TOKEN })
|
||||
.send({ guildCount: this.guilds.size });
|
||||
this.logger.info('[BOTS.GG] Posted stats.');
|
||||
return body;
|
||||
} catch (err) {
|
||||
@@ -84,8 +80,12 @@ module.exports = class XiaoClient extends CommandoClient {
|
||||
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 });
|
||||
.set({ Authorization: DISCORDBOTLIST_TOKEN })
|
||||
.send({
|
||||
guilds: this.guilds.size,
|
||||
users: this.users.size,
|
||||
voice_connections: this.dispatchers.size
|
||||
});
|
||||
this.logger.info('[DISCORDBOTLIST] Posted stats.');
|
||||
return body;
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user