Compare commits

...

2 commits

Author SHA1 Message Date
3662ce3b23
fix(backup): export branch as well
Some checks failed
Actions / Lint Code (Pylint) (pull_request) Failing after 15s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 11s
2024-01-31 13:33:39 -05:00
7fdb106fad
misc(backup): condensed some code more 2024-01-31 13:22:56 -05:00

View file

@ -44,6 +44,7 @@ class Backup(commands.Cog):
repo_dict = { repo_dict = {
"name": repo.name, "name": repo.name,
"url": repo.url, "url": repo.url,
"branch": repo.branch,
"cogs": [] "cogs": []
} }
@ -62,8 +63,7 @@ class Backup(commands.Cog):
async def backup_import(self, ctx: commands.Context): async def backup_import(self, ctx: commands.Context):
"""Import your installed repositories and cogs from an export file.""" """Import your installed repositories and cogs from an export file."""
try: try:
export_raw = await ctx.message.attachments[0].read() export = json.loads(await ctx.message.attachments[0].read())
export = json.loads(export_raw)
except (json.JSONDecodeError, IndexError): except (json.JSONDecodeError, IndexError):
await ctx.send(error("Please provide a valid JSON export file.")) await ctx.send(error("Please provide a valid JSON export file."))
return return