From 260bbb9dcb5497832a3e7223c7fd5b8757d6f5b8 Mon Sep 17 00:00:00 2001 From: nex Date: Thu, 16 Mar 2023 23:13:08 +0000 Subject: [PATCH] add more delay --- cogs/other.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/other.py b/cogs/other.py index 3eebace..6518292 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -837,8 +837,8 @@ class OtherCog(commands.Cog): _io = BytesIO() engine.save_to_file(text, target_fn) engine.runAndWait() - while not os.path.exists(target_fn): - sleep(0.5) + while not os.path.exists(target_fn) or os.stat(target_fn).st_size == 0: + sleep(2) with open(target_fn, "rb") as f: _io.write(f.read()) os.remove(target_fn)