feat(backup): allow for retrieving backup exports from bot messages if you reply to them

This commit is contained in:
Seaswimmer 2024-03-07 13:47:40 -05:00
parent 178a92559c
commit fdb785ffd7
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -97,8 +97,11 @@ class Backup(commands.Cog):
try:
export = json.loads(await ctx.message.attachments[0].read())
except (json.JSONDecodeError, IndexError):
await ctx.send(error("Please provide a valid JSON export file."))
return
try:
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")
if downloader is None: