Skip to content

Node

The Node class represents a Node in the Sonatica system, responsible for handling audio playback.

Constructor

js
new Node(options: NodeOptions)

Properties

OptionsTypeDescription
hoststringThe host for the node.
identifierstringThe identifier for the node.
passwordstringThe password for the node.
portnumberThe port for the node.
retryAmountnumberHow many tries connect to the node if connection failed.
retryDelaynumberTimeout to retry connecting to the node if connection failed.
securebooleanWhether the host uses SSL.
searchbooleanWhether to enable the search functionality.
playbackbooleanWhether to enable the playback.

Overview

PropertiesMethods
sonaticaconnect
optionsdestroy
socketsetEnabled
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.

TypeValue
WebSocket or nullnull

• stats

The stats for the node.

PropertiesTypeDescription
cpuCPUStatsThe cpu stats for the node.
frameStatsFrameStatsThe frame stats for the node.
memoryMemoryStatsThe memory stats for the node.
playersnumberThe amount of players on the node.
playingPlayersnumberThe amount of playing players on the node.
uptimenumberThe uptime for the node.

get connected

Whether the node is connected.

Type
boolean

• isEnabled

Whether the node is enabled.

Type
boolean

Methods

• connect()

DescriptionReturns
Connects to the Node.void

• destroy()

DescriptionReturns
Destroys the Node and all players connected with it.void

• setEnabled()

DescriptionReturns
Enables or disables the node.void