Star ✨ on GitHub

Types & Enums

Global type aliases and enums used for defining states, strategies, and options in Moonlink.js.

Enums

Interface

NodeState

Connection state of a Lavalink node.

CONNECTING0

The node is currently attempting to establish a WebSocket connection.

CONNECTED1

The WebSocket connection is open.

DISCONNECTED2

The connection has been closed.

DESTROYED3

The node has been permanently removed and will not reconnect.

READY4

The node has sent the 'ready' payload and is available for use.

RESUMING5

The node is resuming a previous session.

Interface

LoadType

The type of result returned by a search or track load.

TRACK'track'

A single track was loaded.

PLAYLIST'playlist'

A playlist was loaded.

EMPTY'empty'

No matches were found.

ERROR'error'

An error occurred during loading.

Interface

VoiceConnectionState

State of the Discord voice connection.

CONNECTING0

Handshaking with Discord.

CONNECTED1

Successfully connected to the voice server.

DISCONNECTED2

Disconnected from the voice channel.

DESTROYED3

The connection has been cleaned up.

Types

Interface

NodeSortStrategy

Strategies for selecting the best available node.

leastLoadstring

(Default) Balances between CPU and player count.

playersstring

Selects the node with the fewest total players.

playingPlayersstring

Selects the node with the fewest active players.

memorystring

Selects the node with the most free memory.

cpuSystemstring

Selects the node with the lowest system CPU load.

uptimestring

Selects the node with the highest uptime.

randomstring

Selects a node randomly.

prioritystring

Selects based on the manually assigned priority value.

Interface

PlayerLoop

Loop modes for the player.

offstring

No looping.

trackstring

Repeats the current track indefinitely.

queuestring

Repeats the entire queue.

Interface

TrackEndReason

Reason why a track finished playing.

finishedstring

The track played to completion.

loadFailedstring

The track failed to load or crashed.

stoppedstring

The player was stopped manually.

replacedstring

The track was replaced by another track (e.g. play() called while playing).

cleanupstring

The player was destroyed or cleaned up.

Interface

TPartialTrackProperties

Track properties that can be partially loaded.

Propertiesstring

title | author | duration | identifier | isSeekable | isStream | uri | artworkUrl | isrc | sourceName | position | requester | origin | pluginInfo | userData | retries | time