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 d7dd46b47..4edba3539 100644
--- a/bot/cogs/snekbox.py
+++ b/bot/cogs/snekbox.py
@@ -55,8 +55,14 @@ class Snekbox:
)
async def callback(message: Message):
- embed = Embed(description=f"```{message.body.decode}```", title="Code evaluation")
- embed.colour = Colour.blurple()
+ output = message.body.decode()
+ colour = Colour.red()
+
+ if "```" in output:
+ output = "Code block escape attempt detected; will not output result"
+ colour = Colour.red()
+
+ embed = Embed(description=f"```{output}```", title="Code evaluation", colour=colour)
await ctx.send(
f"{ctx.author.mention} Your eval job has completed.",