🎵Player

Represents a Player instance

Constructor

new Player(options)

PropertyDescriptionType

options

The Player options

Properties

NameDescriptionType

node

The lavalink node that this player is connected to

filters

The filters instance of this player

guildId

The guild id of this player

voiceChannelId

The voice channel id of this player

textChannelId

The text channel id of this player

selfMute

Whether or not this player is muted

selfDeaf

Whether or not this player is deafened

current

The current track of this player

queue

The queue of this player

trackRepeat

Whether to repeat the current track

queueRepeat

Whether to repeat the queue

playing

Whether this player is playing or not

paused

Whether this player is paused or not

state

The state of player's connection

voiceState

The player voicestate

position

The player position

exactPosition

The exact player position

queueDuration

The queue duration, in milliseconds (DEPRECATED, use queue.duration)

volume

The player volume [0, 500]

recorder

Gets the player recorder object

Methods

connect()

Connects the bot to the voice channel

disconnect()

Disconnects the bot from the voice channel

destroy()

Destroys the player and disconnects the bot from the voice channel

moveNode()

Moves the player to another lavalink node

ParameterDescription

node

Node The target node to move the player

pause()

Pauses or resumes the player

ParameterDescription

state

Boolean Whether to pause the player or not

ping()

Gets the latency between discord voice gateway & lavalink node.

ReturnsDescription

The latency value

play()

Plays a track

ParameterDescription

options

Object (optional)

options.startTime

Number (optional) Track start time in milliseconds

options.endTime

Number (optional) Track end time in milliseconds

options.noReplace

Boolean (optional) Whether to ignore the play operation if a track is already playing or paused

seek()

Seek to a specific position in the track

ParameterDescription

position

Number The position to seek, in milliseconds

setSelfDeaf()

Sets the bot's deaf state

ParameterDescription

state

Boolean Whether to self deaf or not

setSelfMute()

Sets the bot's mute state

ParameterDescription

state

Boolean Whether to self mute or not

setTrackLoop()

Toggles the track repeating

ParameterDescription

state

Boolean Whether to repeat the current track or not

setQueueLoop()

Toggles the queue repeating

ParameterDescription

state

Boolean Whether to repeat the queue or not

setVoiceChannel()

Sets the player voice channel

ParameterDescription

voiceChannelId

String The new voice channel id

shuffleQueue() (DEPRECATED) Use player.queue.shuffle()

Shuffles the queue

skip()

ParameterDescription

amount

Number (optional) The amount of tracks to skip (default=1)

Last updated