From ac2df5fb65d7425fe4f6d19cbf0182e3dd3a858a Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 26 Dec 2019 17:29:22 +0100 Subject: [PATCH] Forgot to remove that test thing --- event/listeners/guildMemberAdd.js | 2 +- event/listeners/guildMemberRemove.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; }