Skip to main content
Version: v2.0.0

Node

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Node(lavashark, options)

Create a new Node instance

Parameters

NameTypeDescription
lavasharkLavaSharkThe LavaShark instance
optionsNodeOptionsThe node options

Defined in

lib/Node.ts:118

Properties

options

Readonly options: NodeOptions

Defined in

lib/Node.ts:37


rest

rest: RESTController

Defined in

lib/Node.ts:39


retryAttempts

retryAttempts: number

Defined in

lib/Node.ts:40


state

state: NodeState

Defined in

lib/Node.ts:42


stats

stats: NodeStats

Defined in

lib/Node.ts:43


version

Optional version: string

Defined in

lib/Node.ts:36

Accessors

identifier

get identifier(): string

Returns

string

Defined in

lib/Node.ts:156


totalPenalties

get totalPenalties(): number

Returns

number

Defined in

lib/Node.ts:160

Methods

connect

connect(): void

Connect to node

Returns

void

Defined in

lib/Node.ts:198


disconnect

disconnect(): void

Disconnect from node

Returns

void

Defined in

lib/Node.ts:229


getInfo

getInfo(): Promise<Info>

Get the Lavalink Node information

Returns

Promise<Info>

Defined in

lib/Node.ts:285


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:305


getRoutePlannerStatus

getRoutePlannerStatus(): Promise<RoutePlannerStatus>

Gets the route planner status

Returns

Promise<RoutePlannerStatus>

Defined in

lib/Node.ts:332


getStats

getStats(): Promise<NodeStats>

Get the Lavalink Node stats

Returns

Promise<NodeStats>

Defined in

lib/Node.ts:294


getVersion

getVersion(): Promise<string>

Get the Lavalink Node version

Returns

Promise<string>

Defined in

lib/Node.ts:275


reconnect

reconnect(): Promise<void>

Reconnects the node

Returns

Promise<void>

Defined in

lib/Node.ts:236


unmarkAllFailedAddress

unmarkAllFailedAddress(): Promise<void>

Unmarks all failed address

Returns

Promise<void>

Defined in

lib/Node.ts:347


unmarkFailedAddress

unmarkFailedAddress(address): Promise<void>

Unmarks a failed address

Parameters

NameTypeDescription
addressstringThe address to unmark

Returns

Promise<void>

Defined in

lib/Node.ts:340


updateStats

updateStats(timeout?): Promise<void>

Update node stats

Parameters

NameTypeDefault value
timeoutnumber1500

Returns

Promise<void>

Defined in

lib/Node.ts:354


updatseNodeSession

updatseNodeSession(): Promise<boolean>

Update session exists

Returns

Promise<boolean>

Defined in

lib/Node.ts:246


checkOptions

checkOptions(options): void

Parameters

NameType
optionsNodeOptions

Returns

void

Defined in

lib/Node.ts:54