diff options
| author | 2020-05-10 12:58:38 -0700 | |
|---|---|---|
| committer | 2020-05-10 12:58:38 -0700 | |
| commit | 55b8aed9dc8d4f38824c8b5642a74df6a9948799 (patch) | |
| tree | f111399b71619944507b88a983b13f92ff6e1787 | |
| parent | Merge pull request #923 from python-discord/feat/util/remove-mention-cmd (diff) | |
Filtering: don't attempt to send additional embeds for invalid invites
Invalid invites won't have data available to put in the embeds.
Fixes #929
Fixes BOT-3Z
| -rw-r--r-- | bot/cogs/filtering.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py index 6a703f5a1..0ad534741 100644 --- a/bot/cogs/filtering.py +++ b/bot/cogs/filtering.py @@ -212,7 +212,9 @@ class Filtering(Cog): additional_embeds = None additional_embeds_msg = None - if filter_name == "filter_invites": + # The function returns True for invalid invites. + # They have no data so additional embeds can't be created for them. + if filter_name == "filter_invites" and match is not True: additional_embeds = [] for invite, data in match.items(): embed = discord.Embed(description=( |