code: private void sendIdentify(WebSocket websocket) {
          ObjectNode identifyPacket = JsonNodeFactory.instance.objectNode()
                  .put("op", GatewayOpcode.IDENTIFY.getCode());
          ObjectNode data = identifyPacket.putObject("d");
          String token = api.getPrefixedToken();
          data.put("token", token)
                  .put("compress", true)
                  .put("large_threshold", 250)
                  .putObject("properties")
                  .put("$os", System.getProperty("os.name"))
                  .put("$browser", "Javacord")
                  .put("$device", "Javacord")
                  .put("$referrer", "")
                  .put("$referring_domain", "");
          if (api.getTotalShards() > 1) {
              data.putArray("shard").add(api.getCurrentShard()).add(api.getTotalShards());
          }
          // remove eventually still registered listeners
          synchronized (identifyFrameListeners) {
              websocket.removeListeners(identifyFrameListeners);
              identifyFrameListeners.clear();
          }
          WebSocketFrame identifyFrame = WebSocketFrame.createTextFrame(identifyPacket.toString());
          lastSentFrameWasIdentify.set(identifyFrame, false);
          WebSocketAdapter identifyFrameListener = new WebSocketAdapter() {
              @Override
              public void onFrameSent(WebSocket websocket, WebSocketFrame frame) {
                  if (lastSentFrameWasIdentify.isMarked()) {
                      // sending non-heartbeat frame after identify was sent => unset mark
                      if (!nextHeartbeatFrame.compareAndSet(frame, null)) {
                          lastSentFrameWasIdentify.set(null, false);
                          websocket.removeListener(this);
                          identifyFrameListeners.remove(this);
                      }
                  } else {
                      // identify frame is actually sent => set the mark
                      if (lastSentFrameWasIdentify.compareAndSet(frame, null, false, true)) {
                          lastIdentificationPerAccount.put(token, System.currentTimeMillis());
                          connectionDelaySemaphorePerAccount.get(token).release();
                      }
                  }
              }
          };
          identifyFrameListeners.add(identifyFrameListener);
          websocket.addListener(identifyFrameListener);
          logger.debug("Sending identify packet");
          websocket.sendFrame(identifyFrame);
      }
docs: Sends the identify packet.
  
  @param websocket The websocket the identify packet should be sent to.