Player

Constructor

new Magmastream.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.

Overview

Properties

• dynamicRepeat

Whether the queue will repeat and shuffle every x amount of ms.

TypeValue
booleanfalse

• filters

The filters instance.

• guild

The guild of the player.

Type
string

• manager

The main hub for interacting with Lavalink.

• node

The node which the player is currently using.

Type
Node

• nowPlayingMessage

The message of the current playing track.

• options

• 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

• queueRepeat

Whether the player repeats after the last track.

TypeValue
booleanfalse

• state

The current state of the player.

Types
CONNECTED CONNECTING DISCONNECTED DISCONNECTING DESTROYING

• 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.

• volume

The volume level of the player.

Type
number

• isAutoplay

The autoplay state of the player.

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

• 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.

• play()

Returns: Promise<void>

ParameterTypeDescription
optionsPlayOptionsPlays the next track with some options.

• play()

Plays the specified track with some options.

Returns: Promise<void>

ParameterType
trackTrack
optionsPlayOptions

• restart()

DescriptionReturns
Restarts the current playing track.void

Same as Manager#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

• setDynamicRepeat()

Sets the queue to repeat and shuffles the queue after x amount of ms.

Returns: this

ParameterType
repeatboolean
msnumber

• setNowPlayingMessage()

Sets the message of the currently playing track to delete once the track ends.

Returns: this

ParameterType
repeatboolean
msnumber

• setQueueRepeat()

Sets the queue repeat.

Returns: this

ParameterType
repeatboolean

• setTextChannel()

Sets the player text channel.

Returns: this

ParameterType
channelstring

• setTrackRepeat()

Sets the track to repeat.

Returns: this

ParameterType
repeatboolean

• setVoiceChannel()

Sets the player voice channel.

Returns: this

ParameterType
channelstring

• setVolume()

Sets the player volume.

Returns: this

ParameterType
volumenumber

• setAutoplay()

Sets the player autoplay state.

Returns: this

ParameterType
autoplayStateboolean
BotUserClientUser

• stop()

DescriptionReturns
Stops the current track.this

• getRecommended()

Returns: Promise<TrackData>

ParameterType
trackTrack

• setSponsorBlock()

Sets the sponsorblock for the player.

Returns: Promise<void>

ParameterType
segmentsSponsorBlockSegment

• getSponsorBlock()

Gets the sponsorblock for the player.

Returns: Promise<SponsorBlockSegment>

ParameterType
segmentsSponsorBlockSegment

• deleteSponsorBlock()

Deletes the sponsorblock for the player.

Returns: Promise<void>