aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar sco1 <[email protected]>2019-01-18 17:48:57 -0500
committerGravatar sco1 <[email protected]>2019-01-18 17:48:57 -0500
commitba490f98204bd105dc3017d3e2971152eaa49456 (patch)
tree6cea70d495a26bb94587a4ca21e33278122989e7
parentAdd consecutive newline detection to antispam (diff)
Fix variable typo, add missing loop over relevant_messages
-rw-r--r--bot/rules/newlines.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/rules/newlines.py b/bot/rules/newlines.py
index e7c665750..fdad6ffd3 100644
--- a/bot/rules/newlines.py
+++ b/bot/rules/newlines.py
@@ -20,7 +20,9 @@ async def apply(
# Identify groups of newline characters and get group & total counts
exp = r"(\n+)"
- newline_counts = [len(group) for group in re.findall(exp, instr)]
+ newline_counts = []
+ for msg in relevant_messages:
+ newline_counts += [len(group) for group in re.findall(exp, msg.content)]
total_recent_newlines = sum(newline_counts)
# Get maximum newline group size