diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt index 7af7b2c84..2f6b310fc 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt @@ -172,7 +172,7 @@ fun MessageChain.firstOrNull(key: Message.Key): M? = when (key) @JvmSynthetic @Suppress("UNCHECKED_CAST") inline fun MessageChain.first(key: Message.Key): M = - firstOrNull(key) ?: throw NoSuchElementException("Message type $key not found in chain $this") + firstOrNull(key) ?: throw NoSuchElementException("Message type ${key.typeName} not found in chain $this") /** * 获取第一个 [M] 类型的 [Message] 实例