Node
Represents a connected Lavalink v4 or NodeLink server. The same class handles both backends; native helpers require a connected NodeLink node.
Signatures below match the public source surface in 2.10.5. Use manager/player factories for ordinary application setup.
Constructor
constructor(
public manager: Manager,
public options: NodeOptions
);
Properties
Methods
loadSessionIds
public async loadSessionIds(): Promise<void>;
Loads session IDs from the sessionIds.json file if it exists.
updateSessionId
public async updateSessionId(): Promise<void>;
Updates the session ID in the sessionIds.json file.
connect
public async connect(): Promise<void>;
Connects to the Node.
destroy
public async destroy(): Promise<void>;
Destroys the node and cleans up associated resources.
trackEnd
public async trackEnd(player: Player, track: Track, payload: TrackEndEvent): Promise<void>;
Internal playback event handler. Applications normally consume the manager's trackEnd callback instead of invoking this.
queueEnd
public async queueEnd(player: Player, track: Track, payload: TrackEndEvent): Promise<void>;
Internal queue-end/autoplay handler. Applications normally consume the manager's queueEnd callback.
getLyrics
public async getLyrics(track: Track, skipTrackSource: boolean = false, language?: string): Promise<Lyrics | NodeLinkGetLyrics>;
Loads supported Lavalink-plugin lyrics or native NodeLink lyrics. On NodeLink, the optional language is sent to the native endpoint.
getChapters
public async getChapters(track: Track): Promise<NodeLinkChapter[]>;
Loads chapters for a track using NodeLink.
getNodeLinkChapters
public async getNodeLinkChapters(track: Track): Promise<NodeLinkChapter[]>;
Loads chapters for a track using NodeLink.
getNodeLinkMeaning
public async getNodeLinkMeaning(track: Track, language: string = "en"): Promise<NodeLinkMeaningResult>;
Loads NodeLink meaning/background information for a track.
lyricsSubscribe
public async lyricsSubscribe(guildId: string, skipTrackSource: boolean = false): Promise<unknown>;
Subscribes to lyrics for a player.
lyricsUnsubscribe
public async lyricsUnsubscribe(guildId: string): Promise<unknown>;
Unsubscribes from lyrics for a player.
fetchInfo
public async fetchInfo(): Promise<LavalinkInfo>;
Fetches Lavalink node information.
getSponsorBlock
public async getSponsorBlock(player: Player): Promise<SponsorBlockSegment[]>;
Returns configured SponsorBlock categories, not detailed segment objects. Uses the supported Lavalink plugin or native NodeLink settings.
getNodeLinkSponsorBlockState
public async getNodeLinkSponsorBlockState(player: Player): Promise<NodeLinkSponsorBlockState>;
Returns the complete NodeLink SponsorBlock state for a player.
updateNodeLinkSponsorBlock
public async updateNodeLinkSponsorBlock(player: Player, update: NodeLinkSponsorBlockUpdate): Promise<NodeLinkSponsorBlockState>;
Updates NodeLink SponsorBlock behavior for a player.
setNodeLinkSponsorBlockSegments
public async setNodeLinkSponsorBlockSegments(player: Player, segments: NodeLinkSponsorBlockSegment[]): Promise<NodeLinkSponsorBlockState>;
Replaces the NodeLink SponsorBlock segment list for a player.
addMix
public async addMix(player: Player, track: Track, volume?: number): Promise<NodeLinkMix>;
Adds a NodeLink audio mix layer to the player.
addNodeLinkMix
public async addNodeLinkMix(player: Player, track: Track, volume?: number): Promise<NodeLinkMix>;
Adds a NodeLink audio mix layer to the player.
getMixes
public async getMixes(player: Player): Promise<NodeLinkMix[]>;
Gets the active NodeLink audio mix layers for the player.
getNodeLinkMixes
public async getNodeLinkMixes(player: Player): Promise<NodeLinkMix[]>;
Gets the active NodeLink audio mix layers for the player.
updateMix
public async updateMix(player: Player, mixId: string, volume: number): Promise<void>;
Updates a NodeLink audio mix layer volume.
updateNodeLinkMix
public async updateNodeLinkMix(player: Player, mixId: string, volume: number): Promise<void>;
Updates a NodeLink audio mix layer volume.
removeMix
public async removeMix(player: Player, mixId: string): Promise<void>;
Removes a NodeLink audio mix layer.
removeNodeLinkMix
public async removeNodeLinkMix(player: Player, mixId: string): Promise<void>;
Removes a NodeLink audio mix layer.
setSponsorBlock
public async setSponsorBlock(player: Player, segments: SponsorBlockSegment[] = [SponsorBlockSegment.Sponsor, SponsorBlockSegment.SelfPromo]): Promise<void>;
Sets the sponsorblock segments for a player.
deleteSponsorBlock
public async deleteSponsorBlock(player: Player): Promise<void>;
Deletes the sponsorblock segments for a player.