From 6d3d3fc52ca1cb26fcf359759b8fdd591354db76 Mon Sep 17 00:00:00 2001 From: snowy Date: Tue, 14 May 2024 10:37:32 +0800 Subject: [PATCH] :sparkles: output to latest --- liteyuki/plugins/liteyuki_webdash/main.py | 7 +++++-- liteyuki/utils/message/html_tool.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/liteyuki/plugins/liteyuki_webdash/main.py b/liteyuki/plugins/liteyuki_webdash/main.py index 0864184f..40506b19 100644 --- a/liteyuki/plugins/liteyuki_webdash/main.py +++ b/liteyuki/plugins/liteyuki_webdash/main.py @@ -2,6 +2,9 @@ from fastapi import FastAPI from nonebot import get_app from .restful_api import * -@app.get("/") + +@app.get("/ping") async def root(): - return {"message": "Hello World"} + return { + "message": "pong" + } diff --git a/liteyuki/utils/message/html_tool.py b/liteyuki/utils/message/html_tool.py index 5a1fe689..1674804b 100644 --- a/liteyuki/utils/message/html_tool.py +++ b/liteyuki/utils/message/html_tool.py @@ -73,7 +73,7 @@ async def template2image( template_path=template_path, **templates, ) - async with aiofiles.open(os.path.join(template_path, "latest-debug.html"), "w", encoding="utf-8") as f: + async with aiofiles.open(os.path.join(template_path, f"debug-{random_hex_string(6)}.html"), "w", encoding="utf-8") as f: await f.write(raw_html) nonebot.logger.info("Debug HTML: %s" % f"debug-{random_hex_string(6)}.html")