ManagerUtils

Utils you can use on the Manager side, for Tracks and other things!

ype: class

Constructor

new LavalinkManager(options:ManagerOptions)

Import

index.ts
import { ManagerUtils } from "lavalink-client";

Overview


Properties

.LavalinkManager

The provided Manager

Type: LavalinkManager | null

Methods

.buildTrack(data: LavalinkTrack|Track, requester:any)

Builds a Lavalink Track Response to a Client-Track.

If no Manager was proivided to the Util Manager, then manager#playerOptions#requestTransformer can't be used.

Returns: Track

.buildUnresolvedTrack(data:UnresolvedQuery|UnresolvedTrack, requester:any)

Builds an unresolved Track of a UnresolvedQuery / Track.

If no Manager was proivided to the Util Manager, then manager#playerOptions#requestTransformer can't be used.

Returns: UnresolvedTrack

.isNode(data:LavalinkNode)

Checks if provided data is a Lavalink Node.

Returns: boolean

.isNodeOptions(data:LavalinkNodeOptions)

Checks if provided data is a Lavalink Node Options Object.

Returns: boolean

.isTrack(data:Track)

Checks if provided data is a Client Track Object.

Returns: boolean

.isUnresolvedTrack(data:UnresolvedTrack)

Checks if provided data is a Client UnresolvedTrack Object.

Returns: boolean

.isUnresolvedTrackQuery(data:UnresolvedQuery)

Checks if provided data is a UnresolvedQuery Object.

Returns: boolean

.getClosestTrack(data:UnresolvedTrack, player: Player)

Try's to find the Closest Track possible of an unresovled Track

if Unresolved track has encoded: it will try to decode it

If unresolved Track has uri / isrc it will try to search by that

Returns: Promise<Track | undefined>

.validateQueryString(node: LavalinkNode, data:string)

Checks if the query string contains a link and checks the followings:

  • If its source is enabled on the provided node

  • If managerOptions#validLinks is provided, it also checks for those

Returns: boolean

.validateSourceString(node: LavalinkNode, data:SearchPlatform)

Checks if SearchPlatform is useable, by checking if the source is enabled on the provided node

Returns: boolean

Last updated