Utils

Utils

Utility class

Constructor

new Utils(client)

Source:

Creates a new Utils instance

Parameters:
Name Type Description
client Client

Client instance

Methods

(static) delay(time) → {Promise}

Source:

Delay Promise

Parameters:
Name Type Description
time Number

Time to delay

Returns:
Type
Promise

(static) getColour(colour) → (nullable) {Number}

Source:

Gets the integer of a colour

Parameters:
Name Type Description
colour String

Hex colour code or name of colour

Returns:
Type
Number

(static) hasRoleHierarchy(member, role) → {Boolean}

Source:

Determines if a member has a role that is higher than the given role

Parameters:
Name Type Description
member external:"Eris.Member"

Member to check

role external:"Eris.Role"

Role to check

Returns:
Type
Boolean

(static) isDir(filename)

Source:

Checks if a path is a directory

Parameters:
Name Type Description
filename String

The path to check

(static) padEnd(Stringopt, lengthopt, charsopt)

Source:

Pads a string on the right if it's shorter than the padding length

Parameters:
Name Type Attributes Default Description
String String <optional>
''

The string to pad

length Number <optional>
0

The padding length

chars String <optional>
' '

The string used as padding

(static) padStart(Stringopt, lengthopt, charsopt)

Source:

Pads a string on the left if it's shorter than the padding length

Parameters:
Name Type Attributes Default Description
String String <optional>
''

The string to pad

length Number <optional>
0

The padding length

chars String <optional>
' '

The string used as padding

(static) parseNumber(num) → {String}

Source:

Format a number with grouped thousands

Parameters:
Name Type Description
num Number

Number to Format

Returns:
Type
String

(static) requireAll(dir) → {Object}

Source:

Reads a directory recursively and returns an object mapping the required files to the folder

Parameters:
Name Type Description
dir String

Directory path

Returns:
Type
Object

(static) requireRecursive(dir) → {Array}

Source:

Reads a directory recursively and returns an array of paths

Parameters:
Name Type Description
dir String

Directory path

Returns:
Type
Array