code: public void sendVoiceStateUpdate(
              Server server, ServerVoiceChannel channel, Boolean selfMuted, Boolean selfDeafened) {
          ObjectNode updateVoiceStatePacket = JsonNodeFactory.instance.objectNode()
                  .put("op", GatewayOpcode.VOICE_STATE_UPDATE.getCode());
          if (server == null) {
              if (channel == null) {
                  throw new IllegalArgumentException("Either server or channel must be given");
              }
              server = channel.getServer();
          }
          User yourself = api.getYourself();
          updateVoiceStatePacket.putObject("d")
                  .put("guild_id", server.getIdAsString())
                  .put("channel_id", (channel == null) ? null : channel.getIdAsString())
                  .put("self_mute", (selfMuted == null) ? server.isSelfMuted(yourself) : selfMuted)
                  .put("self_deaf", (selfDeafened == null) ? server.isSelfDeafened(yourself) : selfDeafened);
          logger.debug("Sending VOICE_STATE_UPDATE packet for channel {} on server {}", channel, server);
          websocket.get().sendText(updateVoiceStatePacket.toString());
      }
docs: Sends the voice state update packet.
  
  @param server The server to send the voice state update for. Can be {@code null} if {@code channel} is given.
  @param channel The channel to connect to or {@code null} to disconnect from voice.
  @param selfMuted Whether to self-mute on the given server. If {@code null}, current state remains unchanged.
  @param selfDeafened Whether to self-deafen on the given server. If {@code null}, current state remains unchanged.