Fix scanning on avatar update
diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index d1bbd9b..242b10a 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -12,6 +12,7 @@
await client.database.premium.checkAllPremium(after);
}
+ if (before.displayAvatarURL({forceStatic: true}) !== after.displayAvatarURL({forceStatic: true})) await doMemberChecks(after);
if (!before.roles.cache.equals(after.roles.cache)) {
const auditLog = (await getAuditLog(after.guild, AuditLogEvent.MemberRoleUpdate)).filter(
(entry: GuildAuditLogsEntry) => (entry.target as GuildMember)!.id === after.id
@@ -87,7 +88,6 @@
await log(data);
}
}
- if (before.displayAvatarURL !== after.displayAvatarURL) await doMemberChecks(after);
const auditLog = (await getAuditLog(after.guild, AuditLogEvent.MemberUpdate)).filter(
(entry: GuildAuditLogsEntry) => (entry.target as GuildMember)!.id === after.id
)[0];
diff --git a/src/reflex/scanners.ts b/src/reflex/scanners.ts
index 405e109..c6a0e32 100644
--- a/src/reflex/scanners.ts
+++ b/src/reflex/scanners.ts
@@ -202,6 +202,7 @@
oem: 1,
psm: 3
});
+ console.log(text);
return text;
}
@@ -221,7 +222,7 @@
console.log(3, nicknameCheck);
// Does the profile picture contain filtered words
const avatarTextCheck = TestString(
- (await TestImage(member.user.displayAvatarURL({ forceStatic: true }))) ?? "",
+ (await TestImage(member.displayAvatarURL({ forceStatic: true }))) ?? "",
loose,
strict,
guildData.filters.wordFilter.enabled
@@ -264,7 +265,7 @@
}
if (avatarTextCheck !== null) {
infractions.push(
- `Profile picture contains a ${avatarTextCheck.type}ly filtered word: ${avatarTextCheck.word}`
+ `Profile picture contains a ${avatarTextCheck.type}ly filtered word (${avatarTextCheck.word})`
);
}
if (infractions.length === 0) return;
@@ -301,7 +302,7 @@
.setLabel("Ban")
.setStyle(ButtonStyle.Danger)
].concat(
- usernameCheck !== null || nicknameCheck !== null || avatarTextCheck !== null
+ usernameCheck !== null || nicknameCheck !== null
? [
new ButtonBuilder()
.setCustomId(`mod:nickname:${member.user.id}`)