Skip to main content
Version: v2.6.1

Node




danger

🚨 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

new Magmastream.Node(options: NodeOptions)

Properties

OptionsTypeDescription
hoststringThe host for the node.
identifierstringThe identifier for the node.
passwordstringThe password for the node.
portnumberThe port for the node.
retryAmountnumberHow many tries connect to the node if connection failed.
retryDelaynumberTimeout to retry connecting to the node if connection failed.
resumeStatusbooleanWhether to resume the previous session. If false music will halt instantly.
resumeTimeoutnumberThe time the lavalink server will wait before it removes the player.
securebooleanWhether the host uses SSL.
prioritynumberSet the priority level of your node.

Overview

PropertiesMethods
managerconnect
optionsdestroy
socketfetchInfo
statssetSponsorBlock
connectedgetSponsorBlock
addressdeleteSponsorBlock
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.

PropertiesTypeDescription
cpuCPUStatsThe cpu stats for the node.
frameStatsFrameStatsThe frame stats for the node.
memoryMemoryStatsThe memory stats for the node.
playersnumberThe amount of players on the node.
playingPlayersnumberThe amount of playing players on the node.
uptimenumberThe 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>

ParameterType
playerPlayer
segmentsSponsorBlockSegment[]

• getSponsorBlock()

Gets the sponsorblock for the player.

Returns Promise<SponsorBlockSegment>

ParameterType
playerPlayer
segmentsSponsorBlockSegment[]

• deleteSponsorBlock()

Deletes the sponsorblock for the player.

Returns: Promise\<void>

ParameterType
playerPlayer