fix(backup): fixed extract_json_from_codeblock
Some checks failed
Actions / Lint Code (Pylint) (pull_request) Failing after 15s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 11s

This commit is contained in:
Seaswimmer 2024-01-31 13:07:48 -05:00
parent 2dd8663e78
commit 5eb762d9fe
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -74,7 +74,7 @@ class Backup(commands.Cog):
await ctx.send(error(f"You do not have the `Downloader` cog loaded. Please run `{ctx.prefix}load downloader` and try again.")) await ctx.send(error(f"You do not have the `Downloader` cog loaded. Please run `{ctx.prefix}load downloader` and try again."))
return return
def extract_json_from_codeblock(text): 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: if match:
return match.group(1).strip() return match.group(1).strip()