Backup #16

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

View file

@ -58,11 +58,10 @@ class Backup(commands.Cog):
@backup.command(name='import')
@commands.is_owner()
async def backup_import(self, ctx: commands.Context, export: str = None):
async def backup_import(self, ctx: commands.Context, *, export: str = None):
"""Import your installed repositories and cogs from an export."""
if export is None:
if not len(ctx.message.attachments) == 0:
export = await ctx.message.attachments[0].read()
if export is None and not len(ctx.message.attachments) == 0:
export = await ctx.message.attachments[0].read()
try:
export = json.loads(export)
except json.JSONDecodeError: