Manager
🚨 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
- Manager
new Magmastream.Manager(options: ManagerOptions)
Properties
Options | Type | Description |
---|---|---|
cliendId | string | The client ID to use. |
nodes | nodeOptions[] | The array of nodes to connect to. |
autoPlay | boolean | Whether players should automatically play the next song. |
usePriority | boolean | Whether to use priority mode for selecting nodes. |
useNode | useNodeOption | Which node should the manager use in first? |
plugins | plugin[] | 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. |
lastFmApiKey | string | The last.fm API key. If you need to create one go here or if you already have one, get it from here |
send | function | Function to send data to the websocket. |
send
Function to send data to the websocket.
Returns:void
Parameter Type id
string
payload
Payload
Overview
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 SearchQuery | string
Optional
requesterunknown
• updateVoiceState()
Sends voice data to the Lavalink server.
Returns:
void
Parameter Type data VoicePacket
Events
• debug
Emitted when the Manager has a debug message.
Parameter Type info string
• 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
• playerStateUpdate
Emitted when a player was updated.
Parameter Type oldPlayer Player newPlayer Player event PlayerStateUpdateEvent
• playerMove
Emitted when a player is moved to a new voice channel.
Parameter Type player Player intChannel string newChannel string
• playerDisconnect
Emitted when a player is moved to a new voice channel.
Parameter Type player Player oldChannel string
• queueEnd
Emitted when a player queue ends.
Parameter Type player Player track Track | UnresolvedTrack payload TrackEndEvent
• 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
• 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