aboutsummaryrefslogtreecommitdiff
path: root/discord/ext
diff options
context:
space:
mode:
Diffstat (limited to 'discord/ext')
-rw-r--r--discord/ext/commands/converter.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py
index 850ca728..2da0e110 100644
--- a/discord/ext/commands/converter.py
+++ b/discord/ext/commands/converter.py
@@ -676,11 +676,16 @@ class clean_content(Converter):
Whether to use nicknames when transforming mentions.
escape_markdown: :class:`bool`
Whether to also escape special markdown characters.
+ remove_markdown: :class:`bool`
+ Whether to also remove special markdown characters. This option is not supported with ``escape_markdown``
+
+ .. versionadded:: 1.7
"""
- def __init__(self, *, fix_channel_mentions=False, use_nicknames=True, escape_markdown=False):
+ def __init__(self, *, fix_channel_mentions=False, use_nicknames=True, escape_markdown=False, remove_markdown=False):
self.fix_channel_mentions = fix_channel_mentions
self.use_nicknames = use_nicknames
self.escape_markdown = escape_markdown
+ self.remove_markdown = remove_markdown
async def convert(self, ctx, argument):
message = ctx.message
@@ -731,6 +736,8 @@ class clean_content(Converter):
if self.escape_markdown:
result = discord.utils.escape_markdown(result)
+ elif self.remove_markdown:
+ result = discord.utils.remove_markdown(result)
# Completely ensure no mentions escape:
return discord.utils.escape_mentions(result)