Skip to content

Commit 9509ea2

Browse files
authored
Merge pull request #143 from python-discord/smarte-intelligence-update
Smart eval intelligence update
2 parents 4d0a486 + d8ee6fe commit 9509ea2

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

bot/exts/smart_eval/_smart_eval_rules.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,27 @@
6565
],
6666
r"\b(environ|getenv|token)\b": [ # Detect attempt to access bot token and env vars
6767
"Bot token and other secrets can be viewed here: <https://pydis.com/.env>",
68-
]
68+
],
69+
r"\bsleep\(\b": [ # Detect use of sleep
70+
"To optimise this code, I would suggest removing the `sleep` calls",
71+
"Pfft, using `sleep`? I'm always awake!",
72+
"Maybe if you didn't `sleep` so much, your code wouldn't be so buggy.",
73+
],
74+
r"\b/\s*0\b": [ # Detect division by zero
75+
"ZeroDivisionError! Maybe... I just saw /0",
76+
"Division by zero didn't appear in my training set so must be impossible"
77+
],
78+
r"@": [ # Detect @
79+
"You're either using decorators, multiplying matrices, or trying to escape my sandbox...",
80+
],
81+
r"(?m:^\s*raise\s*)": [ # Detect raise
82+
"Wondering why you're getting errors? You're literally using `raise`, just get rid of that!",
83+
],
84+
r"(?m:^\s*(?:import|from)\s+threading)": [ # Detect threading import
85+
"Uh-oh, your threads have jumbled up my brain!",
86+
"have jumbled up my Uh-oh, threads brain! your",
87+
"my up jumbled your brain! have Uh-oh, threads",
88+
],
6989
}
7090

7191
DEFAULT_RESPONSES = [

0 commit comments

Comments
 (0)