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

Node

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Node(lavashark, options)

創建一個 Node 實例

Parameters

NameTypeDescription
lavasharkLavaSharkLavaShark 實例
optionsNodeOptionsNode 選項

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>

檢查 session 是否存在

Returns

Promise<void>

Defined in

lib/Node.ts:240


connect

connect(): void

連接到節點

Returns

void

Defined in

lib/Node.ts:187


disconnect

disconnect(): void

與節點斷開連接

Returns

void

Defined in

lib/Node.ts:223


getInfo

getInfo(): Promise<Info>

獲取 Lavalink 節點資訊

Returns

Promise<Info>

Defined in

lib/Node.ts:278


getRoutePlannerStatus

getRoutePlannerStatus(): Promise<RoutePlannerStatus>

獲取路徑規劃器狀態

Returns

Promise<RoutePlannerStatus>

Defined in

lib/Node.ts:297


getStats

getStats(): Promise<NodeStats>

獲取 Lavalink 節點統計信息

Returns

Promise<NodeStats>

Defined in

lib/Node.ts:287


getVersion

getVersion(): Promise<string>

獲取 Lavalink 節點版本

Returns

Promise<string>

Defined in

lib/Node.ts:268


reconnect

reconnect(): Promise<void>

與節點重新連接

Returns

Promise<void>

Defined in

lib/Node.ts:230


unmarkAllFailedAddress

unmarkAllFailedAddress(): Promise<void>

取消所有失敗的地址標記

Returns

Promise<void>

Defined in

lib/Node.ts:312


unmarkFailedAddress

unmarkFailedAddress(address): Promise<void>

取消一個失敗的地址標記

Parameters

NameTypeDescription
addressstring要取消標記的地址

Returns

Promise<void>

Defined in

lib/Node.ts:305


updateStats

updateStats(): Promise<void>

更新節點統計信息

Returns

Promise<void>

Defined in

lib/Node.ts:319


checkOptions

Static checkOptions(options): void

Parameters

NameType
optionsNodeOptions

Returns

void

Defined in

lib/Node.ts:56