NodeLinkNode
Defined in: src/structures/NodeLink.ts:28
Lavalink Node creator class
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NodeLinkNode(options: LavalinkNodeOptions, manager: NodeManager): NodeLinkNode;Defined in: src/structures/NodeLink.ts:31
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options | LavalinkNodeOptions |
manager | NodeManager |
Returns
Section titled “Returns”NodeLinkNode
Overrides
Section titled “Overrides”Properties
Section titled “Properties”| Property (defined in) | Type | Default value | Description |
|---|---|---|---|
calls (src/structures/Node.ts:82) | number | 0 | The amount of rest calls the node has made. |
decode (src/structures/Node.ts:922) | object | undefined | Decode Track or Tracks |
decode.multipleTracks (src/structures/Node.ts:959) | (encodeds: string[], requester: unknown) => Promise<Track[]> | undefined | Decodes multiple tracks into their info Example `const encodedBase64_1 = ‘QAACDgMACk5vIERpZ2dpdHkAC0JsYWNrc3RyZWV0AAAAAAAEo4AABjkxNjQ5NgABAB9odHRwczovL2RlZXplci5jb20vdHJhY2svOTE2NDk2AQBpaHR0cHM6Ly… |
decode.singleTrack (src/structures/Node.ts:935) | (encoded: string, requester: unknown) => Promise<Track> | undefined | Decode a single track into its info Example `const encodedBase64 = ‘QAACDgMACk5vIERpZ2dpdHkAC0JsYWNrc3RyZWV0AAAAAAAEo4AABjkxNjQ5NgABAB9odHRwczovL2RlZXplci5jb20vdHJhY2svOTE2NDk2AQBpaHR0cHM6Ly9lLWNk… |
info (src/structures/Node.ts:121) | LavalinkInfo | null | Actual Lavalink Information of the Node |
isAlive (src/structures/Node.ts:77) | boolean | false | |
lyrics (src/structures/Node.ts:972) | object | undefined | |
lyrics.get (src/structures/Node.ts:986) | (track: Track, skipTrackSource: boolean) => Promise<LyricsResult> | undefined | Get the lyrics of a track Example const lyrics = await player.node.lyrics.get(track, true); // use it of player instead: // const lyrics = await player.getLyrics(track, true); |
lyrics.getCurrent (src/structures/Node.ts:1021) | (guildId: string, skipTrackSource: boolean) => Promise<LyricsResult> | undefined | Get the lyrics of the current playing track Example const lyrics = await player.node.lyrics.getCurrent(guildId); // use it of player instead: // const lyrics = await player.getCurrentLyrics(); |
lyrics.subscribe (src/structures/Node.ts:1056) | (guildId: string) => Promise<unknown> | undefined | subscribe to lyrics updates for a guild Example await player.node.lyrics.subscribe(guildId); // use it of player instead: // const lyrics = await player.subscribeLyrics(); |
lyrics.unsubscribe (src/structures/Node.ts:1080) | (guildId: string) => Promise<void> | undefined | unsubscribe from lyrics updates for a guild Example await player.node.lyrics.unsubscribe(guildId); // use it of player instead: // const lyrics = await player.unsubscribeLyrics(); |
nodeType ({ LavalinkNode.nodeType} src/structures/NodeLink.ts:29) | "NodeLink" | undefined | |
options (src/structures/Node.ts:80) | LavalinkNodeOptions | undefined | The provided Options of the Node |
reconnectionState (src/structures/Node.ts:123) | ReconnectionState | ReconnectionState.IDLE | current state of the Reconnections |
resuming (src/structures/Node.ts:119) | object | undefined | Wether the node resuming is enabled or not |
resuming.enabled (src/structures/Node.ts:119) | boolean | undefined | |
resuming.timeout (src/structures/Node.ts:119) | number | undefined | |
routePlannerApi (src/structures/Node.ts:1371) | object | undefined | Lavalink’s Route Planner Api |
routePlannerApi.getStatus (src/structures/Node.ts:1383) | () => Promise<RoutePlanner> | undefined | Get routplanner Info from Lavalink for ip rotation Example `const routePlannerStatus = await player.node.routePlannerApi.getStatus(); const usedBlock = routePlannerStatus.details?.ipBlock; const c… |
routePlannerApi.unmarkAllFailedAddresses (src/structures/Node.ts:1417) | () => Promise<unknown> | undefined | Release all blacklisted IP addresses into pool of IPs Example await player.node.routePlannerApi.unmarkAllFailedAddresses(); |
routePlannerApi.unmarkFailedAddress (src/structures/Node.ts:1398) | (address: string) => Promise<unknown> | undefined | Release blacklisted IP address into pool of IPs for ip rotation Example await player.node.routePlannerApi.unmarkFailedAddress("ipv6address"); |
sessionId? (src/structures/Node.ts:117) | string | null | The current sessionId, only present when connected |
specificFilters (src/structures/NodeLink.ts:111) | object | undefined | Description NodeLink has a lot of filters SPECIFICALLY for NodeLink, check the documentation for more information. Link documentiation |
specificFilters.chorus (src/structures/NodeLink.ts:132) | (player: Player, options: NodeLink_ChorusFilter, disableFilter: boolean) => Promise<boolean> | undefined | Simulates multiple voices playing together with modulated delays |
specificFilters.compressor (src/structures/NodeLink.ts:147) | (player: Player, options: NodeLink_CompressorFilter, disableFilter: boolean) => Promise<boolean> | undefined | Dynamic range compression for balanced audio levels |
specificFilters.echo (src/structures/NodeLink.ts:117) | (player: Player, options: NodeLink_EchoFilter, disableFilter: boolean) => Promise<boolean> | undefined | Creates delay-based echo with feedback control |
specificFilters.highPass (src/structures/NodeLink.ts:162) | (player: Player, options: NodeLink_HighPassFilter, disableFilter: boolean) => Promise<boolean> | undefined | Filters out low frequencies, letting high frequencies pass through |
specificFilters.phaser (src/structures/NodeLink.ts:177) | (player: Player, options: NodeLink_PhaserFilter, disableFilter: boolean) => Promise<boolean> | undefined | Sweeps all-pass filters across the frequency spectrum for a swooshing effect |
specificFilters.resetNodeLinkFilters (src/structures/NodeLink.ts:207) | (player: Player) => Promise<boolean> | undefined | Resets all NodeLink filters |
specificFilters.spatial (src/structures/NodeLink.ts:192) | (player: Player, options: NodeLink_SpatialFilter, disableFilter: boolean) => Promise<boolean> | undefined | Creates spatial audio using cross-channel delays and modulation |
stats (src/structures/Node.ts:84) | NodeStats | undefined | Stats from lavalink, will be updated via an interval by lavalink. |
_NodeLinkClass (src/structures/Node.ts:78) | unknown | null |
Accessors
Section titled “Accessors”_checkForPlugins
Section titled “_checkForPlugins”Get Signature
Section titled “Get Signature”get _checkForPlugins(): boolean;Defined in: src/structures/Node.ts:152
Returns wether the plugin validations are enabled or not
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”_checkForSources
Section titled “_checkForSources”Get Signature
Section titled “Get Signature”get _checkForSources(): boolean;Defined in: src/structures/Node.ts:159
Returns wether the source validations are enabled or not
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”connected
Section titled “connected”Get Signature
Section titled “Get Signature”get connected(): boolean;Defined in: src/structures/Node.ts:190
Returns if connected to the Node.
Example
Section titled “Example”const isConnected = player.node.connected;console.log("node is connected: ", isConnected ? "yes" : "no")Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”connectionStatus
Section titled “connectionStatus”Get Signature
Section titled “Get Signature”get connectionStatus(): string;Defined in: src/structures/Node.ts:207
Returns the current ConnectionStatus
Example
Section titled “Example”try { const statusOfConnection = player.node.connectionStatus; console.log("node's connection status is:", statusOfConnection)} catch (error) { console.error("no socket available?", error)}Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”heartBeatPing
Section titled “heartBeatPing”Get Signature
Section titled “Get Signature”get heartBeatPing(): number;Defined in: src/structures/Node.ts:145
Returns the Heartbeat Ping of the Node
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”Get Signature
Section titled “Get Signature”get id(): string;Defined in: src/structures/Node.ts:703
Get the id of the node
Example
Section titled “Example”const nodeId = player.node.id;console.log("node id is: ", nodeId)Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”isNodeReconnecting
Section titled “isNodeReconnecting”Get Signature
Section titled “Get Signature”get isNodeReconnecting(): boolean;Defined in: src/structures/Node.ts:1581
If already trying to reconnect or pending, return
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”LavalinkNode.isNodeReconnecting
reconnectionAttemptCount
Section titled “reconnectionAttemptCount”Get Signature
Section titled “Get Signature”get reconnectionAttemptCount(): number;Defined in: src/structures/Node.ts:1617
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”LavalinkNode.reconnectionAttemptCount
Methods
Section titled “Methods”addMixerLayer()
Section titled “addMixerLayer()”addMixerLayer( player: Player, trackToAdd: Track,volume: number): Promise<AddMixerLayerResponse>;Defined in: src/structures/NodeLink.ts:47
Adds a new audio track to be mixed over the current playback.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
player | Player | The player to add the mixer layer to. |
trackToAdd | Track | The track to add to the mixer layer. |
volume | number | The volume of the track to add to the mixer layer. (0 - 100) |
Returns
Section titled “Returns”Promise<AddMixerLayerResponse>
documentiation
changeAudioTrackLanguage()
Section titled “changeAudioTrackLanguage()”changeAudioTrackLanguage(player: Player, language_audioTrackId: string): Promise<any>;Defined in: src/structures/NodeLink.ts:316
NodeLink supports selecting specific audio tracks for videos that contain multiple audio streams (e.g., Netflixstyle dubs, multi-language YouTube videos). This function changes the current language of the audio, in place at the same position of the current track. You can always do it manually by providing extra field in the track object “audioTrackId”
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
player | Player | The player to apply the filter to |
language_audioTrackId | string | The language of the audio track to select, see it in the pluginInfo.audioTracks |
Returns
Section titled “Returns”Promise<any>
connect()
Section titled “connect()”connect(sessionId?: string): void;Defined in: src/structures/Node.ts:631
Connect to the Lavalink Node
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
sessionId? | string | Provide the Session Id of the previous connection, to resume the node and it’s player(s) |
Returns
Section titled “Returns”void
void
Example
Section titled “Example”player.node.connect(); // if provided on bootup in managerOptions#nodes, this will be called automatically when doing lavalink.init()
// or connect from a resuming session:player.node.connect("sessionId");Inherited from
Section titled “Inherited from”deleteSponsorBlock()
Section titled “deleteSponsorBlock()”deleteSponsorBlock(player: Player): Promise<void>;Defined in: src/structures/Node.ts:2235
Delete the sponsorblock plugins
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
player | Player | passthrough the player |
Returns
Section titled “Returns”Promise<void>
void
Example
Section titled “Example”// use it on the player via player.deleteSponsorBlock();const sponsorBlockSegments = await player.node.deleteSponsorBlock(player);Inherited from
Section titled “Inherited from”LavalinkNode.deleteSponsorBlock
destroy()
Section titled “destroy()”destroy( destroyReason?: string, deleteNode?: boolean, movePlayers?: boolean): void;Defined in: src/structures/Node.ts:724
Destroys the Node-Connection (Websocket) and all player’s of the node
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
destroyReason? | string | undefined | Destroy Reason to use when destroying the players |
deleteNode? | boolean | true | wether to delete the nodte from the nodes list too, if false it will emit a disconnect. |
movePlayers? | boolean | false | whether to movePlayers to different eligible connected node. If false players won’t be moved |
Returns
Section titled “Returns”void
void
Default
Section titled “Default”trueDefault
Section titled “Default”falseExample
Section titled “Example”Destroys node and its players
player.node.destroy("custom Player Destroy Reason", true);destroys only the node and moves its players to different connected node.
player.node.destroy("custom Player Destroy Reason", true, true);Inherited from
Section titled “Inherited from”destroyPlayer()
Section titled “destroyPlayer()”destroyPlayer(guildId: any): Promise<void>;Defined in: src/structures/Node.ts:610
Destroys the Player on the Lavalink Server
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
guildId | any | - |
Returns
Section titled “Returns”Promise<void>
request result
Example
Section titled “Example”// use player.destroy() insteadplayer.node.destroyPlayer(player.guildId);Inherited from
Section titled “Inherited from”disconnect()
Section titled “disconnect()”disconnect(disconnectReason?: string): void;Defined in: src/structures/Node.ts:839
Disconnects the Node-Connection (Websocket)
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
disconnectReason? | string | Disconnect Reason to use when disconnecting Node |
Returns
Section titled “Returns”void
void
Also the node will not get re-connected again.
Example
Section titled “Example”player.node.disconnect("Forcefully disconnect the connection to the node.");Inherited from
Section titled “Inherited from”fetchAllPlayers()
Section titled “fetchAllPlayers()”fetchAllPlayers(): Promise< | InvalidLavalinkRestRequest| LavalinkPlayer[]>;Defined in: src/structures/Node.ts:862
Gets all Players of a Node
Returns
Section titled “Returns”Promise<
| InvalidLavalinkRestRequest
| LavalinkPlayer[]>
array of players inside of lavalink
Example
Section titled “Example”const node = lavalink.nodes.get("NODEID");const playersOfLavalink = await node?.fetchAllPlayers();Inherited from
Section titled “Inherited from”fetchConnectionMetrics()
Section titled “fetchConnectionMetrics()”fetchConnectionMetrics(): Promise<NodeLinkConnectionMetrics>;Defined in: src/structures/Node.ts:1116
Request NodeLink connection metrics. https://nodelink.js.org/docs/differences#connection-metrics
Returns
Section titled “Returns”Promise<NodeLinkConnectionMetrics>
the connection metrics of the node
Example
Section titled “Example”const connectionMetrics = await player.node.fetchConnectionMetrics();Inherited from
Section titled “Inherited from”LavalinkNode.fetchConnectionMetrics
fetchInfo()
Section titled “fetchInfo()”fetchInfo(): Promise<LavalinkInfo>;Defined in: src/structures/Node.ts:1155
Request Lavalink information.
Returns
Section titled “Returns”Promise<LavalinkInfo>
lavalink info object
Example
Section titled “Example”const lavalinkInfo = await player.node.fetchInfo();const availablePlugins:string[] = lavalinkInfo.plugins.map(plugin => plugin.name);const availableSources:string[] = lavalinkInfo.sourceManagers;Inherited from
Section titled “Inherited from”fetchPlayer()
Section titled “fetchPlayer()”fetchPlayer(guildId: string): Promise< | LavalinkPlayer| InvalidLavalinkRestRequest>;Defined in: src/structures/Node.ts:881
Gets specific Player Information
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
guildId | string |
Returns
Section titled “Returns”Promise<
| LavalinkPlayer
| InvalidLavalinkRestRequest>
lavalink player object if player exists on lavalink
Example
Section titled “Example”const node = lavalink.nodes.get("NODEID");const playerInformation = await node?.fetchPlayer("guildId");Inherited from
Section titled “Inherited from”fetchStats()
Section titled “fetchStats()”fetchStats(): Promise<BaseNodeStats>;Defined in: src/structures/Node.ts:1103
Request Lavalink statistics.
Returns
Section titled “Returns”Promise<BaseNodeStats>
the lavalink node stats
Example
Section titled “Example”const lavalinkStats = await player.node.fetchStats();Inherited from
Section titled “Inherited from”fetchVersion()
Section titled “fetchVersion()”fetchVersion(): Promise<string>;Defined in: src/structures/Node.ts:1133
Request Lavalink version.
Returns
Section titled “Returns”Promise<string>
the current used lavalink version
Example
Section titled “Example”const lavalinkVersion = await player.node.fetchVersion();Inherited from
Section titled “Inherited from”getChapters()
Section titled “getChapters()”getChapters(player: Player, track?: | UnresolvedTrack| Track): Promise<NodeLinkChapter[]>;Defined in: src/structures/NodeLink.ts:251
Retrieve Chapters of Youtube Videos.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
player | Player | The Player you use with that node. |
track? | | UnresolvedTrack | Track | if not provided, it will use the current track |
Returns
Section titled “Returns”Promise<NodeLinkChapter[]>
Array of NodeLinkChapter objects (if empty than there are no chapters available)
getConnectionMetrics()
Section titled “getConnectionMetrics()”getConnectionMetrics(): Promise<ConnectionMetricsResponse>;Defined in: src/structures/NodeLink.ts:267
Returns
Section titled “Returns”Promise<ConnectionMetricsResponse>
getDirectStream()
Section titled “getDirectStream()”getDirectStream(track: | UnresolvedTrack| Track): Promise<DirectStreamResponse>;Defined in: src/structures/NodeLink.ts:277
Stream audio directly from NodeLink without Discord voice connection. | Note this must be enabled by NodeLink…
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
track | | UnresolvedTrack | Track |
Returns
Section titled “Returns”Promise<DirectStreamResponse>
getHealthStatus()
Section titled “getHealthStatus()”getHealthStatus(thresholds?: HealthStatusThresholdOptions): HealthStatusObject;Defined in: src/structures/Node.ts:1206
Get the node’s health status with performance assessment.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
thresholds? | HealthStatusThresholdOptions |
Returns
Section titled “Returns”Object containing health status, performance rating, load balancing info, and recommendations
Example
Section titled “Example”const health = node.getHealthStatus();console.log(`Node Status: ${health.status}`); // "healthy" | "degraded" | "critical" | "offline"console.log(`Performance: ${health.performance}`); // "excellent" | "good" | "fair" | "poor"console.log(`Penalty Score: ${health.penaltyScore}`); // Lower is better for load balancingconsole.log(`Estimated Capacity: ${health.estimatedRemainingCapacity} more players`);console.log(`Overloaded: ${health.isOverloaded}`);console.log(`Needs Restart: ${health.needsRestart}`);if (health.recommendations.length) { console.log("Recommendations:", health.recommendations);}Inherited from
Section titled “Inherited from”getSponsorBlock()
Section titled “getSponsorBlock()”getSponsorBlock(player: Player): Promise<SponsorBlockSegment[]>;Defined in: src/structures/Node.ts:2165
Get the current sponsorblocks for the sponsorblock plugin
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
player | Player | passthrough the player |
Returns
Section titled “Returns”Promise<SponsorBlockSegment[]>
sponsorblock seggment from lavalink
Example
Section titled “Example”// use it on the player via player.getSponsorBlock();const sponsorBlockSegments = await player.node.getSponsorBlock(player);Inherited from
Section titled “Inherited from”getYoutubeConfig()
Section titled “getYoutubeConfig()”getYoutubeConfig(validate?: boolean): Promise<{ isConfigured: boolean; isValid: boolean; refreshToken: string; visitorData: string;}>;Defined in: src/structures/NodeLink.ts:357
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
validate | boolean | false |
Returns
Section titled “Returns”Promise<{
isConfigured: boolean;
isValid: boolean;
refreshToken: string;
visitorData: string;
}>
getYoutubeOAUTH()
Section titled “getYoutubeOAUTH()”getYoutubeOAUTH(refreshToken: string): Promise<YoutubeOAuthResponse>;Defined in: src/structures/NodeLink.ts:375
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
refreshToken | string |
Returns
Section titled “Returns”Promise<YoutubeOAuthResponse>
isLavalinkNode()
Section titled “isLavalinkNode()”isLavalinkNode(): this is LavalinkNode;Defined in: src/structures/Node.ts:1485
Checks if the node is a Lavalink node
Returns
Section titled “Returns”this is LavalinkNode
true if the node is a Lavalink node
Inherited from
Section titled “Inherited from”isNodeLink()
Section titled “isNodeLink()”isNodeLink(): this is NodeLinkNode;Defined in: src/structures/Node.ts:1477
Checks if the node is a NodeLink node
Returns
Section titled “Returns”this is NodeLinkNode
true if the node is a NodeLink node
Inherited from
Section titled “Inherited from”lavaSearch()
Section titled “lavaSearch()”lavaSearch( query: LavaSearchQuery, requestUser: unknown, throwOnEmpty?: boolean): Promise< | LavaSearchResponse| SearchResult>;Defined in: src/structures/Node.ts:490
Search something using the lavaSearchPlugin (filtered searches by types)
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
query | LavaSearchQuery | undefined | LavaSearchQuery Object |
requestUser | unknown | undefined | Request User for creating the player(s) |
throwOnEmpty | boolean | false | Wether to throw on an empty result or not |
Returns
Section titled “Returns”Promise<
| LavaSearchResponse
| SearchResult>
LavaSearchresult (SearchResult if link is provided)
Example
Section titled “Example”// use player.search() insteadplayer.node.lavaSearch({ types: ["playlist", "album"], query: "Rick Astley", source: "spotify" }, interaction.user);Inherited from
Section titled “Inherited from”listMixerLayers()
Section titled “listMixerLayers()”listMixerLayers(player: Player): Promise<ListMixerLayersResponse>;Defined in: src/structures/NodeLink.ts:67
Retrieves a list of currently active mix layers.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
player | Player | The player to list the mixer layers for. |
Returns
Section titled “Returns”Promise<ListMixerLayersResponse>
documentiation
loadDirectStream()
Section titled “loadDirectStream()”loadDirectStream( track: | UnresolvedTrack | Track, volume: number, position: number,filters: string | object): Promise<ReadableStream<any>>;Defined in: src/structures/NodeLink.ts:292
Stream raw PCM audio for custom processing or recording.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
track | | UnresolvedTrack | Track | The track to stream |
volume | number | The volume to stream at |
position | number | The position to stream from |
filters | string | object | The filters to apply to the stream |
Returns
Section titled “Returns”Promise<ReadableStream<any>>
Returns a raw PCM stream with Content-Type: audio/l16;rate=48000;channels=2.
nodeLinkLyrics()
Section titled “nodeLinkLyrics()”nodeLinkLyrics( player: Player, track?: | UnresolvedTrack | Track, language?: string): Promise< | NodeLinkLyrics| NodeLinkNoLyrics>;Defined in: src/structures/NodeLink.ts:228
Retrieve Lyrics of Youtube Videos.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
player | Player | undefined | The Player you use with that node. |
track? | | UnresolvedTrack | Track | undefined | if not provided, it will use the current track |
language? | string | "en" | if not provided, it will use the default language (en) |
Returns
Section titled “Returns”Promise<
| NodeLinkLyrics
| NodeLinkNoLyrics>
NodeLinkLyrics either synced/unsynced or NodeLinkNoLyrics
nodeMetricSummary()
Section titled “nodeMetricSummary()”nodeMetricSummary(): NodeMetricSummary;Defined in: src/structures/Node.ts:1163
Returns the metric summary of the node
Returns
Section titled “Returns”the metric summary of the node
Inherited from
Section titled “Inherited from”LavalinkNode.nodeMetricSummary
rawRequest()
Section titled “rawRequest()”rawRequest(endpoint: string, modify?: ModifyRequest): Promise<{ options: RequestInit & object; response: Response;}>;Defined in: src/structures/Node.ts:272
Raw Request util function
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
endpoint | string | endpoint string |
modify? | ModifyRequest | modify the request |
Returns
Section titled “Returns”Promise<{
options: RequestInit & object;
response: Response;
}>
object containing request and option information
Example
Section titled “Example”player.node.rawRequest(`/loadtracks?identifier=Never gonna give you up`, (options) => options.method = "GET");Inherited from
Section titled “Inherited from”removeMixerLayer()
Section titled “removeMixerLayer()”removeMixerLayer(player: Player, mixId: string): Promise<boolean>;Defined in: src/structures/NodeLink.ts:98
Removes a specific mix layer.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
player | Player | The player to remove the mix layer from. |
mixId | string | The ID of the mix layer to remove. |
Returns
Section titled “Returns”Promise<boolean>
documentiation
request()
Section titled “request()”Call Signature
Section titled “Call Signature”request( endpoint: string, modify: ModifyRequest,parseAsText: true): Promise<string>;Defined in: src/structures/Node.ts:325
Makes an API call to the Node. Should only be used for manual parsing like for not supported plugins
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
endpoint | string | The endpoint that we will make the call to |
modify | ModifyRequest | Used to modify the request before being sent |
parseAsText | true | - |
Returns
Section titled “Returns”Promise<string>
The returned data
Example
Section titled “Example”player.node.request(`/loadtracks?identifier=Never gonna give you up`, (options) => options.method = "GET", false);Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”request( endpoint: string, modify?: ModifyRequest,parseAsText?: false): Promise<any>;Defined in: src/structures/Node.ts:326
Makes an API call to the Node. Should only be used for manual parsing like for not supported plugins
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
endpoint | string | The endpoint that we will make the call to |
modify? | ModifyRequest | Used to modify the request before being sent |
parseAsText? | false | - |
Returns
Section titled “Returns”Promise<any>
The returned data
Example
Section titled “Example”player.node.request(`/loadtracks?identifier=Never gonna give you up`, (options) => options.method = "GET", false);Inherited from
Section titled “Inherited from”search()
Section titled “search()”search( query: SearchQuery, requestUser: unknown,throwOnEmpty?: boolean): Promise<SearchResult>;Defined in: src/structures/Node.ts:358
Search something raw on the node, please note only add tracks to players of that node
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
query | SearchQuery | undefined | SearchQuery Object |
requestUser | unknown | undefined | Request User for creating the player(s) |
throwOnEmpty | boolean | false | Wether to throw on an empty result or not |
Returns
Section titled “Returns”Promise<SearchResult>
Searchresult
Example
Section titled “Example”// use player.search() insteadplayer.node.search({ query: "Never gonna give you up by Rick Astley", source: "soundcloud" }, interaction.user);player.node.search({ query: "https://deezer.com/track/123456789" }, interaction.user);Inherited from
Section titled “Inherited from”setSponsorBlock()
Section titled “setSponsorBlock()”setSponsorBlock(player: Player, segments?: SponsorBlockSegment[]): Promise<void>;Defined in: src/structures/Node.ts:2186
Set the current sponsorblocks for the sponsorblock plugin
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
player | Player | passthrough the player |
segments | SponsorBlockSegment[] | - |
Returns
Section titled “Returns”Promise<void>
void
Example
Section titled “Example”// use it on the player via player.setSponsorBlock();const sponsorBlockSegments = await player.node.setSponsorBlock(player, ["sponsor", "selfpromo"]);Inherited from
Section titled “Inherited from”updateMixerLayerVolume()
Section titled “updateMixerLayerVolume()”updateMixerLayerVolume( player: Player, mixId: string,volume: number): Promise<boolean>;Defined in: src/structures/NodeLink.ts:81
Updates the volume of a specific mix layer.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
player | Player | The player to update the mixer layer volume for. |
mixId | string | The ID of the mix layer to update. |
volume | number | The volume of the mix layer to update. (0 - 100) |
Returns
Section titled “Returns”Promise<boolean>
documentiation
updatePlayer()
Section titled “updatePlayer()”updatePlayer(data: PlayerUpdateInfo): Promise<LavalinkPlayer>;Defined in: src/structures/Node.ts:566
Update the Player State on the Lavalink Server
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
data | PlayerUpdateInfo | data to send to lavalink and sync locally |
Returns
Section titled “Returns”Promise<LavalinkPlayer>
result from lavalink
Example
Section titled “Example”// use player.search() insteadplayer.node.updatePlayer({ guildId: player.guildId, playerOptions: { paused: true } }); // example to pause itInherited from
Section titled “Inherited from”updateSession()
Section titled “updateSession()”updateSession(resuming?: boolean, timeout?: number): Promise< | InvalidLavalinkRestRequest| Session>;Defined in: src/structures/Node.ts:900
Updates the session with and enables/disables resuming and timeout
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
resuming? | boolean | Whether resuming is enabled for this session or not |
timeout? | number | The timeout in seconds (default is 60s) |
Returns
Section titled “Returns”Promise<
| InvalidLavalinkRestRequest
| Session>
the result of the request
Example
Section titled “Example”const node = player.node || lavalink.nodes.get("NODEID");await node?.updateSession(true, 180e3); // will enable resuming for 180secondsInherited from
Section titled “Inherited from”updateYoutubeConfig()
Section titled “updateYoutubeConfig()”updateYoutubeConfig(refreshToken?: string, visitorData?: string): Promise<any>;Defined in: src/structures/NodeLink.ts:340
Updates the YouTube configuration (RefreshToken or VisitorData) in real-time.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
refreshToken? | string |
visitorData? | string |
Returns
Section titled “Returns”Promise<any>
updateYoutubeOAUTH()
Section titled “updateYoutubeOAUTH()”updateYoutubeOAUTH(refreshToken: string): Promise<YoutubeOAuthResponse>;Defined in: src/structures/NodeLink.ts:386
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
refreshToken | string |
Returns
Section titled “Returns”Promise<YoutubeOAuthResponse>