From fa46943e12997dc3a9b72d3417d46bdca45825a4 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 16 Apr 2021 08:00:11 -0400 Subject: [PATCH] Fix --- Xiao.js | 1 + structures/Client.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Xiao.js b/Xiao.js index 381e6d17..401fca85 100644 --- a/Xiao.js +++ b/Xiao.js @@ -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) { diff --git a/structures/Client.js b/structures/Client.js index 741d48b2..7fbb2417 100644 --- a/structures/Client.js +++ b/structures/Client.js @@ -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) {