from nonebot import on_message
from nonebot.adapters import Bot

from konabot.common.nb.extract_image import PIL_Image
from konabot.common.nb.match_keyword import match_keyword
from konabot.common.nb.reply_image import reply_image

cmd_black_white = on_message(rule=match_keyword("黑白"))


@cmd_black_white.handle()
async def _(img: PIL_Image, bot: Bot):
    await reply_image(cmd_black_white, bot, img.convert("LA"))
