From caa404d58d05a372b99a5a15a61c4265c2491397 Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Mon, 13 Jun 2022 11:03:21 +0800 Subject: [PATCH] Update utils.py --- utils/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 8c280933..ac151b84 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -5,6 +5,7 @@ from configs.config import SYSTEM_PROXY, Config from typing import List, Union, Optional, Type, Any from nonebot.adapters.onebot.v11 import Bot, Message from nonebot.matcher import matchers, Matcher +from pathlib import Path import httpx import nonebot import pytz @@ -400,7 +401,7 @@ def change_pixiv_image_links( return url -def change_img_md5(path_file: str) -> bool: +def change_img_md5(path_file: Union[str, Path]) -> bool: """ 说明: 改变图片MD5 @@ -412,4 +413,4 @@ def change_img_md5(path_file: str) -> bool: f.write(str(int(time.time() * 1000))) return True except: - return False \ No newline at end of file + return False