Browse Source

Remove unnecessary pass using regex in Message.clean_content

The utils.escape_mentions should deal with it
pull/2490/head
Rapptz 5 years ago
parent
commit
fdab6e464f
  1. 13
      discord/message.py

13
discord/message.py

@ -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…
Cancel
Save