🐛 : 修复群被动控制

This commit is contained in:
HibiKier
2024-07-23 19:00:38 +08:00
parent c75b0950bd
commit 475a188a80
3 changed files with 28 additions and 10 deletions
+6 -2
View File
@@ -380,8 +380,12 @@ def get_img_hash(image_file: str | Path) -> str:
返回:
str: 哈希值
"""
with open(image_file, "rb") as fp:
hash_value = imagehash.average_hash(Image.open(fp))
hash_value = ""
try:
with open(image_file, "rb") as fp:
hash_value = imagehash.average_hash(Image.open(fp))
except Exception as e:
logger.warning(f"获取图片Hash出错", "禁言检测", e=e)
return str(hash_value)