mirror of
https://github.com/FuQuan233/nonebot-plugin-llmchat.git
synced 2025-09-04 10:20:45 +00:00
🐛 fix #5
This commit is contained in:
parent
b4a9ce8a7f
commit
b4c3e71faf
1 changed files with 2 additions and 2 deletions
|
@ -384,7 +384,7 @@ async def save_state():
|
|||
}
|
||||
|
||||
os.makedirs(os.path.dirname(data_file), exist_ok=True)
|
||||
async with aiofiles.open(data_file, "w") as f:
|
||||
async with aiofiles.open(data_file, "w", encoding="utf8") as f:
|
||||
await f.write(json.dumps(data, ensure_ascii=False))
|
||||
|
||||
|
||||
|
@ -394,7 +394,7 @@ async def load_state():
|
|||
if not os.path.exists(data_file):
|
||||
return
|
||||
|
||||
async with aiofiles.open(data_file) as f:
|
||||
async with aiofiles.open(data_file, encoding="utf8") as f:
|
||||
data = json.loads(await f.read())
|
||||
for gid, state_data in data.items():
|
||||
state = GroupState()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue