Node
Table of contents
Constructors
Properties
Accessors
Methods
- connect
- disconnect
- getInfo
- getPing
- getRoutePlannerStatus
- getStats
- getVersion
- reconnect
- unmarkAllFailedAddress
- unmarkFailedAddress
- updateStats
- updatseNodeSession
- checkOptions
Constructors
constructor
• new Node(lavashark
, options
): Node
Create a new Node instance
Parameters
Name | Type | Description |
---|---|---|
lavashark | LavaShark | The LavaShark instance |
options | NodeOptions | The node options |
Returns
Defined in
Properties
options
• Readonly
options: NodeOptions
Defined in
rest
• rest: RESTController
Defined in
retryAttempts
• retryAttempts: number
Defined in
state
• state: NodeState
Defined in
stats
• stats: NodeStats
Defined in
version
• Optional
version: string
Defined in
Accessors
identifier
• get
identifier(): string
Returns
string
Defined in
totalPenalties
• get
totalPenalties(): number
Returns
number
Defined in
Methods
connect
▸ connect(): void
Connect to node
Returns
void
Defined in
disconnect
▸ disconnect(): void
Disconnect from node
Returns
void
Defined in
getInfo
▸ getInfo(): Promise
<Info
>
Get the Lavalink Node information
Returns
Promise
<Info
>
Defined in
getPing
▸ getPing(timeout?
): Promise
<number
>
Get the ping for the node
Parameters
Name | Type | Default value | Description |
---|---|---|---|
timeout | number | 1500 | Timeout value in milliseconds |
Returns
Promise
<number
>
- Node latency, in milliseconds
Defined in
getRoutePlannerStatus
▸ getRoutePlannerStatus(): Promise
<RoutePlannerStatus
>
Gets the route planner status
Returns
Promise
<RoutePlannerStatus
>
Defined in
getStats
▸ getStats(): Promise
<NodeStats
>
Get the Lavalink Node stats
Returns
Promise
<NodeStats
>
Defined in
getVersion
▸ getVersion(): Promise
<string
>
Get the Lavalink Node version
Returns
Promise
<string
>
Defined in
reconnect
▸ reconnect(): Promise
<void
>
Reconnects the node
Returns
Promise
<void
>
Defined in
unmarkAllFailedAddress
▸ unmarkAllFailedAddress(): Promise
<void
>
Unmarks all failed address
Returns
Promise
<void
>
Defined in
unmarkFailedAddress
▸ unmarkFailedAddress(address
): Promise
<void
>
Unmarks a failed address
Parameters
Name | Type | Description |
---|---|---|
address | string | The address to unmark |
Returns
Promise
<void
>
Defined in
updateStats
▸ updateStats(timeout?
): Promise
<void
>
Update node stats
Parameters
Name | Type | Default value |
---|---|---|
timeout | number | 1500 |
Returns
Promise
<void
>
Defined in
updatseNodeSession
▸ updatseNodeSession(): Promise
<boolean
>
Update session exists
Returns
Promise
<boolean
>
Defined in
checkOptions
▸ checkOptions(options
): void
Parameters
Name | Type |
---|---|
options | NodeOptions |
Returns
void