From 12da2b390d0f8233b85c7aad1577a4f3f1daf4fc Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 19 Aug 2022 15:52:04 +0300 Subject: [PATCH] bugfix to invite filter not checking origin server properly --- src/structure/components/observers/Automoderation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structure/components/observers/Automoderation.js b/src/structure/components/observers/Automoderation.js index e0ad43d..61ab18c 100644 --- a/src/structure/components/observers/Automoderation.js +++ b/src/structure/components/observers/Automoderation.js @@ -571,9 +571,9 @@ module.exports = class AutoModeration extends Observer { const match = content.match(this.regex.invite); if (!match) return; - const result = await wrapper.checkInvite(match.groups.code); const invite = await this.client.fetchInvite(match.groups.code).catch(() => null); - if (whitelist.includes(invite?.guild?.id)) return; + const result = await wrapper.checkInvite(match.groups.code) || invite?.guild?.id === wrapper.id; + if (whitelist.includes(invite?.guild?.id) || result) return; if (!result) { // Doesn't resolve to the origin server