Class : Player
Constructor
- Player : options
new Magmastream.Player(options: PlayerOptions)
Parameter | Type | Description | Optional |
---|---|---|---|
guildId | string as Guild.id | The guild ID the Player belongs to. | |
textChannelId | string as GuildTextChannel.id | The text channel the Player belongs to. | |
voiceChannelId | string as GuildVoiceChannel.id | The voice channel the Player belongs to. | |
node | string as Node.identifier | The node the Player uses. | |
volume | number | The initial volume the Player will use. | |
selfMute | boolean | If the player should mute itself. | |
selfDeafen | boolean | If the player should deaf itself. |
Table of contents
Properties
autoplayTries
The number of times to try autoplay before emitting queueEnd.
Return: number |
3 (default value)
bands
The equalizer bands array.
Return: number[]
dynamicRepeat
Whether the queue repeats and shuffles after each song.
Return: boolean
filters
The filters applied to the audio.
Return:
Filters
guildId
The guild ID for the player.
isAutoplay
The autoplay state of the player.
Return: boolean
manager
The Manager for the player.
Return:
Manager
node
The Node for the Player.
Return:
Node
nowPlayingMessage
The now playing message for the player.
Return: Message
paused
Whether the player is paused.
Return: boolean
playing
Whether the player is playing.
Return: boolean
position
The time the player is in the track.
Return: number
queue
The Queue for the Player.
Return:
Queue
queueRepeat
Whether the queue repeats the queue.
Return: boolean
state
The current state of the player.
Return: StateTypes
textChannel
The text channel id for the player.
Return: string as
GuildTextChannel.id
trackRepeat
Whether the queue repeats the track.
Return: boolean
voiceChannel
The voice channel id for the player.
Return: string as
GuildVoiceChannel.id
voiceState
The voice state object from Discord.
Return: VoiceState
volume
The volume for the player.
Return: number
Methods
autoMoveNode()
async functionAutomatically moves the player to a usable node.
connect()
Connects the player to the voice channel.
Return: this
deleteSponsorBlock()
async functionDeletes the sponsorblock for the player. This will remove all sponsorblock segments that have been set for the player.
destroy(disconnect)
async functionDestroys the player and clears the queue.
Parameter Type Description Optional disconnect
boolean Whether to disconnect the player from the voice channel. If no provided is true
disconnect()
async functionDisconnects the player from the voice channel.
get(key)
Retrieves custom data associated with a given key.
Return: The data associated with the key, cast to the specified type.
Parameter Type Description Optional key
string The key to retrieve the data for.
getCurrentLyrics(skipTrackSource)
async functionRetrieves the current lyrics for the playing track.
This method uses thelavalyrics-plugin
to fetch the lyrics. If the plugin is not available, it will throw a RangeError.Return: Promise<
lyrics{}
>
Parameter Type Description Optional skipTrackSource
boolean Indicates whether to skip the track source when fetching lyrics.
getRecommendedTracks(track, requester)
async functionGets recommended tracks and returns an array of tracks.
Parameter Type Description Optional track
track{}
The track to find recommendations for. requester
User
|ClientUser
The user who requested the track.
getSponsorBlock()
async functionGets the sponsorblock for the player.
Return: Promise<
sponsorBlockSegment[]
>
moveNode(identifier)
async functionMoves the player to another node.
Return: Promise<
sponsorBlockSegment[]
>
Parameter Type Description Optional identifier
string as Node.identifier
The identifier of the node to move to.
pause()
async functionPauses or resumes the current track.
Parameter Type Description Optional pause
boolean A boolean indicating whether to pause (true) or resume (false) the track.