diff options
author | 2018-03-02 17:06:49 +0000 | |
---|---|---|
committer | 2018-03-02 17:06:49 +0000 | |
commit | 632e7edb013c1359668860d0dafe891ab2b8e9f6 (patch) | |
tree | ca11c878c10d0b2c08b7514603415992b758ad4d | |
parent | Cog management #1404e (#19) (diff) |
Stop single tick multi line formatting
-rw-r--r-- | bot/cogs/bot.py | 4 |
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. |