aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar sco1 <[email protected]>2019-01-05 14:39:19 -0500
committerGravatar sco1 <[email protected]>2019-01-05 14:39:19 -0500
commit069b7373b3b9283a4d7c59a82980e98578cb6120 (patch)
treec81b7b679c88e36e4569f4428c535facfcc168d4
parentMerge branch 'master' into invite-filter-dm (diff)
Add notification strings for remaining filters
Hardcode watch words filter notification to False since it's a watchlist. This logic should be reworked eventually so we ignore user notifications for watchlist type filters.
-rw-r--r--bot/cogs/filtering.py15
-rw-r--r--bot/constants.py2
-rw-r--r--config-default.yml2
3 files changed, 12 insertions, 7 deletions
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py
index 27ec6aad9..701798d18 100644
--- a/bot/cogs/filtering.py
+++ b/bot/cogs/filtering.py
@@ -39,13 +39,17 @@ class Filtering:
def __init__(self, bot: Bot):
self.bot = bot
+ _staff_mistake_str = "If you believe this was a mistake, please let staff know!"
self.filters = {
"filter_zalgo": {
"enabled": Filter.filter_zalgo,
"function": self._has_zalgo,
"type": "filter",
"user_notification": Filter.notify_user_zalgo,
- "notification_msg": ""
+ "notification_msg": (
+ "Your post has been removed for abusing Unicode character rendering (aka Zalgo text). "
+ f"{_staff_mistake_str}"
+ )
},
"filter_invites": {
"enabled": Filter.filter_invites,
@@ -53,8 +57,7 @@ class Filtering:
"type": "filter",
"user_notification": Filter.notify_user_invites,
"notification_msg": (
- "Per Rule 10, your invite link has been removed. "
- "If you believe this was a mistake, please the staff know!\n\n"
+ f"Per Rule 10, your invite link has been removed. {_staff_mistake_str}\n\n"
r"Our server rules can be found here: <https://pythondiscord.com/about/rules>"
)
},
@@ -63,13 +66,15 @@ class Filtering:
"function": self._has_urls,
"type": "filter",
"user_notification": Filter.notify_user_domains,
- "notification_msg": ""
+ "notification_msg": (
+ f"Your URL has been removed because it matched a blacklisted domain. {_staff_mistake_str}"
+ )
},
"watch_words": {
"enabled": Filter.watch_words,
"function": self._has_watchlist_words,
"type": "watchlist",
- "user_notification": Filter.notify_user_words,
+ "user_notification": False, # Hardcode intentional for watchlist filter type
"notification_msg": ""
},
"watch_tokens": {
diff --git a/bot/constants.py b/bot/constants.py
index f67b7f45f..7014a73b3 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -207,7 +207,7 @@ class Filter(metaclass=YAMLGetter):
notify_user_zalgo: bool
notify_user_invites: bool
notify_user_domains: bool
- notify_user_words: bool
+ # Words watch intentionally ignored since it's a watchlist
# Token notification intentionally ignored, notification is handled by the token remover cog
ping_everyone: bool
diff --git a/config-default.yml b/config-default.yml
index 5ea9fc602..f8d8f0c26 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -144,7 +144,7 @@ filter:
notify_user_zalgo: false
notify_user_invites: true
notify_user_domains: false
- notify_user_words: false
+ # Words watch intentionally ignored since it's a watchlist
# Token notification intentionally ignored, notification is handled by the token remover cog
# Filter configuration