Don't send leave notifs if join are turned off

This commit is contained in:
Dragon Fire
2021-05-02 11:38:07 -04:00
parent bbb6737702
commit 162bca86ee
+1
View File
@@ -313,6 +313,7 @@ client.on('guildMemberRemove', async member => {
if (member.id === client.user.id) return null;
const channel = member.guild.systemChannel;
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return null;
if (channel.systemChannelFlags.has('SUPPRESS_JOIN_NOTIFICATIONS')) return null;
if (channel.topic && channel.topic.includes('<xiao:disable-leave>')) return null;
try {
const leaveMessage = client.leaveMessages[Math.floor(Math.random() * client.leaveMessages.length)];