跳至主要内容
版本:v1.2.1

Node

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Node(lavashark, options)

創建一個 Node 實例

Parameters

NameTypeDescription
lavasharkLavaSharkLavaShark 實例
optionsNodeOptionsNode 選項

Defined in

lib/Node.ts:112

Properties

options

Readonly options: NodeOptions

Defined in

lib/Node.ts:34


rest

Readonly rest: RESTController

Defined in

lib/Node.ts:41


retryAttempts

retryAttempts: number

Defined in

lib/Node.ts:43


state

state: NodeState

Defined in

lib/Node.ts:45


stats

stats: NodeStats

Defined in

lib/Node.ts:46


version

Optional version: string

Defined in

lib/Node.ts:48

Accessors

identifier

get identifier(): string

Returns

string

Defined in

lib/Node.ts:149


totalPenalties

get totalPenalties(): number

Returns

number

Defined in

lib/Node.ts:153

Methods

connect

connect(): void

Returns

void

Defined in

lib/Node.ts:178


disconnect

disconnect(): void

Returns

void

Defined in

lib/Node.ts:207


getInfo

getInfo(): Promise<Info>

獲取 Lavalink 節點資訊

Returns

Promise<Info>

Defined in

lib/Node.ts:227


getRoutePlannerStatus

getRoutePlannerStatus(): Promise<RoutePlannerStatus>

獲取路徑規劃器狀態

Returns

Promise<RoutePlannerStatus>

Defined in

lib/Node.ts:246


getStats

getStats(): Promise<NodeStats>

獲取 Lavalink 節點統計信息

Returns

Promise<NodeStats>

Defined in

lib/Node.ts:236


getVersion

getVersion(): Promise<string>

獲取 Lavalink 節點版本

Returns

Promise<string>

Defined in

lib/Node.ts:217


unmarkAllFailedAddress

unmarkAllFailedAddress(): Promise<void>

Unmarks all failed address

Returns

Promise<void>

Defined in

lib/Node.ts:261


unmarkFailedAddress

unmarkFailedAddress(address): Promise<void>

Unmarks a failed address

Parameters

NameTypeDescription
addressstringThe address to unmark

Returns

Promise<void>

Defined in

lib/Node.ts:254


updateStats

updateStats(): Promise<void>

Returns

Promise<void>

Defined in

lib/Node.ts:489


checkOptions

Static checkOptions(options): void

Parameters

NameType
optionsNodeOptions

Returns

void

Defined in

lib/Node.ts:50