Player
Constructor
new Magmastream.Player(options: PlayerOptions)
Properties
Options | Type | Description |
---|---|---|
guild | string | The guild the Player belongs to. |
node | string | The node the Player uses. |
selfDeafen | boolean | If the player should deaf itself. |
selfMute | boolean | If the player should mute itself. |
textChannel | string | The text channel the Player belongs to. |
voiceChannel | string | The voice channel the Player belongs to. |
volume | number | The initial volume the Player will use. |
Overview
Properties
• dynamicRepeat
Whether the queue will repeat and shuffle every
x
amount ofms
.
Type Value boolean false
• filters
The filters instance.
Type Filters
• guild
The guild of the player.
Type string
• manager
The main hub for interacting with Lavalink.
Type Manager
• node
The node which the player is currently using.
Type Node
• nowPlayingMessage
The message of the current playing track.
• options
Type PlayerOptions
• paused
Whether the player is paused.
Type Value boolean false
• playing
Whether the player is playing.
Type Value boolean false
• postition
The current track time.
Type Value boolean false
• queue
The player's queue.
Type Queue
• queueRepeat
Whether the player repeats after the last track.
Type Value boolean false
• state
The current state of the player.
Types CONNECTED
CONNECTING
DISCONNECTED
DISCONNECTING
DESTROYING
• textChannel
The text channel which the player uses.
Type Value string null
• trackRepeat
Whether the player repeats the track.
Type Value boolean false
• voiceChannel
The voice channel which the player uses.
Type Value string null
• voiceState
Discord's voice state object.
Type VoiceState
• volume
The volume level of the player.
Type number
• isAutoplay
The autoplay state of the player.
Type boolean
Methods
• connect()
Description Returns Connect to the voice channel. this
• destroy()
Description Returns Destroys the player. void
• disconnect()
Description Returns Disconnect from the voice channel. this
• get()
Get custom data.
Type parameter
T
Returns:
T
Parameter Type key string
• pause()
Pauses the current track.
Returns:
this
Parameter Type pause boolean
• previous()
Description Returns Go back to the previous song. this
• play()
Plays the next track.
Returns:
Promise<void>
• play()
Returns:
Promise<void>
Parameter Type Description track Track Plays the specified track.
• play()
Returns:
Promise<void>
Parameter Type Description options PlayOptions Plays the next track with some options.
• play()
Plays the specified track with some options.
Returns:
Promise<void>
Parameter Type track Track options PlayOptions
• restart()
Description Returns Restarts the current playing track. void
• search()
Same as
Manager#search()
but a shortcut on the player itself.Returns: Promise<SearchResult>
Parameter Type query string requester unknown
• seek()
Seeks to the position in the current track.
Returns:
this
Parameter Type position number
• set()
Set custom data.
Returns:
void
Parameter Type key string value unknown
• setDynamicRepeat()
Sets the queue to repeat and shuffles the queue after
x
amount ofms
.Returns:
this
Parameter Type repeat boolean ms number
• setNowPlayingMessage()
Sets the message of the currently playing track to delete once the track ends.
Returns:
this
Parameter Type repeat boolean ms number
• setQueueRepeat()
Sets the queue repeat.
Returns:
this
Parameter Type repeat boolean
• setTextChannel()
Sets the player text channel.
Returns:
this
Parameter Type channel string
• setTrackRepeat()
Sets the track to repeat.
Returns:
this
Parameter Type repeat boolean
• setVoiceChannel()
Sets the player voice channel.
Returns:
this
Parameter Type channel string
• setVolume()
Sets the player volume.
Returns:
this
Parameter Type volume number
• setAutoplay()
Sets the player autoplay state.
Returns:
this
Parameter Type autoplayState boolean BotUser ClientUser
• stop()
Description Returns Stops the current track. this
• getRecommended()
Returns: Promise<TrackData>
Parameter Type track Track
• setSponsorBlock()
Sets the sponsorblock for the player.
Returns:
Promise<void>
Parameter Type segments SponsorBlockSegment
• getSponsorBlock()
Gets the sponsorblock for the player.
Returns: Promise<SponsorBlockSegment>
Parameter Type segments SponsorBlockSegment
• deleteSponsorBlock()
Deletes the sponsorblock for the player.
Returns:
Promise<void>