From 37bdb2409ccfd8f20af9adc66f3eb286e79572e8 Mon Sep 17 00:00:00 2001 From: git-bruh Date: Sun, 24 Jan 2021 11:57:23 +0530 Subject: [PATCH] escape '<' and '>' --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index c6a6f5b..21adf31 100644 --- a/main.py +++ b/main.py @@ -337,6 +337,10 @@ class DiscordClient(discord.ext.commands.Bot): # Replace emote IDs with names. content = re.sub(regex, r":\g<1>:", content) + # Escape stuff + for replace in ("<", ">"): + content = content.replace(replace, f"\{replace}") + # Append attachments to message. for attachment in message.attachments: content += f"\n{attachment.url}"