Constructor
new GorilinkNode(manager, options)
The constructor of the LavalinkNode
Parameters:
Name | Type | Description |
---|---|---|
manager |
GorilinkManager |
manager of lavalink node |
options |
Object |
options of the lavalink node |
- Source:
Members
connected :Boolean
State of connection with node
- Source:
manager :GorilinkManager
GorilinkManager instance
- Source:
reconnectInterval :Number
Reconnection attempt time with the node
- Source:
resumeKey :String
The resume key of the session
- Source:
stats :Object
Stats of lavalink node
- Source:
tag :String
Name of node
- Source:
ws :WebSocket
Client WebSocket connection
- Source:
Methods
(async) _queueFlush()
Flushs the send queue
- Source:
_send(data)
Sends data to the Lavalink Websocket
Parameters:
Name | Type | Description |
---|---|---|
data |
data to send |
- Source:
configureResuming(key, timeout)
Configures the resuming key for the LavalinkNode
Parameters:
Name | Type | Description |
---|---|---|
key |
* |
key the actual key to send to lavalink to resume with |
timeout |
* |
timeout how long before the key invalidates and lavalinknode will stop expecting you to resume |
- Source:
connect()
Connects the node to Lavalink
- Source:
destroy() → {Boolean}
Destroy lavalink WebSocket connection
- Source:
onClose(event)
Private function for handling the close event from WebSocket
Parameters:
Name | Type | Description |
---|---|---|
event |
WebSocket event data |
- Source:
onError(event)
Private function for handling the error event from WebSocket
Parameters:
Name | Type | Description |
---|---|---|
event |
WebSocket event data |
- Source:
onMessage(data)
Private function for handling the message event from WebSocket
Parameters:
Name | Type | Description |
---|---|---|
data |
The data that come from lavalink |
- Source:
onOpen()
A private function for handling the open event from WebSocket
- Source:
reconnect()
Handles reconnecting if something happens and the node discounnects
- Source:
send(data)
Sends data to the Lavalink or push it in a queue if the node is not connected
Parameters:
Name | Type | Description |
---|---|---|
data |
Object |
Data wanted to send to lavalink |
- Source: