mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-10 12:10:10 +08:00
Support AtAll in message.first()
This commit is contained in:
parent
7000cdece2
commit
1058377663
@ -14,7 +14,7 @@ package net.mamoe.mirai.message.data
|
||||
*
|
||||
* @see At at 单个群成员
|
||||
*/
|
||||
object AtAll : Message {
|
||||
object AtAll : Message, Message.Key<AtAll> {
|
||||
override fun toString(): String = "@全体成员"
|
||||
|
||||
// 自动为消息补充 " "
|
||||
|
@ -155,6 +155,7 @@ inline fun <reified M : Message> MessageChain.any(): Boolean = this.any { it is
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun <M : Message> MessageChain.firstOrNull(key: Message.Key<M>): M? = when (key) {
|
||||
At -> first<At>()
|
||||
AtAll -> first<AtAll>()
|
||||
PlainText -> first<PlainText>()
|
||||
Image -> first<Image>()
|
||||
Face -> first<Face>()
|
||||
|
Loading…
Reference in New Issue
Block a user