diff --git a/discord/utils.py b/discord/utils.py index cb826d6d2..c4793b761 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -1008,7 +1008,7 @@ def escape_markdown(text: str, *, as_needed: bool = False, ignore_links: bool = regex = _MARKDOWN_STOCK_REGEX if ignore_links: regex = f'(?:{_URL_REGEX}|{regex})' - return re.sub(regex, replacement, text, 0, re.MULTILINE) + return re.sub(regex, replacement, text, count=0, flags=re.MULTILINE) else: text = re.sub(r'\\', r'\\\\', text) return _MARKDOWN_ESCAPE_REGEX.sub(r'\\\1', text)