aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-07-02 20:15:54 +0100
committerGravatar Gareth Coles <[email protected]>2018-07-02 20:15:54 +0100
commit402834750052bf644670d2bb9a391ae730d7cad7 (patch)
treea94e93b492efee0abc8eb6865a0ae03098a059b0
parent[Snekbox] Might as well highlight the output (diff)
[Snekbox] Fix failure to send string errors
-rw-r--r--bot/cogs/snekbox.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py
index 4335e03c4..9e90461cb 100644
--- a/bot/cogs/snekbox.py
+++ b/bot/cogs/snekbox.py
@@ -64,7 +64,11 @@ class Snekbox:
async with ctx.typing():
message = await self.rmq.consume(str(ctx.author.id), **RMQ_ARGS)
- output = message.body.decode().strip(" \n") # Remove spaces and newlines from the ends
+
+ if isinstance(message, str):
+ output = str.strip(" \n")
+ else:
+ output = message.body.decode().strip(" \n")
if "```" in output:
output = "Code block escape attempt detected; will not output result"