From fb7d3cffe6d689c0303e434cf5e4944c2d205db0 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Wed, 23 Apr 2025 19:15:44 -0600 Subject: [PATCH] logging: try set difference --- src/modules/logging.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/logging.js b/src/modules/logging.js index 5ef5dba..4370934 100644 --- a/src/modules/logging.js +++ b/src/modules/logging.js @@ -27,8 +27,10 @@ events.add("guildUpdate", "logging", async function (guild, oldGuild) { const channel = await getLoggingChannel(guild); if (!channel) return; - const featuresAdded = guild.features.filter((f) => !oldGuild.features.includes(f)); - const featuresRemoved = oldGuild.features.filter((f) => !guild.features.includes(f)); + const oldFeatures = new Set(oldGuild.features); + const newFeatures = new Set(guild.features); + const featuresAdded = newFeatures.difference(oldFeatures); + const featuresRemoved = oldFeatures.difference(newFeatures); if (featuresAdded.length === 0 && featuresRemoved.length === 0) return;