Commit 53d53d2c authored by Him188's avatar Him188

Add `String.invoke` DSL

parent d97aa7bd
...@@ -456,6 +456,13 @@ open class MessageSubscribersBuilder<M : ContactMessage, out Ret, R : RR, RR>( ...@@ -456,6 +456,13 @@ open class MessageSubscribersBuilder<M : ContactMessage, out Ret, R : RR, RR>(
return case(this, onEvent = block) return case(this, onEvent = block)
} }
/** 如果消息内容 `==` [equals] */
@MessageDsl
@SinceMirai("0.38.0")
operator fun String.invoke(block: MessageListener<M, R>): Ret {
return case(this, onEvent = block)
}
/** /**
* 如果消息内容 `==` [equals] * 如果消息内容 `==` [equals]
* @param trim `true` 则删除首尾空格后比较 * @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