Node
The Node class represents a Node in the Sonatica system, responsible for handling audio playback.
Constructor
js
new Node(options: NodeOptions)Properties
| Options | Type | Description |
|---|---|---|
host | string | The host for the node. |
identifier | string | The identifier for the node. |
password | string | The password for the node. |
port | number | The port for the node. |
retryAmount | number | How many tries connect to the node if connection failed. |
retryDelay | number | Timeout to retry connecting to the node if connection failed. |
secure | boolean | Whether the host uses SSL. |
search | boolean | Whether to enable the search functionality. |
playback | boolean | Whether to enable the playback. |
Overview
| Properties | Methods |
|---|---|
sonatica | connect |
options | destroy |
socket | setEnabled |
stats | |
connected | |
isEnabled |
Properties
• sonatica
The main hub for interacting with Lavalink.
Type Sonatica
• options
The object that must be created to connect to a Lavalink server.
Type NodeOptions
• socket
The socket for the node.
Type Value WebSocket or null null
• stats
The stats for the node.
Properties Type Description cpu CPUStatsThe cpu stats for the node. frameStats FrameStatsThe frame stats for the node. memory MemoryStatsThe memory stats for the node. players numberThe amount of players on the node. playingPlayers numberThe amount of playing players on the node. uptime numberThe uptime for the node.
• get connected
Whether the node is connected.
Type boolean
• isEnabled
Whether the node is enabled.
Type boolean
Methods
• connect()
Description Returns Connects to the Node. void
• destroy()
Description Returns Destroys the Node and all players connected with it. void
• setEnabled()
Description Returns Enables or disables the node. void