Documentation
Classes
discord-player
Util

Util

new Util()

Methods

public static buildTimeCode(duration): string

Builds time code

ParameterTypeOptionalDescription
durationTimeData❌The duration object

public static durationString(durObj): string

Creates duration string

ParameterTypeOptionalDescription
durObjRecord<string, number>❌The duration object

public static getFetch(): Promise<any>

public static import(id): Promise<{ error: null,module: any } | { error: unknown,module: null }>

ParameterTypeOptionalDescription
idstring❌-

public static isVoiceEmpty(channel): boolean

Checks if the voice channel is empty

ParameterTypeOptionalDescription
channelStageChannel | VoiceChannel❌The voice channel

public static last(arr): T

Picks last item of the given array

ParameterTypeOptionalDescription
arrArray<T>❌The array

public static noop(): void

public static parseMS(milliseconds): TimeData

Parses milliseconds to consumable time object

ParameterTypeOptionalDescription
millisecondsnumber❌The time in ms

public static require(id): { error: null,module: any } | { error: unknown,module: null }

Safer require

ParameterTypeOptionalDescription
idstring❌Node require id

public static wait(time): Promise<undefined>

Asynchronous timeout

ParameterTypeOptionalDescription
timenumber❌The time in ms to wait

public static warn(message, code, detail?): void

ParameterTypeOptionalDescription
messagestring❌-
codestring❌-
detailstringβœ…-