Skip to main content
Version: 2.0.0

Node

ruvyrias


ruvyrias / Node

Class: Node

Defined in: src/Node.ts:11

Represents a connection to a Lavalink node, allowing communication and control over audio playback.

Constructors

Constructor

new Node(ruvyrias, node, options): Node

Defined in: src/Node.ts:28

The Node class that is used to connect to a lavalink node

Parameters

ruvyrias

Ruvyrias

node

NodeGroup

options

RuvyriasOptions

Returns

Node

Properties

extras

readonly extras: Omit<Extras, "library">

Defined in: src/Node.ts:20


isConnected

isConnected: boolean

Defined in: src/Node.ts:13


options

readonly options: NodeGroup

Defined in: src/Node.ts:19


rest

readonly rest: Rest

Defined in: src/Node.ts:17


ruvyrias

ruvyrias: Ruvyrias

Defined in: src/Node.ts:12


stats

stats: null | NodeStats

Defined in: src/Node.ts:18

Accessors

name

Get Signature

get name(): string

Defined in: src/Node.ts:144

Gets the name of the node.

Returns

string

The node's name.


penalties

Get Signature

get penalties(): number

Defined in: src/Node.ts:152

Calculates and returns the penalty score for this node.

Returns

number

The total penalty value.

Methods

connect()

connect(): Promise<void>

Defined in: src/Node.ts:59

Establishes a connection to the Lavalink node.

Returns

Promise<void>

Resolves when the connection attempt is initiated.


disconnect()

disconnect(): Promise<void>

Defined in: src/Node.ts:106

Disconnects from the Lavalink node and cleans up resources.

Returns

Promise<void>

Resolves when the node is fully disconnected.


reconnect()

reconnect(): Promise<void>

Defined in: src/Node.ts:88

Attempts to reconnect to the Lavalink node after a delay.

Returns

Promise<void>

Resolves when the reconnection attempt is scheduled.


send()

send(payload): void

Defined in: src/Node.ts:128

Sends a payload to the Lavalink node over WebSocket.

Parameters

payload

any

The payload to send.

Returns

void

Throws

If the node is not connected.