Skip to main content

ruvyrias / Exports / Node

Class: Node

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

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Node(ruvyrias, node, options): Node

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

Parameters

NameType
ruvyriasRuvyrias
nodeNodeGroup
optionsRuvyriasOptions

Returns

Node

Defined in

src/Node/Node.ts:100

Properties

extras

Readonly extras: Omit<Extras, "library">

Defined in

src/Node/Node.ts:92


options

Readonly options: NodeGroup

Defined in

src/Node/Node.ts:91


rest

Readonly rest: Rest

Defined in

src/Node/Node.ts:89


restURL

Readonly restURL: string

Defined in

src/Node/Node.ts:87


ruvyrias

ruvyrias: Ruvyrias

Defined in

src/Node/Node.ts:85


socketURL

Readonly socketURL: string

Defined in

src/Node/Node.ts:88


stats

stats: null | NodeStats

Defined in

src/Node/Node.ts:90


ws

ws: null | WebSocket

Defined in

src/Node/Node.ts:86

Accessors

name

get name(): string

Returns the name of the node.

Returns

string

The name of the node.

Defined in

src/Node/Node.ts:216


penalties

get penalties(): number

Gets the penalties associated with the current node.

Returns

number

The total amount of penalties.

Defined in

src/Node/Node.ts:224

Methods

close

close(event): Promise<void>

This will close the connection to the node

Parameters

NameTypeDescription
eventanyany

Returns

Promise<void>

void

Defined in

src/Node/Node.ts:321


connect

connect(): Promise<void>

Establishes a connection to the Lavalink node.

Returns

Promise<void>

Defined in

src/Node/Node.ts:131


disconnect

disconnect(): Promise<void>

Disconnects the Lavalink node.

Returns

Promise<void>

void

Defined in

src/Node/Node.ts:178


error

error(event): void

This function will emit the error so that the user's listeners can get them and listen to them

Parameters

NameTypeDescription
eventanyany

Returns

void

void

Defined in

src/Node/Node.ts:337


message

message(payload): Promise<void>

This will send a message to the node

Parameters

NameTypeDescription
payloadanyThe sent payload we recieved in stringified form

Returns

Promise<void>

Return void

Defined in

src/Node/Node.ts:262


open

open(): Promise<void>

This function will open up again the node

Returns

Promise<void>

The void

Defined in

src/Node/Node.ts:242


reconnect

reconnect(): Promise<void>

Initiates a reconnection attempt to the Lavalink node.

Returns

Promise<void>

Defined in

src/Node/Node.ts:160


send

send(payload): void

Sends a payload to the Lavalink node.

Parameters

NameTypeDescription
payloadanyThe payload to be sent.

Returns

void

Defined in

src/Node/Node.ts:200