aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ionite <[email protected]>2022-11-16 21:49:47 -0500
committerGravatar Ionite <[email protected]>2022-11-16 21:49:47 -0500
commit76089746bc0b718fc44e63f09935d62648ceaa94 (patch)
treef3dde7b3e606cf216ae6d2c6f0c6bda74743c774
parentLower MAX_FILE_SIZE to match discord upload limit (diff)
Add example for post response
-rw-r--r--snekbox/api/resources/eval.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/snekbox/api/resources/eval.py b/snekbox/api/resources/eval.py
index 7e57e5b..b0678ac 100644
--- a/snekbox/api/resources/eval.py
+++ b/snekbox/api/resources/eval.py
@@ -38,8 +38,6 @@ class EvalResource:
Evaluate Python code and return stdout, stderr, and the return code.
A list of arguments for the Python subprocess can be specified as `args`.
- Otherwise, the default argument "-c" is used to execute the input code.
- The input code is always passed as the last argument to Python.
The return codes mostly resemble those of a Unix shell. Some noteworthy cases:
@@ -61,7 +59,14 @@ class EvalResource:
>>> {
... "stdout": "10000 loops, best of 5: 23.8 usec per loop\n",
- ... "returncode": 0
+ ... "returncode": 0,
+ ... "attachments": [
+ ... {
+ ... "name": "output.png",
+ ... "mime": "image/png",
+ ... "content" "...=", # Base64 encoded zlib compressed content
+ ... }
+ ... ]
... }
Status codes: