mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-07 19:42:26 +08:00
Introduce experimental infix ->
This commit is contained in:
parent
ee45bcb3f0
commit
5e823871c8
@ -342,6 +342,19 @@ class MessageSubscribersBuilder<T : MessagePacket<*, *>>(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果消息内容 `==` [equals]
|
||||
*/
|
||||
@MiraiExperimentalAPI
|
||||
@MessageDsl
|
||||
@JvmName("case1")
|
||||
@JsName("case1")
|
||||
@SinceMirai("0.29.0")
|
||||
@Suppress("INVALID_CHARACTERS", "NAME_CONTAINS_ILLEGAL_CHARS")
|
||||
infix fun String.`->`(block: MessageListener<M, R>): Ret {
|
||||
return case(this, onEvent = block)
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果消息内容 `==` [equals]
|
||||
* @param trim `true` 则删除首尾空格后比较
|
||||
|
Loading…
Reference in New Issue
Block a user