Message DSL: add String.reply(Message)

This commit is contained in:
Him188 2020-02-13 09:35:43 +08:00
parent 21c2fb5766
commit 397861500f

View File

@ -588,6 +588,12 @@ class MessageSubscribersBuilder<T : MessagePacket<*, *>>(
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
inline infix fun String.reply(crossinline replier: @MessageDsl suspend T.(String) -> Any?): Listener<T> {
val toCheck = this.trim()