addEventHandler method

void addEventHandler(
  1. String identifier,
  2. ChatEventHandler handler
)

~english Adds the chat event handler. After calling this method, you can handle for chat event when they arrive.

Param identifier The custom handler identifier, is used to find the corresponding handler.

Param handler The handler for chat event. See ChatEventHandler. ~end

~chinese 添加事件监听。

Param identifier 事件监听对应的 ID。

Param handler 事件监听. 请见 ChatEventHandler. ~end

Implementation

void addEventHandler(
  String identifier,
  ChatEventHandler handler,
) {
  _eventHandlesMap[identifier] = handler;
}