aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/snekbox.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py
index cb0454249..7ec503686 100644
--- a/bot/cogs/snekbox.py
+++ b/bot/cogs/snekbox.py
@@ -29,8 +29,9 @@ exec(open(venv_file).read(), dict(__file__=venv_file))
try:
{CODE}
-except Exception as e:
- print(e)
+except:
+ import traceback
+ print(traceback.format_exc(), end='')
"""
ESCAPE_REGEX = re.compile("[`\u202E\u200B]{3,}")
@@ -86,6 +87,11 @@ class Snekbox:
if not code: # None or empty string
return await ctx.invoke(self.bot.get_command("help"), "eval")
+ if all([line.startswith('#') for line in code.strip('\n')]): # Only comments
+ return await ctx.send(
+ f"{ctx.author.mention} Your eval job has completed.\n\n```py\n[No output]\n```"
+ )
+
log.info(f"Received code from {ctx.author.name}#{ctx.author.discriminator} for evaluation:\n{code}")
self.jobs[ctx.author.id] = datetime.datetime.now()