mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 00:32:06 +08:00
Merge branch 'main' of https://github.com/HibiKier/zhenxun_bot
This commit is contained in:
@@ -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:
|
||||||
|
if (IMAGE_PATH / file).exists():
|
||||||
return MessageSegment.image(IMAGE_PATH / file)
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user