2025-01-04 16:17:12 +00:00
|
|
|
from pathlib import Path
|
2025-01-14 10:57:59 +00:00
|
|
|
from nonebot.rule import to_me
|
2025-01-04 16:17:12 +00:00
|
|
|
from nonebot.plugin import on_command
|
|
|
|
|
from nonebot.adapters.qq import MessageSegment
|
2025-01-14 10:57:59 +00:00
|
|
|
from src.image.get_image import get_image_names
|
2025-01-04 16:17:12 +00:00
|
|
|
|
2025-01-14 10:57:59 +00:00
|
|
|
image = on_command("图", rule=to_me(), priority=10, block=True)
|
2025-01-04 16:17:12 +00:00
|
|
|
|
|
|
|
|
@image.handle()
|
|
|
|
|
async def handle_function():
|
2025-01-15 16:45:24 +00:00
|
|
|
|
2025-01-04 16:17:12 +00:00
|
|
|
local_image_path = get_image_names()
|
|
|
|
|
await image.finish(MessageSegment.file_image(Path(local_image_path)))
|