mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
fix bug
This commit is contained in:
parent
08c7aae6b7
commit
6c898b207e
@ -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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user