From 7f199959f11096d105c105c01f402b90a833a6f5 Mon Sep 17 00:00:00 2001 From: RTAkland Date: Wed, 15 Jan 2025 00:27:37 +0800 Subject: [PATCH] feat: add nwwn command --- .../kotlin/cn/rtast/fancybot/commands/misc/NWWNCommand.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/misc/NWWNCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/misc/NWWNCommand.kt index 583687f..cae9aae 100644 --- a/src/main/kotlin/cn/rtast/fancybot/commands/misc/NWWNCommand.kt +++ b/src/main/kotlin/cn/rtast/fancybot/commands/misc/NWWNCommand.kt @@ -21,13 +21,13 @@ import javax.imageio.ImageIO @CommandDescription("那我问你") class NWWNCommand : BaseCommand() { override val commandNames = listOf("nwwn", "那我问你") - private val originNWWNImage = Resources.loadFromResources("misc/nwwn.png") - private val img = ImageIO.read(originNWWNImage) + private val originNWWNImage = Resources.loadFromResourcesAsBytes("misc/nwwn.png") private val font = Font("Serif", Font.ITALIC, 55) override suspend fun executeGroup(message: GroupMessage, args: List) { try { val keyword = args.first() + val img = ImageIO.read(originNWWNImage!!.inputStream()) val g2d = img.createGraphics() g2d.color = Color.BLACK g2d.font = font