Skip to content

Player

Constructor

ts
new Player(options: PlayerOptions)

Properties

OptionsTypeDescription
guildstringThe guild the Player belongs to.
nodestringThe node the Player uses.
selfDeafenbooleanIf the player should deaf itself.
selfMutebooleanIf the player should mute itself.
textChannelstringThe text channel the Player belongs to.
voiceChannelstringThe voice channel the Player belongs to.
volumenumberThe initial volume the Player will use.
dataobjectAdditional data for the player.

Overview

PropertiesMethods
isAutoplayconnect
filtersdestroy
guilddisconnect
sonaticaget
nodepause
lyricsprevious
optionsskip
pausedsearch
playingseek
positionset
queuesetRepeat
repeatModesetTextChannel
statesetVoiceChannel
textChannelsetVolume
voiceChannelsetAutoplay
voiceStatemoveNode
volumestop
play

Properties

• filters

The filters instance.

Type
Filters

• guild

The guild of the player.

Type
string

• sonatica

The main hub for interacting with Lavalink.

Type
Sonatica

• node

The node which the player is currently using.

Type
Node

• lyrics

The lyrics object associated with the player.

Type
Lyrics

• options

Type
PlayerOptions

• paused

Whether the player is paused.

TypeValue
booleanfalse

• playing

Whether the player is playing.

TypeValue
booleanfalse

• postition

The current track time.

TypeValue
booleanfalse

• queue

The player's queue.

Type
Queue

• repeatMode

The repeat mode of the player.

TypeValue
RepeatMode0

• state

The current state of the player.

Types
CONNECTED CONNECTING DISCONNECTED DISCONNECTING DESTROYING MOVING RESUMING

• textChannel

The text channel which the player uses.

TypeValue
stringnull

• trackRepeat

Whether the player repeats the track.

TypeValue
booleanfalse

• voiceChannel

The voice channel which the player uses.

TypeValue
stringnull

• voiceState

Discord's voice state object.

Type
VoiceState

• volume

The volume level of the player.

Type
number

• isAutoplay

Whether the player is in autoplay mode.

Type
boolean

Methods

• connect()

DescriptionReturns
Connect to the voice channel.this

• destroy()

DescriptionReturns
Destroys the player.void

• disconnect()

DescriptionReturns
Disconnect from the voice channel.this

• moveNode()

Moves the player to a different node.

Returns: this

ParameterType
nodestring

• get()

Get custom data.

Type parameter T

Returns: T

ParameterType
keystring

• pause()

Pauses the current track.

Returns: this

ParameterType
pauseboolean

• previous()

DescriptionReturns
Go back to the previous song.this

• play()

Plays the next track.

Returns: Promise<void>

• play()

Returns: Promise<void>

ParameterTypeDescription
trackTrackPlays the specified track.

Same as Sonatica#search() but a shortcut on the player itself.

Returns: Promise<SearchResult>

ParameterType
querystring
requesterunknown

• seek()

Seeks to the position in the current track.

Returns: this

ParameterType
positionnumber

• set()

Set custom data.

Returns: void

ParameterType
keystring
valueunknown

• setRepeat()

Sets the repeat mode

Returns: this

ParameterType
modeRepeatMode

• setTextChannel()

Sets the player text channel.

Returns: this

ParameterType
channelstring

• setVoiceChannel()

Sets the player voice channel.

Returns: this

ParameterType
channelstring

• setVolume()

Sets the player volume.

Returns: this

ParameterType
volumenumber

• setAutoplay()

Sets the autoplay state.

Returns: this

ParameterType
stateboolean

• stop()

DescriptionReturns
Stops the current track.this

• skip()

DescriptionReturns
Skips the current track.this