优化内存模块导入,确保正确获取数据文件

This commit is contained in:
远野千束(神羽) 2024-12-24 00:40:05 +08:00
parent e4d9fef670
commit 9ba4f0cfa1

View File

@ -1,10 +1,12 @@
from pathlib import Path
from nonebot import require
require("nonebot_plugin_localstore")
from nonebot_plugin_localstore import get_data_file
import json
from nonebot_plugin_localstore import get_data_file
memory_path = get_data_file("marshoai", "memory.json")
if not Path(memory_path).exists():
with open(memory_path, "w", encoding="utf-8") as f: