From 7b64f6938b52ca99c41f0664429d793d7c970672 Mon Sep 17 00:00:00 2001 From: profitroll Date: Thu, 26 Dec 2024 20:28:44 +0100 Subject: [PATCH] Added a nice comment explaining the sync call inside async function --- cogs/data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogs/data.py b/cogs/data.py index f2c8d84..d1fe76f 100644 --- a/cogs/data.py +++ b/cogs/data.py @@ -92,6 +92,8 @@ class Data(commands.Cog): } ) + # Temporary file must be written synchronously, + # otherwise it will not be there when ctx.respond() is be called json_write(users, Path(f"tmp/{uuid}")) await ctx.respond(file=File(Path(f"tmp/{uuid}"), filename="users.json"))