mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
new mention behavior, new filter behavior (#3553)
* new mention behavior, new filter behavior * and here too, ffs * docs and reformat * review handling
This commit is contained in:
@@ -75,7 +75,10 @@ class Context(DPYContext):
|
||||
:func:`~redbot.core.utils.common_filters.filter_mass_mentions`.
|
||||
This must take a single `str` as an argument, and return
|
||||
the sanitized `str`.
|
||||
\*\*kwargs
|
||||
sanitize_roles : bool
|
||||
Whether or not role mentions should be sanitized for you.
|
||||
Defaults to ``True``
|
||||
**kwargs
|
||||
See `discord.ext.commands.Context.send`.
|
||||
|
||||
Returns
|
||||
@@ -86,6 +89,10 @@ class Context(DPYContext):
|
||||
"""
|
||||
|
||||
_filter = kwargs.pop("filter", common_filters.filter_mass_mentions)
|
||||
sanitize_roles = kwargs.pop("sanitize_roles", True)
|
||||
|
||||
if sanitize_roles and content and self.guild:
|
||||
content = common_filters.sanitize_role_mentions(str(content), self.guild.roles)
|
||||
|
||||
if _filter and content:
|
||||
content = _filter(str(content))
|
||||
|
||||
Reference in New Issue
Block a user