Browse Source

Fix bug where @everyone usernames bypass Message.clean_content.

pull/118/merge
Rapptz 9 years ago
parent
commit
c2ffff1549
  1. 4
      discord/message.py

4
discord/message.py

@ -173,13 +173,13 @@ class Message:
}
transformations.update(mention_transforms)
transformations[re.escape('@everyone')] = '@\u200beveryone'
def repl(obj):
return transformations.get(re.escape(obj.group(0)), '')
pattern = re.compile('|'.join(transformations.keys()))
return pattern.sub(repl, self.content)
result = pattern.sub(repl, self.content)
return result.replace('@everyone', '@\u200beveryone')
def _handle_upgrades(self, channel_id):
self.server = None

Loading…
Cancel
Save