mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Fix bug where @everyone usernames bypass Message.clean_content.
This commit is contained in:
parent
c0dba0f4f2
commit
c2ffff1549
@ -173,13 +173,13 @@ class Message:
|
|||||||
}
|
}
|
||||||
|
|
||||||
transformations.update(mention_transforms)
|
transformations.update(mention_transforms)
|
||||||
transformations[re.escape('@everyone')] = '@\u200beveryone'
|
|
||||||
|
|
||||||
def repl(obj):
|
def repl(obj):
|
||||||
return transformations.get(re.escape(obj.group(0)), '')
|
return transformations.get(re.escape(obj.group(0)), '')
|
||||||
|
|
||||||
pattern = re.compile('|'.join(transformations.keys()))
|
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):
|
def _handle_upgrades(self, channel_id):
|
||||||
self.server = None
|
self.server = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user