aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/snekbox.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py
index b3c829d59..6f618a2c7 100644
--- a/bot/cogs/snekbox.py
+++ b/bot/cogs/snekbox.py
@@ -67,16 +67,21 @@ class Snekbox:
@command(name='eval', aliases=('e',))
@guild_only()
@check(channel_is_whitelisted_or_author_can_bypass)
- async def eval_command(self, ctx: Context, *, code: str):
+ async def eval_command(self, ctx: Context, *, code: str = None):
"""
Run some code. get the result back. We've done our best to make this safe, but do let us know if you
manage to find an issue with it!
+
+ This command supports multiple lines of code, including code wrapped inside a formatted code block.
"""
if ctx.author.id in self.jobs:
await ctx.send(f"{ctx.author.mention} You've already got a job running - please wait for it to finish!")
return
+ if not code: # None or empty string
+ return await ctx.invoke(self.bot.get_command("help"), "eval")
+
log.info(f"Received code from {ctx.author.name}#{ctx.author.discriminator} for evaluation:\n{code}")
self.jobs[ctx.author.id] = datetime.datetime.now()