Commit 5e823871 authored by Him188's avatar Him188

Introduce experimental infix `->`

parent ee45bcb3
......@@ -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` 则删除首尾空格后比较
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment