mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 15:57:43 +02:00
Don't send leave notifs if join are turned off
This commit is contained in:
@@ -313,6 +313,7 @@ client.on('guildMemberRemove', async member => {
|
|||||||
if (member.id === client.user.id) return null;
|
if (member.id === client.user.id) return null;
|
||||||
const channel = member.guild.systemChannel;
|
const channel = member.guild.systemChannel;
|
||||||
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return null;
|
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;
|
if (channel.topic && channel.topic.includes('<xiao:disable-leave>')) return null;
|
||||||
try {
|
try {
|
||||||
const leaveMessage = client.leaveMessages[Math.floor(Math.random() * client.leaveMessages.length)];
|
const leaveMessage = client.leaveMessages[Math.floor(Math.random() * client.leaveMessages.length)];
|
||||||
|
|||||||
Reference in New Issue
Block a user