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
創建一個 Node 實例
Parameters
Name | Type | Description |
---|---|---|
lavashark | LavaShark | LavaShark 實例 |
options | NodeOptions | Node 選項 |
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
連接到節點
Returns
void
Defined in
disconnect
▸ disconnect(): void
與節點斷開連接
Returns
void
Defined in
getInfo
▸ getInfo(): Promise
<Info
>
獲取 Lavalink 節點資訊
Returns
Promise
<Info
>
Defined in
getPing
▸ getPing(timeout?
): Promise
<number
>
獲取節點的 ping
Parameters
Name | Type | Default value | Description |
---|---|---|---|
timeout | number | 1500 | 超時值,以毫秒為單位 |
Returns
Promise
<number
>
- 與節點的延遲,以毫秒為單位
Defined in
getRoutePlannerStatus
▸ getRoutePlannerStatus(): Promise
<RoutePlannerStatus
>
獲取路徑規劃器狀態
Returns
Promise
<RoutePlannerStatus
>
Defined in
getStats
▸ getStats(): Promise
<NodeStats
>
獲取 Lavalink 節點統計信息
Returns
Promise
<NodeStats
>
Defined in
getVersion
▸ getVersion(): Promise
<string
>
獲取 Lavalink 節點版本
Returns
Promise
<string
>
Defined in
reconnect
▸ reconnect(): Promise
<void
>
與節點重新連接
Returns
Promise
<void
>
Defined in
unmarkAllFailedAddress
▸ unmarkAllFailedAddress(): Promise
<void
>
取消所有失敗的地址標記
Returns
Promise
<void
>
Defined in
unmarkFailedAddress
▸ unmarkFailedAddress(address
): Promise
<void
>
取消一個失敗的地址標記
Parameters
Name | Type | Description |
---|---|---|
address | string | 要取消標記的地址 |
Returns
Promise
<void
>
Defined in
updateStats
▸ updateStats(timeout?
): Promise
<void
>
更新節點統計信息
Parameters
Name | Type | Default value |
---|---|---|
timeout | number | 1500 |
Returns
Promise
<void
>
Defined in
updatseNodeSession
▸ updatseNodeSession(): Promise
<boolean
>
更新節點 session
Returns
Promise
<boolean
>
Defined in
checkOptions
▸ checkOptions(options
): void
Parameters
Name | Type |
---|---|
options | NodeOptions |
Returns
void