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()))
|
pattern = re.compile('|'.join(transformations.keys()))
|
||||||
result = pattern.sub(repl, self.content)
|
result = pattern.sub(repl, self.content)
|
||||||
|
return escape_mentions(result)
|
||||||
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)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def created_at(self):
|
def created_at(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user