> For the complete documentation index, see [llms.txt](https://vulkava.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vulkava.js.org/docs/node.md).

# Node

Represents a lavalink node structure

| Methods                               |
| ------------------------------------- |
| [connect](#connect)                   |
| [disconnect](#disconnect)             |
| [ping](#ping)                         |
| [send](#send)                         |
| [getRecord](#getrecord)               |
| [getAllRecords](#getallrecords)       |
| [deleteRecord](#deleterecord)         |
| [deleteAllRecords](#deleteallrecords) |

### Constructor

#### new Node(options)

| Parameter |    Description   |                                    Type |
| --------- | :--------------: | --------------------------------------: |
| options   | The Node options | [NodeOptions](/typedefs/nodeoptions.md) |

### Properties

| Name       |                    Description                   |                                                                                                                   Type |
| ---------- | :----------------------------------------------: | ---------------------------------------------------------------------------------------------------------------------: |
| state      | The connection state between client and lavalink |                                                                                       [NodeState](/enums/nodestate.md) |
| stats      |              The  stats of the node              |                                                                                    [NodeStats](/typedefs/nodestats.md) |
| versions   |              The versions object \*              | [Versions](#versions) \| [null](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null) |
| options    |                 The node options                 |                                                                                [NodeOptions](/typedefs/nodeoptions.md) |
| identifier |                The node identifier               |                      [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |

&#x20;\* Only works on [my custom lavalink version](https://github.com/davidffa/lavalink/releases)

### Methods

#### connect()

Connects to the lavalink node (this method is called automatically on Vulkava#start() )

#### disconnect()

Disconnects the lavalink node

#### ping()

Gets the latency between client and the lavalink node (this function only works on [my custom lavalink version](https://github.com/davidffa/lavalink/releases))

| Returns                                                                                                                                                                                                |       Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------: |
| [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)> | The latency value |

#### send()

Sends a payload to the lavalink node via WebSocket

| Parameter |                                                                                                                               Description |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------: |
| payload   | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a><br>The payload object</p> |

#### getRecord()

Gets the recorded audio file

| Parameter |                                                                                                                          Description |
| --------- | -----------------------------------------------------------------------------------------------------------------------------------: |
| guildId   |  <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The guild id</p> |
| id        | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The record id</p> |

| Returns                                                                                                                                           |           Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------: |
| [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Buffer](https://nodejs.org/api/buffer.html)> | The audio file buffer |

#### getAllRecords()

Gets a list with the ids of all recordings from the guild.

| Parameter |                                                                                                                         Description |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------: |
| guildId   | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The guild id</p> |

| Returns                                                                                                                                                                                                                                                                                                 |     Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------: |
| [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>> | An array of ids |

#### deleteRecord()

Deletes one specific recorded audio file.

| Parameter |                                                                                                                          Description |
| --------- | -----------------------------------------------------------------------------------------------------------------------------------: |
| guildId   |  <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The guild id</p> |
| id        | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The record id</p> |

#### deleteAllRecords()

Deletes all records from the guild.

| Parameter |                                                                                                                         Description |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------: |
| guildId   | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The guild id</p> |

###

### Versions

| Property   |                                                                                                                                             Description |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------: |
| LAVAPLAYER |           <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The lavaplayer version</p> |
| JVM        |                 <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The java version</p> |
| BUILD      |                 <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The build number</p> |
| BUILDTIME  | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a><br>Timestamp of when .jar was built</p> |
| SPRING     |          <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The spring boot version</p> |
| KOTLIN     |               <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a><br>The kotlin version</p> |
