Commit 5342a349 authored by Him188's avatar Him188

Trim for passed arg

parent 7677a410
......@@ -149,8 +149,10 @@ class MessageSubscribersBuilder<T : MessagePacket<*>>(
trim: Boolean = true,
ignoreCase: Boolean = false,
noinline onEvent: @MessageDsl suspend T.(String) -> Unit
) =
content({ equals.equals(if (trim) it.trim() else it, ignoreCase = ignoreCase) }, onEvent)
) {
val toCheck = if (trim) equals.trim() else equals
content({ toCheck.equals(if (trim) it.trim() else it, ignoreCase = ignoreCase) }, onEvent)
}
/**
* 如果消息内容包含 [sub], 就执行 [onEvent]
......
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