diff --git a/event/listeners/guildMemberAdd.js b/event/listeners/guildMemberAdd.js index f8aee88..de806c7 100644 --- a/event/listeners/guildMemberAdd.js +++ b/event/listeners/guildMemberAdd.js @@ -28,7 +28,7 @@ class guildMemberAddListener extends Listener { let username = guild.user.username; let user = guild.user; - if (guild.guild.member(guild.user).nickname.match(invite)) { + if (username.match(invite)) { username = username.replace(/(https?:\/\/)?(www\.)?discord(?:app\.com|\.gg)[/invite/]?(?:(?!.*[Ii10OolL]).[a-zA-Z0-9]{5,6}|[a-zA-Z0-9-]{2,32})/g, '[REDACTED]'); user = username; } diff --git a/event/listeners/guildMemberRemove.js b/event/listeners/guildMemberRemove.js index d2de78b..ee62e86 100644 --- a/event/listeners/guildMemberRemove.js +++ b/event/listeners/guildMemberRemove.js @@ -21,7 +21,7 @@ class guildMemberRemoveListener extends Listener { let username = guild.user.username; let user = guild.user; - if (guild.guild.member(guild.user).nickname.match(invite)) { + if (username.match(invite)) { username = username.replace(/(https?:\/\/)?(www\.)?discord(?:app\.com|\.gg)[/invite/]?(?:(?!.*[Ii10OolL]).[a-zA-Z0-9]{5,6}|[a-zA-Z0-9-]{2,32})/g, '[REDACTED]'); user = username; }