Backup #16

Merged
cswimr merged 41 commits from backup into main 2024-01-31 15:58:08 -05:00
Showing only changes of commit d0375c3bdb - Show all commits

View file

@ -58,14 +58,16 @@ class Backup(commands.Cog):
@backup.command(name='import') @backup.command(name='import')
@commands.is_owner() @commands.is_owner()
async def backup_import(self, ctx: commands.Context, json: str = None): async def backup_import(self, ctx: commands.Context, export: str = None):
"""Import your installed repositories and cogs from an export.""" """Import your installed repositories and cogs from an export."""
if json is None: if export is None:
if not len(ctx.message.attachments) == 0: if not len(ctx.message.attachments) == 0:
json = await ctx.message.attachments[0].read() export = await ctx.message.attachments[0].read()
else: try:
await ctx.send(error("Please provide a valid JSON export.")) export = json.loads(json)
return except json.JSONDecodeError:
await ctx.send(error("Please provide a valid JSON export."))
return
downloader = ctx.bot.get_cog("Downloader") downloader = ctx.bot.get_cog("Downloader")
if downloader is None: if downloader is None: