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
Options | Type | Description |
---|---|---|
autoPlay | boolean | Whether players should automatically play the next song. |
cliendId | string | The client ID to use. |
nodes | array | The array of nodes to connect to. |
usePriority | boolean | Whether to use priority mode for selecting nodes. |
useNode | "leastLoad|leastPlayers" | Use the least amount of players or least load? |
plugins | array | An array of plugins to use. |
trackPartial | string[] | An array of track properties to keep. track will always be present. |
defaultSearchPlatform | string | The search platform to use to query songs. |
replaceYouTubeCredentials | boolean | Whether the YouTube video titles should be replaced if the Author does not exactly match. |
Methods
Function to send data to the websocket.
Returns:
void
Parameter | Type |
---|---|
id | string |
payload | Payload |
Overview
Events
• nodeCreate
Emitted when a Node is created.
Parameter Type node Node
• nodeDestroy
Emitted when a Node is destroyed.
Parameter Type node Node
• nodeConnect
Emitted when a Node connects.
Parameter Type node Node
• nodeReconnect
Emitted when a Node reconnects.
Parameter Type node Node
• nodeDisconnect
Emitted when a Node disconnects.
Parameter Type node Node reason { code: number , reason: string }
• nodeError
Emitted when a Node has an error.
Parameter Type node Node error Error
• nodeRaw
Emitted whenever any Lavalink event is received.
Parameter Type payload unknown
• playerCreate
Emitted when a player is created.
Parameter Type player Player
• playerDestroy
Emitted when a player is destroyed.
Parameter Type player Player
• queueEnd
Emitted when a player queue ends.
Parameter Type player Player
• playerMove
Emitted when a player is moved to a new voice channel.
Parameter Type player Player oldChannel string newChannel string
• trackStart
Emitted when a track starts.
Parameter Type player Player track Track payload TrackStartEvent
• trackEnd
Emitted when a track ends.
Parameter Type player Player track Track payload TrackEndEvent
• trackStuck
Emitted when a track gets stuck during playback.
Parameter Type player Player track Track payload TrackStuckEvent
• trackError
Emitted when a track has an error during playback.
Parameter Type player Player track Track payload TrackExceptionEvent
• socketClosed
Emitted when a voice connection is closed.
Parameter Type player Player payload WebSocketClosedEvent
• 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.
• segmentsLoaded
Emitted when a track has loaded segments.
Parameter Type player Player track Track payload SponsorBlockSegmentsLoaded
• segmentSkipped
Emitted when a track has skipped a segment.
Parameter Type player Player track Track payload SponsorBlockSegmentSkipped
• chapterStarted
Emitted when a track has started a chapter.
Parameter Type player Player track Track payload SponsorBlockChapterStarted
• chaptersLoaded
Emitted when a track has loaded chapters.
Parameter Type player Player track Track payload SponsorBlockChaptersLoaded
Properties
• nodes
The map of nodes.
Type Value Collection<string, Node> new Collection<string, Node>()
• options
The options that were set.
Type ManagerOptions
• players
The map of players.
Type Value 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
Parameter Type options PlayerOptions
• createNode()
Creates a node or returns one if it already exists.
Returns: Node
Parameter Type options NodeOptions
• decodeTrack()
Decodes the base64 encoded track and returns a TrackData.
Returns: Promise<TrackData>
Parameter Type track string
• decodeTracks()
Decodes the base64 encoded tracks and returns a TrackData array.
Returns: Promise<TrackData
[]
>
Parameter Type tracks string []
• destroy()
Destroys a player if it exists.
Returns:
void
Parameter Type guild string
• destroyNode()
Destroys a node if it exists.
Returns:
void
Parameter Type identifier string
• get()
Returns a player or undefined if it does not exist.
Returns: Player |
undefined
Parameter Type guild string
• init()
Initiates the Manager.
Returns:
this
Parameter Type clientId string
• search()
Searches the enabled sources based off the URL or the
source
property.Returns: Promise<SearchResult>
Parameter Type query string Optional
requesterunknown
• updateVoiceState()
Sends voice data to the Lavalink server.
Returns:
void
Parameter Type data VoicePacket