forked from cswimr/SeaCogs
misc(backup): condensed some code more
This commit is contained in:
parent
ac761d9284
commit
7fdb106fad
1 changed files with 1 additions and 2 deletions
|
@ -62,8 +62,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
|
||||||
|
|
Loading…
Reference in a new issue