mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-12-25 19:16:01 +00:00
Fix TypeError in Pydantic V2 dumps_kwargs
This commit is contained in:
parent
4c4d69a492
commit
641e58c98b
@ -36,7 +36,7 @@ class PayLog:
|
||||
@staticmethod
|
||||
async def save_json(path, data: PayLogModel):
|
||||
async with aiofiles.open(path, "w", encoding="utf-8") as f:
|
||||
return await f.write(data.json(ensure_ascii=False, indent=4, by_alias=True))
|
||||
return await f.write(data.model_dump_json(indent=4, by_alias=True))
|
||||
|
||||
def get_file_path(
|
||||
self,
|
||||
|
@ -570,7 +570,7 @@ class DailyMaterial(Plugin):
|
||||
continue
|
||||
self.everyday_materials = _parse_honey_impact_source(response.content)
|
||||
# 当场缓存到文件
|
||||
content = self.everyday_materials.json(ensure_ascii=False, separators=(",", ":"))
|
||||
content = self.everyday_materials.model_dump_json()
|
||||
async with aiofiles.open(DATA_FILE_PATH, "w", encoding="utf-8") as file:
|
||||
await file.write(content)
|
||||
logger.success("每日素材刷新成功")
|
||||
|
Loading…
Reference in New Issue
Block a user