mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Remove unnecessary pass using regex in Message.clean_content
The utils.escape_mentions should deal with it
This commit is contained in:
parent
6794bdaac5
commit
fdab6e464f
@ -549,18 +549,7 @@ class Message:
|
||||
|
||||
pattern = re.compile('|'.join(transformations.keys()))
|
||||
result = pattern.sub(repl, self.content)
|
||||
|
||||
transformations = {
|
||||
'@everyone': '@\u200beveryone',
|
||||
'@here': '@\u200bhere'
|
||||
}
|
||||
|
||||
def repl2(obj):
|
||||
return transformations.get(obj.group(0), '')
|
||||
|
||||
pattern = re.compile('|'.join(transformations.keys()))
|
||||
replaced = pattern.sub(repl2, result)
|
||||
return escape_mentions(replaced)
|
||||
return escape_mentions(result)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user