mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-02-12 15:39:58 +08:00
优化内存模块导入,确保正确获取数据文件
This commit is contained in:
parent
e4d9fef670
commit
9ba4f0cfa1
@ -1,10 +1,12 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from nonebot import require
|
from nonebot import require
|
||||||
|
|
||||||
require("nonebot_plugin_localstore")
|
require("nonebot_plugin_localstore")
|
||||||
from nonebot_plugin_localstore import get_data_file
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from nonebot_plugin_localstore import get_data_file
|
||||||
|
|
||||||
memory_path = get_data_file("marshoai", "memory.json")
|
memory_path = get_data_file("marshoai", "memory.json")
|
||||||
if not Path(memory_path).exists():
|
if not Path(memory_path).exists():
|
||||||
with open(memory_path, "w", encoding="utf-8") as f:
|
with open(memory_path, "w", encoding="utf-8") as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user