From fdb785ffd798d42b5b44cbb6d5f7d99905a6f215 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 7 Mar 2024 13:47:40 -0500 Subject: [PATCH] feat(backup): allow for retrieving backup exports from bot messages if you reply to them --- backup/backup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backup/backup.py b/backup/backup.py index e1f12b5..cde40fa 100644 --- a/backup/backup.py +++ b/backup/backup.py @@ -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: