Node
🚨 THIS DOCUMENTATION IS FOR VERSION =<2.6.1. WE RECOMMEND USING THE LATEST VERSION FOR SUPPORT REASONS. WE ALSO WARN THAT THIS OLDER DOCUMENTATION MAY NOT BE COMPLETE OR POORLY READABLE.
Constructor
- Node
new Magmastream.Node(options: NodeOptions)
Properties
Options | Type | Description |
---|---|---|
host | string | The host for the node. |
identifier | string | The identifier for the node. |
password | string | The password for the node. |
port | number | The port for the node. |
retryAmount | number | How many tries connect to the node if connection failed. |
retryDelay | number | Timeout to retry connecting to the node if connection failed. |
resumeStatus | boolean | Whether to resume the previous session. If false music will halt instantly. |
resumeTimeout | number | The time the lavalink server will wait before it removes the player. |
secure | boolean | Whether the host uses SSL. |
priority | number | Set the priority level of your node. |
Overview
Properties | Methods |
---|---|
manager | connect |
options | destroy |
socket | fetchInfo |
stats | setSponsorBlock |
connected | getSponsorBlock |
address | deleteSponsorBlock |
info |
Properties
• manager
The main hub for interacting with Lavalink.
Type Manager
• options
The object that must be created to connect to a Lavalink server.
Type NodeOptions
• socket
The socket for the node.
Type WebSocket or null
• stats
The stats for the node.
Properties Type Description cpu CPUStats The cpu stats for the node. frameStats FrameStats The frame stats for the node. memory MemoryStats The memory stats for the node. players number The amount of players on the node. playingPlayers number The amount of playing players on the node. uptime number The uptime for the node.
• get
connected
Whether the node is connected.
Type boolean
• get
address
Returns the address for this node.
Type string
• info
Actual Lavalink information of the node.
Type LavalinkInfo or null
Methods
• connect()
Connects to the Node.
Returns:
void
• destroy()
Destroys the Node and all players connected with it.
Returns:
void
• fetchInfo()
Fetch information about lavalink in this node
Returns: Promise<LavalinkInfo>
• setSponsorBlock()
Sets the sponsorblock for the player.
Returns:
Promise\<void>
Parameter Type player Player segments SponsorBlockSegment[]
• getSponsorBlock()
Gets the sponsorblock for the player.
Returns Promise<SponsorBlockSegment>
Parameter Type player Player segments SponsorBlockSegment[]
• deleteSponsorBlock()
Deletes the sponsorblock for the player.
Returns:
Promise\<void>
Parameter Type player Player