mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-06 08:00:10 +08:00
Message DSL: add String.reply(Message)
This commit is contained in:
parent
21c2fb5766
commit
397861500f
@ -588,6 +588,12 @@ class MessageSubscribersBuilder<T : MessagePacket<*, *>>(
|
|||||||
return content({ it.trim() == toCheck }, { reply(reply) })
|
return content({ it.trim() == toCheck }, { reply(reply) })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@MessageDsl
|
||||||
|
infix fun String.reply(reply: Message): Listener<T> {
|
||||||
|
val toCheck = this.trim()
|
||||||
|
return content({ it.trim() == toCheck }, { reply(reply) })
|
||||||
|
}
|
||||||
|
|
||||||
@MessageDsl
|
@MessageDsl
|
||||||
inline infix fun String.reply(crossinline replier: @MessageDsl suspend T.(String) -> Any?): Listener<T> {
|
inline infix fun String.reply(crossinline replier: @MessageDsl suspend T.(String) -> Any?): Listener<T> {
|
||||||
val toCheck = this.trim()
|
val toCheck = this.trim()
|
||||||
|
Loading…
Reference in New Issue
Block a user