updated name check
diff --git a/src/reflex/scanners.ts b/src/reflex/scanners.ts
index a6e94d6..0eb2dea 100644
--- a/src/reflex/scanners.ts
+++ b/src/reflex/scanners.ts
@@ -217,9 +217,13 @@
if (!guildData.logging.staff.channel) return;
const [loose, strict] = [guildData.filters.wordFilter.words.loose, guildData.filters.wordFilter.words.strict];
// Does the username contain filtered words
- const usernameCheck = TestString(member.user.username, loose, strict, guildData.filters.wordFilter.enabled);
// Does the nickname contain filtered words
- const nicknameCheck = TestString(member.nickname ?? "", loose, strict, guildData.filters.wordFilter.enabled);
+ let nameCheck;
+ if(member.nickname) {
+ nameCheck = TestString(member.nickname ?? "", loose, strict, guildData.filters.wordFilter.enabled);
+ } else {
+ nameCheck = TestString(member.user.username, loose, strict, guildData.filters.wordFilter.enabled);
+ }
// Does the profile picture contain filtered words
const avatarTextCheck = TestString(
(await TestImage(member.displayAvatarURL({ forceStatic: true }))) ?? "",
@@ -236,8 +240,7 @@
const nicknameInviteCheck =
guildData.filters.invite.enabled && /discord\.gg\/[a-zA-Z0-9]+/gi.test(member.nickname ?? "");
if (
- usernameCheck !== null ||
- nicknameCheck !== null ||
+ nameCheck !== null ||
avatarCheck ||
inviteCheck ||
nicknameInviteCheck ||