TrackUtils
Table of Contentsโ
Class Definitionโ
export abstract class TrackUtils {}
Propertiesโ
Property Type Description managerManagerThe Manager instance.
Constructorโ
new TrackUtils(manager: Manager)
Parameter Type Description Optional managerManagerThe Manager instance.
Methodsโ
build()โ
build<T = User | ClientUser>(data: TrackData, requester?: T): TrackBuilds a Track from the raw data from Lavalink and a optional requester.
Parametersโ
Parameter Type Description Optional dataTrackDataThe raw data from Lavalink. requesterUser|ClientUserThe requester. Returnsโ
Type Description Track| undefinedThe first element in the queue, or undefinedif the queue is empty.
init()โ
init(manager: Manager): voidInitializes the TrackUtils instance.
Parametersโ
Parameter Type Description Optional managerManagerThe Manager instance.
isErrorOrEmptySearchResult()โ
isErrorOrEmptySearchResult(result: SearchResult): result is ErrorOrEmptySearchResultChecks if the search result is an error or an empty result.
Parametersโ
Parameter Type Description Optional resultSearchResultThe search result. Returnsโ
Type Description boolean Returns trueif the search result is an error or an empty result.
setTrackPartial()โ
setTrackPartial(partial: TrackPartial[]): voidSets the partial properties for the Track class. If a Track has some of its properties removed by the partial, it will be considered a partial Track.
Parametersโ
Parameter Type Description Optional partialTrackPartial[]The partial data for the track.
validate()โ
validate(trackOrTracks: unknown): booleanChecks if the provided argument is a valid Track or an array of Tracks.
Parametersโ
Parameter Type Description Optional trackOrTracksunknown The track or an array of tracks to validate. Returnsโ
Type Description boolean Returns trueif the provided argument is a valid Track or an array of Tracks.