QuackJSUtils

Namespaces

  • Discord

Classes

  • HTML

Variables

Variables

Variables: Record<string, any> = {}

Defined in

src/handlers/variables.ts:1

Functions

Backup

Const Backup(file): void

A function for generating a backup of a file.

Parameters

NameTypeDescription

file

string

The file that will be backed up.

Returns

void

Defined in

src/modules/functions.ts:155


Color

Const Color(color): number

A function for converting any color variation to an base 10 number.

Parameters

NameTypeDescription

color

string

The color to be parsed.

Returns

number

The number version of color.

Defined in

src/handlers/color.ts:9


Debug

Const Debug(obj, name?): void

A function for debugging Functions or Objects

Parameters

NameTypeDefault valueDescription

obj

Object | Function

undefined

The object/function to be tested.

name

string

'none'

The name of the debug call.

Returns

void

Defined in

src/modules/log.ts:35


Emoji

Const Emoji(e): string

A function for grabbing the id of a custom emoji.

Parameters

NameTypeDescription

e

string

The emoji to be parsed.

Returns

string

The string representation of the emoji.

Defined in

src/modules/functions.ts:146


Exception

Const Exception(e): void

A function for handling errors.

Parameters

NameTypeDescription

e

Error

The error to be processed.

Returns

void

Defined in

src/modules/functions.ts:37


GenerateID

Const GenerateID(length?, base?): string

A function for generating a random id.

Parameters

NameTypeDefault valueDescription

length

number

8

The length for which the id will be.

base

number

16

The base for which the id will be.

Returns

string

Returns a random id with a base of base and length of length.

Defined in

src/modules/functions.ts:127


GetFiles

Const GetFiles(directory): string[]

A function for grabbing all of the files in a directory.

Parameters

NameTypeDescription

directory

string

The directory to be scanned.

Returns

string[]

All of the files' paths in a directory.

Defined in

src/modules/functions.ts:48


Locale

Const Locale(): Object

A function for grabbing the language file.

Returns

Object

The locale of given location if it is created under locales.ts.

NameType

commands

Object

commands.errors

Object

commands.errors.creation

string

commands.errors.execution

string

commands.errors.names

string

discord

Object

discord.errors

Object

discord.errors.category

string

discord.errors.channel

string

discord.errors.emoji

string

discord.errors.role

string

utils

Object

utils.errors

Object

utils.errors.error

string

utils.success

Object

utils.success.backup

string

Defined in

src/handlers/locale.ts:11


Log

Const Log(message, type?): void

A function for logging a specific message.

Parameters

NameTypeDefault valueDescription

message

string

undefined

The message to be logged.

type

"i" | "e" | "s" | "w" | "d"

'i'

The type of log.

Returns

void

Defined in

src/modules/log.ts:11


MS

Const MS(value, options?): string

Parameters

NameType

value

number

options?

Object

options.long

boolean

Returns

string

Defined in

src/modules/functions.ts:164

Const MS(value): number

Parameters

NameType

value

string

Returns

number

Defined in

src/modules/functions.ts:164


MkDir

Const MkDir(name): boolean

A function for creating directories.

Parameters

NameTypeDescription

name

string

The name of the directory to be made.

Returns

boolean

true if the directory was made, false if the directory was not made.

Defined in

src/modules/functions.ts:72


PadWithZeros

Const PadWithZeros(number, length): string

A function for padding a number with zeros; usefully for ticketing modules.

Parameters

NameTypeDescription

number

number

The number to be parsed.

length

number

The length of which the string should be.

Returns

string

A string with the number and the number of padded zeros in front of it.

Defined in

src/modules/functions.ts:88


Random

Const Random(min, max): number

A function for generating a random number between min and max inclusively.

Parameters

NameTypeDescription

min

number

The minimum amount the function will return.

max

number

The maximum amount the function will return.

Returns

number

A random number between min and max.

Defined in

src/modules/functions.ts:103


RandomizeCapitalization

Const RandomizeCapitalization(string): string

A function for randomly capitalizing a string.

Parameters

NameTypeDescription

string

string

The string to be randomly capitalized.

Returns

string

A string with random capitalization.

Defined in

src/modules/functions.ts:113


Time

Const Time(date?): QuackJSTime

A function which returns an object containing useful time numbers and information.

Parameters

NameTypeDescription

date

Date

The date that will be processed.

Returns

QuackJSTime

An object for time purposes.

Defined in

src/modules/functions.ts:16

Last updated