Commit 39786150 authored by Him188's avatar Him188

Message DSL: add `String.reply(Message)`

parent 21c2fb57
...@@ -588,6 +588,12 @@ class MessageSubscribersBuilder<T : MessagePacket<*, *>>( ...@@ -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()
......
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