mirai-core / net.mamoe.mirai.message.data / getValue

getValue

operator fun <reified T : Message> MessageChain.getValue(thisRef: Any?, property: KProperty<*>): T

提供一个类型的值的委托. 若不存在则会抛出异常 NoSuchElementException

用法:

val message: MessageChain

val at: At by message
val image: Image by message