mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 01:30:17 +08:00
Adjust exception message
This commit is contained in:
parent
dc4b0cbe1e
commit
366de98a6c
@ -172,7 +172,7 @@ fun <M : Message> MessageChain.firstOrNull(key: Message.Key<M>): M? = when (key)
|
||||
@JvmSynthetic
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
inline fun <M : Message> MessageChain.first(key: Message.Key<M>): 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] 实例
|
||||
|
Loading…
Reference in New Issue
Block a user