添加图像黑白
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-10-12 11:50:15 +08:00
parent 6abeb05a18
commit ae83b66908
6 changed files with 120 additions and 0 deletions

View File

@ -0,0 +1,13 @@
from io import BytesIO
import PIL
import PIL.Image
from nonebot.adapters import Bot
from nonebot.matcher import Matcher
from nonebot_plugin_alconna import UniMessage
async def reply_image(matcher: type[Matcher], bot: Bot, img: PIL.Image.Image):
data = BytesIO()
img.save(data, "PNG")
await matcher.send(await UniMessage().image(raw=data).export(bot))