aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael H <[email protected]>2019-12-25 04:11:58 -0500
committerMichael H <[email protected]>2019-12-25 04:13:10 -0500
commit6794bdaac54f84788f51b7c19198dcfcad43ccc8 (patch)
tree4e89a22c0af028cf006a0be8b2c07b3263dd8c8e
parentTypo: AuditLogActionCategory (diff)
downloaddiscord.py-6794bdaac54f84788f51b7c19198dcfcad43ccc8.tar.xz
discord.py-6794bdaac54f84788f51b7c19198dcfcad43ccc8.zip
Use discord.utils.escape_mentions as last step of
discord.Message.clean_content
-rw-r--r--discord/message.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/message.py b/discord/message.py
index 01ef34db..db082a98 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -39,6 +39,8 @@ from .errors import InvalidArgument, ClientException, HTTPException
from .embeds import Embed
from .member import Member
from .flags import MessageFlags
+from .utils import escape_mentions
+
class Attachment:
"""Represents an attachment from Discord.
@@ -557,7 +559,8 @@ class Message:
return transformations.get(obj.group(0), '')
pattern = re.compile('|'.join(transformations.keys()))
- return pattern.sub(repl2, result)
+ replaced = pattern.sub(repl2, result)
+ return escape_mentions(replaced)
@property
def created_at(self):