Skip to content

ManagerUtils

Constructors

new ManagerUtils()

new ManagerUtils(LavalinkManager?: LavalinkManager): ManagerUtils

Parameters

ParameterType
LavalinkManager?LavalinkManager

Returns

ManagerUtils

Defined in

src/structures/Utils.ts:46

Properties

PropertyModifierTypeDefault valueDefined in
LavalinkManagerpublicLavalinkManagernullsrc/structures/Utils.ts:45

Methods

buildPluginInfo()

buildPluginInfo(data: any, clientData: any): any

Parameters

ParameterType
dataany
clientDataany

Returns

any

Defined in

src/structures/Utils.ts:50


buildTrack()

buildTrack(data: Track | LavalinkTrack, requester: unknown): Track

Parameters

ParameterType
dataTrack | LavalinkTrack
requesterunknown

Returns

Track

Defined in

src/structures/Utils.ts:57


buildUnresolvedTrack()

buildUnresolvedTrack(query: UnresolvedTrack | UnresolvedQuery, requester: unknown): UnresolvedTrack

Builds a UnresolvedTrack to be resolved before being played .

Parameters

ParameterTypeDescription
queryUnresolvedTrack | UnresolvedQuery
requesterunknown

Returns

UnresolvedTrack

Defined in

src/structures/Utils.ts:111


getClosestTrack()

getClosestTrack(data: UnresolvedTrack, player: Player): Promise<Track>

Parameters

ParameterType
dataUnresolvedTrack
playerPlayer

Returns

Promise<Track>

Defined in

src/structures/Utils.ts:219


getTransformedRequester()

getTransformedRequester(requester: unknown): unknown

Parameters

ParameterType
requesterunknown

Returns

unknown

Defined in

src/structures/Utils.ts:154


isNode()

isNode(data: LavalinkNode): boolean

Validate if a data is equal to a node

Parameters

ParameterTypeDescription
dataLavalinkNode

Returns

boolean

Defined in

src/structures/Utils.ts:144


isNodeOptions()

isNodeOptions(data: LavalinkNodeOptions): boolean

Validate if a data is equal to node options

Parameters

ParameterTypeDescription
dataLavalinkNodeOptions

Returns

boolean

Defined in

src/structures/Utils.ts:175


isTrack()

isTrack(data: UnresolvedTrack | Track): data is Track

Validate if a data is equal to a track

Parameters

ParameterTypeDescription
dataUnresolvedTrack | Trackthe Track to validate

Returns

data is Track

Defined in

src/structures/Utils.ts:195


isUnresolvedTrack()

isUnresolvedTrack(data: UnresolvedTrack | Track): data is UnresolvedTrack

Checks if the provided argument is a valid UnresolvedTrack.

Parameters

ParameterType
dataUnresolvedTrack | Track

Returns

data is UnresolvedTrack

Defined in

src/structures/Utils.ts:205


isUnresolvedTrackQuery()

isUnresolvedTrackQuery(data: UnresolvedQuery): boolean

Checks if the provided argument is a valid UnresolvedTrack.

Parameters

ParameterType
dataUnresolvedQuery

Returns

boolean

Defined in

src/structures/Utils.ts:215


transformLavaSearchQuery()

transformLavaSearchQuery(query: LavaSearchQuery): object

Parameters

ParameterType
queryLavaSearchQuery

Returns

object

NameTypeDefined in
querystringsrc/structures/Utils.ts:335
sourceanysrc/structures/Utils.ts:337
typesstring[]src/structures/Utils.ts:336

Defined in

src/structures/Utils.ts:331


transformQuery()

transformQuery(query: SearchQuery): object

Parameters

ParameterType
querySearchQuery

Returns

object

NameTypeDefined in
extraQueryUrlParamsURLSearchParamssrc/structures/Utils.ts:319
querystringsrc/structures/Utils.ts:318
sourceanysrc/structures/Utils.ts:320

Defined in

src/structures/Utils.ts:315


validateQueryString()

validateQueryString(
node: LavalinkNode,
queryString: string,
sourceString?: LavalinkSearchPlatform): void

Parameters

ParameterType
nodeLavalinkNode
queryStringstring
sourceString?LavalinkSearchPlatform

Returns

void

Defined in

src/structures/Utils.ts:236


validateSourceString()

validateSourceString(node: LavalinkNode, sourceString: SearchPlatform): void

Parameters

ParameterType
nodeLavalinkNode
sourceStringSearchPlatform

Returns

void

Defined in

src/structures/Utils.ts:348