aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-07-27 13:53:47 +0100
committerGravatar Gareth Coles <[email protected]>2018-07-27 13:53:47 +0100
commitf109e7145e33138dbd376c0f7abd510988dc74e1 (patch)
tree5bbeeb43b1930f4a2855499f59cb0b81ca1c5f4c
parentFix eval and add codeblock support (diff)
[Snekbox] Deal with leading newlines
-rw-r--r--bot/cogs/snekbox.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py
index 167e0aed6..17acf757b 100644
--- a/bot/cogs/snekbox.py
+++ b/bot/cogs/snekbox.py
@@ -79,6 +79,9 @@ class Snekbox:
log.info(f"Received code from {ctx.author.name}#{ctx.author.discriminator} for evaluation:\n{code}")
self.jobs[ctx.author.id] = datetime.datetime.now()
+ while code.startswith("\n"):
+ code = code[1:]
+
if code.startswith("```") and code.endswith("```"):
code = code[3:-3]