diff --git a/discord/utils.py b/discord/utils.py index 5e40069224..b509162cf0 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -933,7 +933,7 @@ def replacement(match): 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) def escape_markdown( @@ -975,7 +975,7 @@ def replacement(match): regex = _MARKDOWN_STOCK_REGEX if ignore_links: regex = f"(?:{_URL_REGEX}|{regex})" - return re.sub(regex, replacement, text, 0, re.MULTILINE | re.X) + return re.sub(regex, replacement, text, count=0, flags=re.MULTILINE | re.X) else: text = re.sub(r"\\", r"\\\\", text) return _MARKDOWN_ESCAPE_REGEX.sub(r"\\\1", text)