Util
new Util()
Methods
public static buildTimeCode(duration): string
Builds time code
Parameter | Type | Optional | Description |
---|---|---|---|
duration | TimeData | ❌ | The duration object |
public static durationString(durObj): string
Creates duration string
Parameter | Type | Optional | Description |
---|---|---|---|
durObj | Record<string, number> | ❌ | The duration object |
public static getFetch(): Promise<any>
public static import(id): Promise<{ error: null,module: any } | { error: unknown,module: null }>
Parameter | Type | Optional | Description |
---|---|---|---|
id | string | ❌ | - |
public static isVoiceEmpty(channel): boolean
Checks if the voice channel is empty
Parameter | Type | Optional | Description |
---|---|---|---|
channel | StageChannel | VoiceChannel | ❌ | The voice channel |
public static last(arr): T
Picks last item of the given array
Parameter | Type | Optional | Description |
---|---|---|---|
arr | Array<T> | ❌ | The array |
public static noop(): void
public static parseMS(milliseconds): TimeData
Parses milliseconds to consumable time object
Parameter | Type | Optional | Description |
---|---|---|---|
milliseconds | number | ❌ | The time in ms |
public static require(id): { error: null,module: any } | { error: unknown,module: null }
Safer require
Parameter | Type | Optional | Description |
---|---|---|---|
id | string | ❌ | Node require id |
public static wait(time): Promise<undefined>
Asynchronous timeout
Parameter | Type | Optional | Description |
---|---|---|---|
time | number | ❌ | The time in ms to wait |
public static warn(message, code, detail?): void
Parameter | Type | Optional | Description |
---|---|---|---|
message | string | ❌ | - |
code | string | ❌ | - |
detail | string | ✅ | - |