From f109e7145e33138dbd376c0f7abd510988dc74e1 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Fri, 27 Jul 2018 13:53:47 +0100 Subject: [Snekbox] Deal with leading newlines --- bot/cogs/snekbox.py | 3 +++ 1 file changed, 3 insertions(+) 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] -- cgit v1.2.3