mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
feat(data_source): 修复 日报文件名称
This commit is contained in:
parent
84b2d12fef
commit
ee8a2f8b25
1 changed files with 2 additions and 2 deletions
|
|
@ -68,7 +68,7 @@ async def save_img(data: bytes):
|
||||||
:param data:
|
:param data:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
file_path = temp_path + f"{datetime.now().date()}.png"
|
file_path = temp_path + f"{datetime.now().date()}日报.png"
|
||||||
with open(file_path, "wb") as file:
|
with open(file_path, "wb") as file:
|
||||||
file.write(data)
|
file.write(data)
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ class Report:
|
||||||
async def get_report_image(cls) -> bytes:
|
async def get_report_image(cls) -> bytes:
|
||||||
"""获取数据"""
|
"""获取数据"""
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
file = Path() / temp_path / f"{now.date()}.png"
|
file = Path() / temp_path / f"{now.date()}日报.png"
|
||||||
if os.path.exists(file):
|
if os.path.exists(file):
|
||||||
with file.open("rb") as image_file:
|
with file.open("rb") as image_file:
|
||||||
return image_file.read()
|
return image_file.read()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue