Skip to main content
Version: v2.1.0

Node

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Node(lavashark, options): Node

Create a new Node instance

Parameters

NameTypeDescription
lavasharkLavaSharkThe LavaShark instance
optionsNodeOptionsThe node options

Returns

Node

Defined in

lib/Node.ts:117

Properties

options

Readonly options: NodeOptions

Defined in

lib/Node.ts:38


rest

rest: RESTController

Defined in

lib/Node.ts:40


retryAttempts

retryAttempts: number

Defined in

lib/Node.ts:41


state

state: NodeState

Defined in

lib/Node.ts:43


stats

stats: NodeStats

Defined in

lib/Node.ts:44


version

Optional version: string

Defined in

lib/Node.ts:37

Accessors

identifier

get identifier(): string

Returns

string

Defined in

lib/Node.ts:157


totalPenalties

get totalPenalties(): number

Returns

number

Defined in

lib/Node.ts:161

Methods

connect

connect(): void

Connect to node

Returns

void

Defined in

lib/Node.ts:199


disconnect

disconnect(): void

Disconnect from node

Returns

void

Defined in

lib/Node.ts:230


getInfo

getInfo(): Promise<Info>

Get the Lavalink Node information

Returns

Promise<Info>

Defined in

lib/Node.ts:286


getPing

getPing(timeout?): Promise<number>

Get the ping for the node

Parameters

NameTypeDefault valueDescription
timeoutnumber1500Timeout value in milliseconds

Returns

Promise<number>

  • Node latency, in milliseconds

Defined in

lib/Node.ts:306


getRoutePlannerStatus

getRoutePlannerStatus(): Promise<RoutePlannerStatus>

Gets the route planner status

Returns

Promise<RoutePlannerStatus>

Defined in

lib/Node.ts:333


getStats

getStats(): Promise<NodeStats>

Get the Lavalink Node stats

Returns

Promise<NodeStats>

Defined in

lib/Node.ts:295


getVersion

getVersion(): Promise<string>

Get the Lavalink Node version

Returns

Promise<string>

Defined in

lib/Node.ts:276


reconnect

reconnect(): Promise<void>

Reconnects the node

Returns

Promise<void>

Defined in

lib/Node.ts:237


unmarkAllFailedAddress

unmarkAllFailedAddress(): Promise<void>

Unmarks all failed address

Returns

Promise<void>

Defined in

lib/Node.ts:348


unmarkFailedAddress

unmarkFailedAddress(address): Promise<void>

Unmarks a failed address

Parameters

NameTypeDescription
addressstringThe address to unmark

Returns

Promise<void>

Defined in

lib/Node.ts:341


updateStats

updateStats(timeout?): Promise<void>

Update node stats

Parameters

NameTypeDefault value
timeoutnumber1500

Returns

Promise<void>

Defined in

lib/Node.ts:355


updatseNodeSession

updatseNodeSession(): Promise<boolean>

Update session exists

Returns

Promise<boolean>

Defined in

lib/Node.ts:247


checkOptions

checkOptions(options): void

Parameters

NameType
optionsNodeOptions

Returns

void

Defined in

lib/Node.ts:55