moonlink.js / Exports / MoonlinkNode
Class: MoonlinkNode
Table of contents
Constructors
Properties
- _manager
- calls
- db
- host
- http
- identifier
- info
- password
- port
- reconnectAttempts
- reconnectTimeout
- rest
- resume
- resumeStatus
- resumeTimeout
- resumed
- retryAmount
- retryDelay
- secure
- sessionId
- socket
- state
- stats
- version
Accessors
Methods
Constructors
constructor
• new MoonlinkNode(node
): MoonlinkNode
Initializes a new MoonlinkNode instance with the provided configuration.
Parameters
Name | Type | Description |
---|---|---|
node | INode | The configuration object for the Lavalink node. |
Returns
Defined in
src/@Entities/MoonlinkNode.ts:50
Properties
_manager
• Private
_manager: MoonlinkManager
Defined in
src/@Entities/MoonlinkNode.ts:19
calls
• calls: number
= 0
Defined in
src/@Entities/MoonlinkNode.ts:42
db
• db: MoonlinkDatabase
= Structure.db
Defined in
src/@Entities/MoonlinkNode.ts:43
host
• host: string
Defined in
src/@Entities/MoonlinkNode.ts:26
http
• http: string
Defined in
src/@Entities/MoonlinkNode.ts:31
identifier
• Optional
identifier: string
Defined in
src/@Entities/MoonlinkNode.ts:27
info
• info: any
= {}
Defined in
src/@Entities/MoonlinkNode.ts:41
password
• password: string
Defined in
src/@Entities/MoonlinkNode.ts:28
port
• port: number
Defined in
src/@Entities/MoonlinkNode.ts:29
reconnectAttempts
• Private
reconnectAttempts: number
= 1
Defined in
src/@Entities/MoonlinkNode.ts:21
reconnectTimeout
• Private
Optional
reconnectTimeout: Timeout
Defined in
src/@Entities/MoonlinkNode.ts:20
rest
• rest: MoonlinkRestFul
Defined in
src/@Entities/MoonlinkNode.ts:32
resume
• Optional
resume: boolean
Defined in
src/@Entities/MoonlinkNode.ts:33
resumeStatus
• Private
resumeStatus: boolean
= false
Defined in
src/@Entities/MoonlinkNode.ts:24
resumeTimeout
• Optional
resumeTimeout: number
= 30000
Defined in
src/@Entities/MoonlinkNode.ts:35
resumed
• Optional
resumed: boolean
Defined in
src/@Entities/MoonlinkNode.ts:34
retryAmount
• Private
retryAmount: number
= 6
Defined in
src/@Entities/MoonlinkNode.ts:22
retryDelay
• Private
retryDelay: number
= 120000
Defined in
src/@Entities/MoonlinkNode.ts:23
secure
• secure: boolean
Defined in
src/@Entities/MoonlinkNode.ts:30
sessionId
• sessionId: string
Defined in
src/@Entities/MoonlinkNode.ts:36
socket
• socket: MoonlinkWebSocket
Defined in
src/@Entities/MoonlinkNode.ts:37
state
• state: string
= State.DISCONNECTED
Defined in
src/@Entities/MoonlinkNode.ts:39
stats
• stats: INodeStats
Defined in
src/@Entities/MoonlinkNode.ts:40
version
• version: string
= ""
Defined in
src/@Entities/MoonlinkNode.ts:38
Accessors
address
• get
address(): string
Returns the formatted address string composed of the host and port.
Returns
string
The formatted address string.
Defined in
src/@Entities/MoonlinkNode.ts:96
Methods
check
▸ check(node
): void
Validates the correctness of essential configuration options for the node.
Parameters
Name | Type | Description |
---|---|---|
node | INode | The configuration object for the Lavalink node. |
Returns
void
Defined in
src/@Entities/MoonlinkNode.ts:105
close
▸ close(code
, reason
): void
Parameters
Name | Type |
---|---|
code | number |
reason | any |
Returns
void
Defined in
src/@Entities/MoonlinkNode.ts:269
connect
▸ connect(): Promise
<any
>
Establishes a WebSocket connection to the Lavalink server.
Returns
Promise
<any
>
A promise representing the connection process.
Defined in
src/@Entities/MoonlinkNode.ts:159
error
▸ error(error
): void
Parameters
Name | Type |
---|---|
error | Error |
Returns
void
Defined in
src/@Entities/MoonlinkNode.ts:421
handleEvent
▸ handleEvent(payload
): Promise
<any
>
Parameters
Name | Type |
---|---|
payload | any |
Returns
Promise
<any
>
Defined in
src/@Entities/MoonlinkNode.ts:430
message
▸ message(data
): Promise
<void
>
Parameters
Name | Type |
---|---|
data | string | Buffer |
Returns
Promise
<void
>
Defined in
src/@Entities/MoonlinkNode.ts:299
movePlayersToNextNode
▸ movePlayersToNextNode(): Promise
<void
>
Returns
Promise
<void
>
Defined in
src/@Entities/MoonlinkNode.ts:193
open
▸ open(): void
Returns
void
Defined in
src/@Entities/MoonlinkNode.ts:182
reconnect
▸ reconnect(): void
Returns
void
Defined in
src/@Entities/MoonlinkNode.ts:239
request
▸ request(endpoint
, params
): Promise
<object
>
Sends a request to the specified endpoint with parameters and returns a promise that resolves to the response object.
Parameters
Name | Type | Description |
---|---|---|
endpoint | string | The endpoint to send the request to. |
params | any | The parameters for the request. |
Returns
Promise
<object
>
A promise resolving to the response object.