This commit is contained in:
unknownsno 2023-04-13 10:17:29 +08:00
parent 08c7aae6b7
commit 6c898b207e

View File

@ -28,7 +28,10 @@ def image(
if file.startswith(("http", "base64://")): if file.startswith(("http", "base64://")):
return MessageSegment.image(file) return MessageSegment.image(file)
else: else:
return MessageSegment.image(IMAGE_PATH / file) if (IMAGE_PATH / file).exists():
return MessageSegment.image(IMAGE_PATH / file)
logger.warning(f"图片 {(IMAGE_PATH / file).absolute()}缺失...")
return ""
if isinstance(file, Path): if isinstance(file, Path):
if file.exists(): if file.exists():
return MessageSegment.image(file) return MessageSegment.image(file)