fix(backup): added a kwarg to backup_import
This commit is contained in:
parent
52f8439383
commit
702de21448
1 changed files with 3 additions and 4 deletions
|
@ -58,11 +58,10 @@ 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, export: 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 export is None:
|
if export is None and not len(ctx.message.attachments) == 0:
|
||||||
if not len(ctx.message.attachments) == 0:
|
export = await ctx.message.attachments[0].read()
|
||||||
export = await ctx.message.attachments[0].read()
|
|
||||||
try:
|
try:
|
||||||
export = json.loads(export)
|
export = json.loads(export)
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
|
|
Loading…
Reference in a new issue