exitClientById method

Future<bool> exitClientById(
  1. int clientId, {
  2. bool isClose = false,
  3. String? extra,
})

Implementation

Future<bool> exitClientById(
  int clientId, {
  bool isClose = false,
  String? extra,
}) async {
  MtprotoClient? tdlibClient = getClientById(clientId);
  if (tdlibClient != null) {
    if (isClose) {
      try {
        await invoke(
          "close",
          clientId: clientId,
          extra: extra,
        );
      } catch (e) {}
    }
    tdlibClient.close();
    clients.remove(tdlibClient);
    return true;
  }
  return false;
}