From bb331232cac4790cdbb49e15d2e05f1a247bd050 Mon Sep 17 00:00:00 2001 From: snowy Date: Mon, 20 May 2024 23:31:11 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=A4=96?= =?UTF-8?q?=E9=83=A8=E8=B5=84=E6=BA=90=E7=83=AD=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/utils/message/html_tool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/liteyuki/utils/message/html_tool.py b/liteyuki/utils/message/html_tool.py index 1674804b..488af0ab 100644 --- a/liteyuki/utils/message/html_tool.py +++ b/liteyuki/utils/message/html_tool.py @@ -73,9 +73,10 @@ async def template2image( template_path=template_path, **templates, ) - async with aiofiles.open(os.path.join(template_path, f"debug-{random_hex_string(6)}.html"), "w", encoding="utf-8") as f: + random_file_name = f"debug-{random_hex_string(6)}.html" + async with aiofiles.open(os.path.join(template_path, random_file_name), "w", encoding="utf-8") as f: await f.write(raw_html) - nonebot.logger.info("Debug HTML: %s" % f"debug-{random_hex_string(6)}.html") + nonebot.logger.info("Debug HTML: %s" % f"{random_file_name}") return await template_to_pic( template_name=template_name,