Node
Table of contents
Constructors
Properties
Accessors
Methods
- checkNodeSession
- connect
- disconnect
- getInfo
- getRoutePlannerStatus
- getStats
- getVersion
- reconnect
- unmarkAllFailedAddress
- unmarkFailedAddress
- updateStats
- checkOptions
Constructors
constructor
• new Node(lavashark
, options
)
創建一個 Node 實例
Parameters
Name | Type | Description |
---|---|---|
lavashark | LavaShark | LavaShark 實例 |
options | NodeOptions | Node 選項 |
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
checkNodeSession
▸ checkNodeSession(): Promise
<void
>
檢查 session 是否存在
Returns
Promise
<void
>
Defined in
connect
▸ connect(): void
連接到節點
Returns
void
Defined in
disconnect
▸ disconnect(): void
與節點斷開連接
Returns
void
Defined in
getInfo
▸ getInfo(): Promise
<Info
>
獲取 Lavalink 節點資訊
Returns
Promise
<Info
>
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(): Promise
<void
>
更新節點統計信息
Returns
Promise
<void
>
Defined in
checkOptions
▸ Static
checkOptions(options
): void
Parameters
Name | Type |
---|---|
options | NodeOptions |
Returns
void