Message.clean_content now handles everyone mentions properly.
This commit is contained in:
parent
94d31834fc
commit
085e8d4eb3
@ -158,6 +158,8 @@ class Message:
|
|||||||
manner. This basically means that mentions are transformed
|
manner. This basically means that mentions are transformed
|
||||||
into the way the client shows it. e.g. ``<#id>`` will transform
|
into the way the client shows it. e.g. ``<#id>`` will transform
|
||||||
into ``#name``.
|
into ``#name``.
|
||||||
|
|
||||||
|
This will also transform @everyone mentions into non-mentions.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
transformations = {
|
transformations = {
|
||||||
@ -171,6 +173,7 @@ 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)), '')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user