Skip to content

Manager ​

Constructs a new Manager instance.

Constructor ​

ts
new Manager(options: ManagerOptions)

Options ​

OptionsTypeDescription
autoPlaybooleanIndicates if songs should automatically play.
autoResumebooleanAutomatically resume players.
autoMovebooleanMove players to other node if node going down.
cliendIdstringThe ID of the client.
cliendNamestringThe name of the client.
nodesarrayThe list of NodeOptions.
pluginsarrayThe list of plugins.
shardsnumberThe number of shard count.
trackPartialstring[]The list of partial tracks.
defaultSearchPlatformstringThe default search platform.

Methods ​

Function to send data to the websocket.

Returns: void

ParameterType
idstring
payloadPayload

Overview ​

PropertiesMethodsEvents
nodescreatenodeCreate
optionscreateNodenodeDestroy
playersdecodeTracknodeConnect
decodeTracksnodeReconnect
destroynodeDisconnect
destroyNodenodeError
getnodeRaw
initplayerCreate
searchplayerDestroy
updateVoiceStatequeueEnd
playerMove
trackStart
trackEnd
trackStuck
trackError
socketClosed

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

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>()

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