mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-23 06:10:30 +08:00
Add String.invoke
DSL
This commit is contained in:
parent
d97aa7bd94
commit
53d53d2cbb
@ -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` 则删除首尾空格后比较
|
||||||
|
Loading…
Reference in New Issue
Block a user