mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-01 13:12:52 +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) })
|
||||
}
|
||||
|
||||
@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()
|
||||
|
Loading…
Reference in New Issue
Block a user