fix: check if member bannable, exclude bots + system

This commit is contained in:
2025-09-04 09:30:53 -07:00
parent 3e45414c4f
commit d5e1f8d806
+8 -1
View File
@@ -20,7 +20,11 @@ export const handleMessage = async(
if (!message.inGuild()) { if (!message.inGuild()) {
return; return;
} }
const { author, member, guild, channel } = message; const { author, member, guild, channel, system } = message;
if (author.bot || system) {
return;
}
const cached = umbrelle.cache.get(guild.id); const cached = umbrelle.cache.get(guild.id);
if (cached !== channel.id) { if (cached !== channel.id) {
@@ -34,6 +38,9 @@ export const handleMessage = async(
if (!resolvedMember) { if (!resolvedMember) {
return; return;
} }
if (!resolvedMember.bannable) {
return;
}
await author.send({ await author.send({
content: `Your account appears to have been compromised. As a security measure, you have been removed from the ${guild.name} community. content: `Your account appears to have been compromised. As a security measure, you have been removed from the ${guild.name} community.