diff options
| author | 2018-12-27 20:39:16 +0100 | |
|---|---|---|
| committer | 2018-12-27 20:39:16 +0100 | |
| commit | 4919853db7fd0d622eb1cf8cd1edbd0c14e21569 (patch) | |
| tree | 8407af2cea483b0ca933654bef642e5f10b3858c | |
| parent | Merge pull request #222 from python-discord/incorrect-commands-default-tag-get (diff) | |
| parent | Merge branch 'master' into group-dm-invites (diff) | |
Merge pull request #226 from python-discord/group-dm-invites
Disallow Group DM invites from the invite filter
Diffstat (limited to '')
| -rw-r--r-- | bot/cogs/filtering.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py index a8b5091af..b6ce501fc 100644 --- a/bot/cogs/filtering.py +++ b/bot/cogs/filtering.py @@ -238,7 +238,15 @@ class Filtering: f"{URLs.discord_invite_api}/{invite}" ) response = await response.json() - guild_id = int(response.get("guild", {}).get("id")) + 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_id = int(response.get("guild").get("id")) if guild_id not in Filter.guild_invite_whitelist: return True |