aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/utils/snekbox.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/bot/exts/utils/snekbox.py b/bot/exts/utils/snekbox.py
index 8a2e68b28..ddcbe01fa 100644
--- a/bot/exts/utils/snekbox.py
+++ b/bot/exts/utils/snekbox.py
@@ -344,8 +344,15 @@ class Snekbox(Cog):
log.trace("Formatting output...")
output, paste_link = await self.format_output(results["stdout"])
+ warning_message = ""
+
+ # This is done to make sure the last line of output contains the error
+ # and the error is not manually printed by the author with a syntax error.
+ if results["stdout"].rstrip().endswith("EOFError: EOF when reading a line") and results["returncode"] == 1:
+ warning_message += ":warning: Note: `input` is not supported by the bot :warning:\n\n"
+
icon = self.get_status_emoji(results)
- msg = f"{ctx.author.mention} {icon} {msg}.\n\n```\n{output}\n```"
+ msg = f"{ctx.author.mention} {icon} {msg}.\n\n{warning_message}```\n{output}\n```"
if paste_link:
msg = f"{msg}\nFull output: {paste_link}"