aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/bot.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py
index 4c10faa0c..56e36e86a 100644
--- a/bot/cogs/bot.py
+++ b/bot/cogs/bot.py
@@ -78,6 +78,10 @@ class Bot:
if time.time()-self.previous_format_times[msg.channel.id] > 300 or msg.channel.id == DEVTEST_CHANNEL:
if msg.content.count("\n") >= 3:
try:
+ # Some users formatted multi-line code using `'s
+ # This fixes that by treating them as nothing.
+ if "`" in msg.content:
+ msg.content = msg.content.replace("`", "").replace("`", "")
tree = ast.parse(msg.content)
# Attempts to parse the message into an AST node.