getGroupOnlineMemberCount method

Future getGroupOnlineMemberCount(
  1. Map<String, dynamic> params
)

Implementation

Future<dynamic> getGroupOnlineMemberCount(Map<String, dynamic> params) async {
  try {
    final groupID = params['groupID'];
    final res = await wrappedPromiseToFuture(
        timeweb!.getGroupOnlineMemberCount(groupID));
    if (res.code == 0) {
      return CommonUtils.returnSuccess<int>(jsToMap(res.data)['memberCount']);
    } else {
      return CommonUtils.returnErrorForValueCb<int>(
          'get online member count failed!');
    }
  } catch (error) {
    return CommonUtils.returnErrorForValueCb<int>(error);
  }
}