diff options
| -rw-r--r-- | bot/cogs/filtering.py | 14 | 
1 files changed, 6 insertions, 8 deletions
| diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py index b6ce501fc..0ba1e49c5 100644 --- a/bot/cogs/filtering.py +++ b/bot/cogs/filtering.py @@ -238,15 +238,13 @@ class Filtering:                  f"{URLs.discord_invite_api}/{invite}"              )              response = await response.json() -            if response.get("guild") is None: -                # If we have a valid invite which is not a guild invite -                # it might be a DM channel invite -                if response.get("channel") is not None: -                    # We don't have whitelisted Group DMs so we can -                    # go ahead and return a positive for any group DM -                    return True +            guild = response.get("guild") +            if guild is None: +                # We don't have whitelisted Group DMs so we can +                # go ahead and return a positive for any group DM +                return True -            guild_id = int(response.get("guild").get("id")) +            guild_id = int(guild.get("id"))              if guild_id not in Filter.guild_invite_whitelist:                  return True | 
