Manager

Magmastream's Manager, the ultimate command post for unleashing the power of Lavalink like a boss, guaranteed to make you go "Whoa!" like the most mind-blowing meme.

Constructor

new Magmastream.Manager(options: ManagerOptions)

Properties

OptionsTypeDescription
autoPlaybooleanWhether players should automatically play the next song.
cliendIdstringThe client ID to use.
nodesarrayThe array of nodes to connect to.
usePrioritybooleanWhether to use priority mode for selecting nodes.
useNode"leastLoad|leastPlayers"Use the least amount of players or least load?
pluginsarrayAn array of plugins to use.
shardsnumberThe shard count.
trackPartialstring[]An array of track properties to keep. track will always be present.
defaultSearchPlatformstringThe search platform to use to query songs.
replaceYouTubeCredentialsbooleanWhether the YouTube video titles should be replaced if the Author does not exactly match.

Methods

Function to send data to the websocket.

Returns: void

ParameterType
idstring
payloadPayload

Overview

Events

• nodeCreate

Emitted when a Node is created.

ParameterType
nodeNode

• nodeDestroy

Emitted when a Node is destroyed.

ParameterType
nodeNode

• nodeConnect

Emitted when a Node connects.

ParameterType
nodeNode

• nodeReconnect

Emitted when a Node reconnects.

ParameterType
nodeNode

• nodeDisconnect

Emitted when a Node disconnects.

ParameterType
nodeNode
reason{ code: number , reason: string }

• nodeError

Emitted when a Node has an error.

ParameterType
nodeNode
errorError

• nodeRaw

Emitted whenever any Lavalink event is received.

ParameterType
payloadunknown

• playerCreate

Emitted when a player is created.

ParameterType
playerPlayer

• playerDestroy

Emitted when a player is destroyed.

ParameterType
playerPlayer

• queueEnd

Emitted when a player queue ends.

ParameterType
playerPlayer

• playerMove

Emitted when a player is moved to a new voice channel.

ParameterType
playerPlayer
oldChannelstring
newChannelstring

• trackStart

Emitted when a track starts.

ParameterType
playerPlayer
trackTrack
payloadTrackStartEvent

• trackEnd

Emitted when a track ends.

ParameterType
playerPlayer
trackTrack
payloadTrackEndEvent

• trackStuck

Emitted when a track gets stuck during playback.

ParameterType
playerPlayer
trackTrack
payloadTrackStuckEvent

• trackError

Emitted when a track has an error during playback.

ParameterType
playerPlayer
trackTrack
payloadTrackExceptionEvent

• socketClosed

Emitted when a voice connection is closed.

ParameterType
playerPlayer
payloadWebSocketClosedEvent

• playerStateUpdate

Emitted when the state of the player has been changed either player paused/resumed or the loop modes have been toggled on or off.

ParameterType
oldPlayerPlayer
newPlayerPlayer

Properties

• nodes

The map of nodes.

TypeValue
Collection<string, Node>new Collection<string, Node>()

• options

The options that were set.

• players

The map of players.

TypeValue
Collection<string, Player>new Collection<string, Player>()

get useableNodes

Type
Node

Methods

• create()

Creates a player or returns one if it already exists.

Returns: Player

ParameterType
optionsPlayerOptions

• createNode()

Creates a node or returns one if it already exists.

Returns: Node

ParameterType
optionsNodeOptions

• decodeTrack()

Decodes the base64 encoded track and returns a TrackData.

Returns: Promise<TrackData>

ParameterType
trackstring

• decodeTracks()

Decodes the base64 encoded tracks and returns a TrackData array.

Returns: Promise<TrackData[]>

ParameterType
tracksstring[]

• destroy()

Destroys a player if it exists.

Returns: void

ParameterType
guildstring

• destroyNode()

Destroys a node if it exists.

Returns: void

ParameterType
identifierstring

• get()

Returns a player or undefined if it does not exist.

Returns: Player | undefined

ParameterType
guildstring

• init()

Initiates the Manager.

Returns: this

ParameterType
clientIdstring

Searches the enabled sources based off the URL or the source property.

Returns: Promise<SearchResult>

ParameterType
querystring
Optional requesterunknown

• updateVoiceState()

Sends voice data to the Lavalink server.

Returns: void

ParameterType
dataVoicePacket