forked from cswimr/SeaCogs
feat(backup): allow for retrieving backup exports from bot messages if you reply to them
This commit is contained in:
parent
178a92559c
commit
fdb785ffd7
1 changed files with 5 additions and 2 deletions
|
@ -97,8 +97,11 @@ class Backup(commands.Cog):
|
||||||
try:
|
try:
|
||||||
export = json.loads(await ctx.message.attachments[0].read())
|
export = json.loads(await ctx.message.attachments[0].read())
|
||||||
except (json.JSONDecodeError, IndexError):
|
except (json.JSONDecodeError, IndexError):
|
||||||
await ctx.send(error("Please provide a valid JSON export file."))
|
try:
|
||||||
return
|
export = json.loads(await ctx.message.reference.resolved.attachments[0].read())
|
||||||
|
except (json.JSONDecodeError, IndexError):
|
||||||
|
await ctx.send(error("Please provide a valid JSON export file."))
|
||||||
|
return
|
||||||
|
|
||||||
downloader = ctx.bot.get_cog("Downloader")
|
downloader = ctx.bot.get_cog("Downloader")
|
||||||
if downloader is None:
|
if downloader is None:
|
||||||
|
|
Loading…
Reference in a new issue