Rest
This content is for the 4.0.1 version. Switch to the latest version for up-to-date documentation.
Wrapper around Lavalink REST API
Constructors
new Rest()
new Rest(
node
,options
):Rest
Parameters
• node: Node
An instance of Node
• options: NodeOption
The options to initialize this rest class
Returns
Defined in
Methods
decode()
decode(
track
):Promise
<undefined
|Track
>
Decode a track
Parameters
• track: string
Encoded track
Returns
Promise
<undefined
| Track
>
Promise that resolves to a track
Defined in
destroyPlayer()
destroyPlayer(
guildId
):Promise
<void
>
Deletes a Lavalink player
Parameters
• guildId: string
guildId where this player is
Returns
Promise
<void
>
Defined in
getLavalinkInfo()
getLavalinkInfo():
Promise
<undefined
|NodeInfo
>
Get Lavalink info
Returns
Promise
<undefined
| NodeInfo
>
Defined in
getPlayer()
getPlayer(
guildId
):Promise
<undefined
|LavalinkPlayer
>
Gets all the player with the specified sessionId
Parameters
• guildId: string
Returns
Promise
<undefined
| LavalinkPlayer
>
Promise that resolves to an array of Lavalink players
Defined in
getPlayers()
getPlayers():
Promise
<LavalinkPlayer
[]>
Gets all the player with the specified sessionId
Returns
Promise
<LavalinkPlayer
[]>
Promise that resolves to an array of Lavalink players
Defined in
getRoutePlannerStatus()
getRoutePlannerStatus():
Promise
<undefined
|RoutePlanner
>
Get routeplanner status from Lavalink
Returns
Promise
<undefined
| RoutePlanner
>
Promise that resolves to a routeplanner response
Defined in
resolve()
resolve(
identifier
):Promise
<undefined
|LavalinkResponse
>
Resolve a track
Parameters
• identifier: string
Track ID
Returns
Promise
<undefined
| LavalinkResponse
>
A promise that resolves to a Lavalink response
Defined in
stats()
stats():
Promise
<undefined
|NodeStats
>
Gets the status of this node
Returns
Promise
<undefined
| NodeStats
>
Promise that resolves to a node stats response
Defined in
unmarkFailedAddress()
unmarkFailedAddress(
address
):Promise
<void
>
Release blacklisted IP address into pool of IPs
Parameters
• address: string
IP address
Returns
Promise
<void
>
Defined in
updatePlayer()
updatePlayer(
data
):Promise
<undefined
|LavalinkPlayer
>
Updates a Lavalink player
Parameters
• data: UpdatePlayerInfo
SessionId from Discord
Returns
Promise
<undefined
| LavalinkPlayer
>
Promise that resolves to a Lavalink player
Defined in
updateSession()
updateSession(
resuming
?,timeout
?):Promise
<undefined
|SessionInfo
>
Updates the session with a resume boolean and timeout
Parameters
• resuming?: boolean
Whether resuming is enabled for this session or not
• timeout?: number
Timeout to wait for resuming
Returns
Promise
<undefined
| SessionInfo
>
Promise that resolves to a Lavalink player