Skip to main content
Version: v2.6.1

Manager




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.Manager(options: ManagerOptions)

Properties​

OptionsTypeDescription
cliendIdstringThe client ID to use.
nodesnodeOptions[]The array of nodes to connect to.
autoPlaybooleanWhether players should automatically play the next song.
usePrioritybooleanWhether to use priority mode for selecting nodes.
useNodeuseNodeOptionWhich node should the manager use in first?
pluginsplugin[]An array of plugins to use.
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.
lastFmApiKeystringThe last.fm API key. If you need to create one go here or if you already have one, get it from here
sendfunctionFunction to send data to the websocket.

send​

Function to send data to the websocket.
Returns: void

ParameterType
idstring
payloadPayload

Overview​

PropertiesMethodsEvents
nodescreatedebug
optionscreateNodenodeCreate
playersdecodeTracknodeDestroy
useableNodesdecodeTracksnodeConnect
destroynodeReconnect
destroyNodenodeDisconnect
getnodeError
initnodeRaw
searchplayerCreate
updateVoiceStateplayerDestroy
playerStateUpdate
playerMove
playerDisconnect
queueEnd
trackStart
trackEnd
trackStuck
trackError
socketClosed
playerStateUpdate
segmentsLoaded
segmentSkipped
chapterStarted
chaptersLoaded

Properties​

• nodes​

The map of nodes.

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

• options​

The options that were set.

Type
ManagerOptions

• 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
querySearchQuery | string
Optional requesterunknown

• updateVoiceState()​

Sends voice data to the Lavalink server.

Returns: void

ParameterType
dataVoicePacket

Events​

• debug​

Emitted when the Manager has a debug message.

ParameterType
infostring

• 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

• playerStateUpdate​

Emitted when a player was updated.

ParameterType
oldPlayerPlayer
newPlayerPlayer
eventPlayerStateUpdateEvent

• playerMove​

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

ParameterType
playerPlayer
intChannelstring
newChannelstring

• playerDisconnect​

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

ParameterType
playerPlayer
oldChannelstring

• queueEnd​

Emitted when a player queue ends.

ParameterType
playerPlayer
trackTrack | UnresolvedTrack
payloadTrackEndEvent

• 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

• segmentsLoaded​

Emitted when a track has loaded segments.

ParameterType
playerPlayer
trackTrack
payloadSponsorBlockSegmentsLoaded

• segmentSkipped​

Emitted when a track has skipped a segment.

ParameterType
playerPlayer
trackTrack
payloadSponsorBlockSegmentSkipped

• chapterStarted​

Emitted when a track has started a chapter.

ParameterType
playerPlayer
trackTrack
payloadSponsorBlockChapterStarted

• chaptersLoaded​

Emitted when a track has loaded chapters.

ParameterType
playerPlayer
trackTrack
payloadSponsorBlockChaptersLoaded