Skip to content

Commit e64615f

Browse files
committed
Add exec/eval rule
1 parent c8c9909 commit e64615f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bot/exts/smart_eval/_smart_eval_rules.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@
4747
r"(?m:^\s*import\s+this\s*$)": [ # Detect use of "import this"
4848
f"```\n{ZEN_OF_PYTHON}```",
4949
],
50+
r"\b(?P<content>exec|eval)\b": [ # Detect use of exec and eval
51+
(
52+
"Sorry, but running the code inside your `{}` call would require another me,"
53+
" and I don't think I can handle that."
54+
),
55+
"I spy with my little eye... something sketchy like `{}`.",
56+
""
57+
],
5058
}
5159

5260
DEFAULT_RESPONSES = [

0 commit comments

Comments
 (0)