fix(backup): properly support codeblocks (maybe?)
Some checks failed
Actions / Lint Code (Pylint) (pull_request) Failing after 16s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 11s

This commit is contained in:
Seaswimmer 2024-01-31 13:10:31 -05:00
parent 5eb762d9fe
commit 168f62d43f
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -75,7 +75,7 @@ class Backup(commands.Cog):
return
def extract_json_from_codeblock(self, text):
match = re.match(r"```(?:\w+)?\n(.*?)\n```", text, re.DOTALL)
match = re.match(r"```(?:\w+)?\n(.*?)(?<!\[)\n```", text, re.DOTALL)
if match:
return match.group(1).strip()
else: