This commit is contained in:
qsc
2026-08-04 00:17:25 +08:00
parent 4b6c86a32b
commit a4a01dc16d
138 changed files with 6328 additions and 8130 deletions
+2 -15
View File
@@ -1,25 +1,12 @@
from pathlib import Path
from datetime import datetime,date
from zoneinfo import ZoneInfo
import aiofiles
import base64
import os
from astrbot import logger
async def load_template(template_name: str) -> str:
"""
异步加载模板内容(非阻塞)
"""
plugin_dir = Path(__file__).parent.parent
template_path = plugin_dir / "templates" / template_name
if not template_path.exists():
raise FileNotFoundError(f"模板文件不存在: {template_path}")
async with aiofiles.open(template_path, "r", encoding="utf-8") as f:
return await f.read()
from .template import load_template
def gold_to_string(gold_amount):
@@ -161,4 +148,4 @@ def format_remaining(ts):
minutes, seconds = divmod(seconds, 60)
return f"{hours}{minutes:02d}{seconds:02d}"
except (TypeError, ValueError):
return ""
return ""