diff options
| author | 2020-05-31 12:26:32 +0300 | |
|---|---|---|
| committer | 2020-05-31 12:26:32 +0300 | |
| commit | 90e5b856305c1ca37cdc8e59a256dbc24dfaf5fd (patch) | |
| tree | 237167b3eaa4a52a6bd2c0bd83c798639458ff64 | |
| parent | Filtering: Rename `bad_words_in_name` to `check_is_bad_words_in_name` (diff) | |
Filtering: Add days between alerts as constant
| -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 909c5b78f..dbe7c6bc7 100644 --- a/bot/cogs/filtering.py +++ b/bot/cogs/filtering.py @@ -43,6 +43,8 @@ TOKEN_WATCHLIST_PATTERNS = [ ] WATCHLIST_PATTERNS = WORD_WATCHLIST_PATTERNS + TOKEN_WATCHLIST_PATTERNS +DAYS_BETWEEN_ALERTS = 3 + def expand_spoilers(text: str) -> str: """Return a string containing all interpretations of a spoilered message.""" @@ -152,7 +154,7 @@ class Filtering(Cog): last_alert = await self.name_alerts.get(msg.author.id) if last_alert: last_alert = datetime.fromtimestamp(last_alert) - if datetime.now() - timedelta(days=3) < last_alert: + if datetime.now() - timedelta(days=DAYS_BETWEEN_ALERTS) < last_alert: return log_string = ( |