# Node

| 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> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vulkava.js.org/docs/node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
