updateChatThreadName method

Future<void> updateChatThreadName({
  1. required String chatThreadId,
  2. required String newName,
})

修改子区名称。

@note 只有子区所属群主、群管理员及子区创建者可调用该方法。

子区所属群组的所有成员均会收到 ChatThreadEventHandler.onChatThreadUpdate

Param chatThreadId 子区 ID。

Param newName 子区的新名称。长度不超过 64 个字符。

Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError

Implementation

Future<void> updateChatThreadName({
  required String chatThreadId,
  required String newName,
}) async {
  try {
    Map req = {
      "name": newName,
      "threadId": chatThreadId,
    };
    Map result = await platform_interface.Client.instance.chatThreadManager.callNativeMethod(
      ChatMethodKeys.updateChatThreadSubject,
      req,
    );
    ChatError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}