setOnText

abstract fun setOnText(onTextListener: (scope: CoroutineScope, text: String) -> Job)

设置一个当接收到文本消息时触发的回调。

Parameters

onTextListener

一个监听器函数,接收 CoroutineScope 和文本消息字符串。