mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-25 02:23:04 +00:00
Use discord.utils.escape_mentions as last step of
discord.Message.clean_content
This commit is contained in:
@@ -39,6 +39,8 @@ from .errors import InvalidArgument, ClientException, HTTPException
|
|||||||
from .embeds import Embed
|
from .embeds import Embed
|
||||||
from .member import Member
|
from .member import Member
|
||||||
from .flags import MessageFlags
|
from .flags import MessageFlags
|
||||||
|
from .utils import escape_mentions
|
||||||
|
|
||||||
|
|
||||||
class Attachment:
|
class Attachment:
|
||||||
"""Represents an attachment from Discord.
|
"""Represents an attachment from Discord.
|
||||||
@@ -557,7 +559,8 @@ class Message:
|
|||||||
return transformations.get(obj.group(0), '')
|
return transformations.get(obj.group(0), '')
|
||||||
|
|
||||||
pattern = re.compile('|'.join(transformations.keys()))
|
pattern = re.compile('|'.join(transformations.keys()))
|
||||||
return pattern.sub(repl2, result)
|
replaced = pattern.sub(repl2, result)
|
||||||
|
return escape_mentions(replaced)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def created_at(self):
|
def created_at(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user