mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-12-26 19:35:37 +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
|
@staticmethod
|
||||||
async def save_json(path, data: PayLogModel):
|
async def save_json(path, data: PayLogModel):
|
||||||
async with aiofiles.open(path, "w", encoding="utf-8") as f:
|
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(
|
def get_file_path(
|
||||||
self,
|
self,
|
||||||
|
@ -570,7 +570,7 @@ class DailyMaterial(Plugin):
|
|||||||
continue
|
continue
|
||||||
self.everyday_materials = _parse_honey_impact_source(response.content)
|
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:
|
async with aiofiles.open(DATA_FILE_PATH, "w", encoding="utf-8") as file:
|
||||||
await file.write(content)
|
await file.write(content)
|
||||||
logger.success("每日素材刷新成功")
|
logger.success("每日素材刷新成功")
|
||||||
|
Loading…
Reference in New Issue
Block a user