Skip to content

Rest

Wrapper around Lavalink REST API

Constructors

new Rest()

new Rest(node: Node, options: NodeOption): Rest

Parameters

ParameterTypeDescription
nodeNodeAn instance of Node
optionsNodeOptionThe options to initialize this rest class

Returns

Rest

Defined in

shoukaku/src/node/Rest.ts:189

Methods

decode()

decode(track: string): Promise<undefined | Track>

Decode a track

Parameters

ParameterTypeDescription
trackstringEncoded track

Returns

Promise<undefined | Track>

Promise that resolves to a track

Defined in

shoukaku/src/node/Rest.ts:217


destroyPlayer()

destroyPlayer(guildId: string): Promise<void>

Deletes a Lavalink player

Parameters

ParameterTypeDescription
guildIdstringguildId where this player is

Returns

Promise<void>

Defined in

shoukaku/src/node/Rest.ts:271


getLavalinkInfo()

getLavalinkInfo(): Promise<undefined | NodeInfo>

Get Lavalink info

Returns

Promise<undefined | NodeInfo>

Defined in

shoukaku/src/node/Rest.ts:340


getPlayer()

getPlayer(guildId: string): Promise<undefined | LavalinkPlayer>

Gets the player with the specified guildId

Parameters

ParameterType
guildIdstring

Returns

Promise<undefined | LavalinkPlayer>

Promise that resolves to a Lavalink player

Defined in

shoukaku/src/node/Rest.ts:241


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

shoukaku/src/node/Rest.ts:229


getRoutePlannerStatus()

getRoutePlannerStatus(): Promise<undefined | RoutePlanner>

Get routeplanner status from Lavalink

Returns

Promise<undefined | RoutePlanner>

Promise that resolves to a routeplanner response

Defined in

shoukaku/src/node/Rest.ts:313


resolve()

resolve(identifier: string): Promise<undefined | LavalinkResponse>

Resolve a track

Parameters

ParameterTypeDescription
identifierstringTrack ID

Returns

Promise<undefined | LavalinkResponse>

A promise that resolves to a Lavalink response

Defined in

shoukaku/src/node/Rest.ts:204


stats()

stats(): Promise<undefined | Stats>

Gets the status of this node

Returns

Promise<undefined | Stats>

Promise that resolves to a node stats response

Defined in

shoukaku/src/node/Rest.ts:301


unmarkFailedAddress()

unmarkFailedAddress(address: string): Promise<void>

Release blacklisted IP address into pool of IPs

Parameters

ParameterTypeDescription
addressstringIP address

Returns

Promise<void>

Defined in

shoukaku/src/node/Rest.ts:325


updatePlayer()

updatePlayer(data: UpdatePlayerInfo): Promise<undefined | LavalinkPlayer>

Updates a Lavalink player

Parameters

ParameterTypeDescription
dataUpdatePlayerInfoSessionId from Discord

Returns

Promise<undefined | LavalinkPlayer>

Promise that resolves to a Lavalink player

Defined in

shoukaku/src/node/Rest.ts:254


updateSession()

updateSession(resuming?: boolean, timeout?: number): Promise<undefined | SessionInfo>

Updates the session with a resume boolean and timeout

Parameters

ParameterTypeDescription
resuming?booleanWhether resuming is enabled for this session or not
timeout?numberTimeout to wait for resuming

Returns

Promise<undefined | SessionInfo>

Promise that resolves to a Lavalink player

Defined in

shoukaku/src/node/Rest.ts:285