Skip to main content
Version: v1.3.3

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


retryAttempts

retryAttempts: number

Defined in

lib/Node.ts:47


state

state: NodeState

Defined in

lib/Node.ts:49


stats

stats: NodeStats

Defined in

lib/Node.ts:50


version

Optional version: string

Defined in

lib/Node.ts:54

Accessors

identifier

get identifier(): string

Returns

string

Defined in

lib/Node.ts:155


totalPenalties

get totalPenalties(): number

Returns

number

Defined in

lib/Node.ts:159

Methods

checkNodeSession

checkNodeSession(): Promise<void>

Check session exists

Returns

Promise<void>

Defined in

lib/Node.ts:240


connect

connect(): void

Connect to node

Returns

void

Defined in

lib/Node.ts:187


disconnect

disconnect(): void

Disconnect from node

Returns

void

Defined in

lib/Node.ts:223


getInfo

getInfo(): Promise<Info>

Get the Lavalink Node information

Returns

Promise<Info>

Defined in

lib/Node.ts:278


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


getRoutePlannerStatus

getRoutePlannerStatus(): Promise<RoutePlannerStatus>

Gets the route planner status

Returns

Promise<RoutePlannerStatus>

Defined in

lib/Node.ts:335


getStats

getStats(): Promise<NodeStats>

Get the Lavalink Node stats

Returns

Promise<NodeStats>

Defined in

lib/Node.ts:297


getVersion

getVersion(): Promise<string>

Get the Lavalink Node version

Returns

Promise<string>

Defined in

lib/Node.ts:278


reconnect

reconnect(): Promise<void>

Reconnects the node

Returns

Promise<void>

Defined in

lib/Node.ts:240


unmarkAllFailedAddress

unmarkAllFailedAddress(): Promise<void>

Unmarks all failed address

Returns

Promise<void>

Defined in

lib/Node.ts:350


unmarkFailedAddress

unmarkFailedAddress(address): Promise<void>

Unmarks a failed address

Parameters

NameTypeDescription
addressstringThe address to unmark

Returns

Promise<void>

Defined in

lib/Node.ts:343


updateStats

updateStats(timeout?): Promise<void>

Update node stats

Parameters

NameTypeDefault value
timeoutnumber1500

Returns

Promise<void>

Defined in

lib/Node.ts:357


checkOptions

Static checkOptions(options): void

Parameters

NameType
optionsNodeOptions

Returns

void

Defined in

lib/Node.ts:56