Use partials for guildMemberRemove

This commit is contained in:
Dragon Fire
2020-11-06 13:05:50 -05:00
parent 39cba8d455
commit 527b99971c
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -8,6 +8,7 @@ const client = new Client({
owner: OWNERS.split(','),
invite: INVITE,
disableMentions: 'everyone',
partials: ['GUILD_MEMBER'],
ws: { intents: [Intents.NON_PRIVILEGED, 'GUILD_MEMBERS'] }
});
const { formatNumber } = require('./util/Util');
@@ -153,6 +154,7 @@ client.on('guildDelete', async guild => {
client.on('guildMemberRemove', async member => {
if (member.id === client.user.id) return null;
if (member.partial) await member.fetch();
const channel = member.guild.systemChannel;
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return null;
if (channel.topic && channel.topic.includes('<xiao:disable-leave>')) return null;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.37.4",
"version": "119.37.5",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {