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 idstringpayloadPayload
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
sourceproperty.Returns: Promise<SearchResult>
Parameter Type query SearchQuery | stringOptionalrequesterunknown
• 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