1
0
forked from bot/app

添加了外部资源热重载

This commit is contained in:
远野千束 2024-05-20 23:31:11 +08:00
parent ab9d3d3d3e
commit bb331232ca

View File

@ -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,