[commands] Ensure no mentions escape clean_content
Some clever nicknames or role names would lead themselves to resolving to pings.
This commit is contained in:
parent
cb709cc9da
commit
eb673ec2af
@ -436,13 +436,5 @@ class clean_content(Converter):
|
|||||||
pattern = re.compile('|'.join(transformations.keys()))
|
pattern = re.compile('|'.join(transformations.keys()))
|
||||||
result = pattern.sub(replace, result)
|
result = pattern.sub(replace, result)
|
||||||
|
|
||||||
transformations = {
|
# Completely ensure no mentions escape:
|
||||||
'@everyone': '@\u200beveryone',
|
return re.sub(r'@(everyone|here|[!&]?[0-9]{17,21})', '@\u200b\\1', result)
|
||||||
'@here': '@\u200bhere'
|
|
||||||
}
|
|
||||||
|
|
||||||
def repl2(obj):
|
|
||||||
return transformations.get(obj.group(0), '')
|
|
||||||
|
|
||||||
pattern = re.compile('|'.join(transformations.keys()))
|
|
||||||
return pattern.sub(repl2, result)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user