escape '<' and '>'

This commit is contained in:
git-bruh 2021-01-24 11:57:23 +05:30
parent fa97d4fc97
commit 37bdb2409c
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -337,6 +337,10 @@ class DiscordClient(discord.ext.commands.Bot):
# Replace emote IDs with names. # Replace emote IDs with names.
content = re.sub(regex, r":\g<1>:", content) content = re.sub(regex, r":\g<1>:", content)
# Escape stuff
for replace in ("<", ">"):
content = content.replace(replace, f"\{replace}")
# Append attachments to message. # Append attachments to message.
for attachment in message.attachments: for attachment in message.attachments:
content += f"\n{attachment.url}" content += f"\n{attachment.url}"