aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/filters/filter_lists.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/bot/exts/filters/filter_lists.py b/bot/exts/filters/filter_lists.py
index fc9cfbeca..cc3a61212 100644
--- a/bot/exts/filters/filter_lists.py
+++ b/bot/exts/filters/filter_lists.py
@@ -55,17 +55,20 @@ class FilterLists(Cog):
"""Add an item to a filterlist."""
allow_type = "whitelist" if allowed else "blacklist"
- # If this is a server invite, we gotta validate it.
+ # If this is a guild invite, we gotta validate it.
if list_type == "GUILD_INVITE":
guild_data = await self._validate_guild_invite(ctx, content)
content = guild_data.get("id")
- # Unless the user has specified another comment, let's
- # use the server name as the comment so that the list
- # of guild IDs will be more easily readable when we
- # display it.
- if not comment:
- comment = guild_data.get("name")
+ # Some guild invites are autoban filters, which require the mod
+ # to set a comment which includes [autoban].
+ # Having the guild name in the comment is still useful when reviewing
+ # filter list, so prepend it to the set comment in case some mod forgets.
+ comment = " - ".join(
+ comment_part
+ for comment_part in (guild_data.get("name", ""), comment)
+ if comment_part
+ )
# If it's a file format, let's make sure it has a leading dot.
elif list_type == "FILE_FORMAT" and not content.startswith("."):