更新依赖注入

This commit is contained in:
HibiKier
2022-10-22 18:12:55 +08:00
parent 1ce4537605
commit 499517e882
9 changed files with 75 additions and 22 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import imagehash
from PIL import Image
from io import BytesIO
from httpx import TimeoutException
from services.log import logger
from nonebot.typing import T_State
from nonebot.adapters.onebot.v11 import MessageEvent
@@ -20,8 +20,8 @@ async def check(event: MessageEvent, state: T_State) -> bool:
try:
r = await AsyncHttpx.get(img[0])
problem = str(imagehash.average_hash(Image.open(BytesIO(r.content))))
except TimeoutException:
pass
except Exception as e:
logger.warning(f"word_bank rule 获取图片失败 {type(e)}:{e}")
if at:
temp = ''
for seg in event.message: