diff --git a/src/main/kotlin/cn/rtast/fancybot/FancyBot.kt b/src/main/kotlin/cn/rtast/fancybot/FancyBot.kt index 38e7a16..529154c 100644 --- a/src/main/kotlin/cn/rtast/fancybot/FancyBot.kt +++ b/src/main/kotlin/cn/rtast/fancybot/FancyBot.kt @@ -143,6 +143,17 @@ class FancyBot : OneBotListener { val multiply = command.split("加速").last().toFloat() SpeedUpGIFCommand.speedUp(message, getMsg, multiply) } + if (command.contains("/黑白")) { + val msg = MessageChain.Builder() + getMsg.message.filter { it.type == ArrayMessageType.image || it.type == ArrayMessageType.mface } + .forEach { + val base64 = it.data.file!!.toURL() + .readBytes().toBufferedImage() + .toGrayscale().toByteArray().encodeToBase64() + msg.addImage(base64, true) + } + message.reply(msg.build()) + } } coroutineScope.launch {