bugfix to invite filter not checking origin server properly

This commit is contained in:
Erik 2022-08-19 15:52:04 +03:00
parent 8cd43df415
commit 12da2b390d
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -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