🎵Player
Represents a Player instance
Methods |
---|
Constructor
new Player(options)
Property | Description | Type |
---|---|---|
options | The Player options |
Properties
Name | Description | Type |
---|---|---|
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
Parameter | Description |
---|---|
node | Node The target node to move the player |
pause()
Pauses or resumes the player
Parameter | Description |
---|---|
state | Boolean Whether to pause the player or not |
ping()
Gets the latency between discord voice gateway & lavalink node.
play()
Plays a track
Parameter | Description |
---|---|
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
Parameter | Description |
---|---|
position | Number The position to seek, in milliseconds |
setSelfDeaf()
Sets the bot's deaf state
Parameter | Description |
---|---|
state | Boolean Whether to self deaf or not |
setSelfMute()
Sets the bot's mute state
Parameter | Description |
---|---|
state | Boolean Whether to self mute or not |
setTrackLoop()
Toggles the track repeating
Parameter | Description |
---|---|
state | Boolean Whether to repeat the current track or not |
setQueueLoop()
Toggles the queue repeating
Parameter | Description |
---|---|
state | Boolean Whether to repeat the queue or not |
setVoiceChannel()
Sets the player voice channel
Parameter | Description |
---|---|
voiceChannelId | String The new voice channel id |
shuffleQueue() (DEPRECATED) Use player.queue.shuffle()
Shuffles the queue
skip()
Parameter | Description |
---|---|
amount | Number (optional) The amount of tracks to skip (default=1) |
Last updated