Util

Util

Class for utility functions.

Constructor

# new Util()

Source:

Methods

# (static) arrayToConsoleList(array, prependopt) → {string}

Turn an array into a list-esque string, normally to be printed to the console.

Parameters:
Name Type Attributes Description
array Array

An array of things to print.

prepend string <optional>

A string to add to the beginning of every line.

Source:
Returns:

A list of the array's contents formatted to be printed to the console as a list.

Type
string
Example
// Print a list of commands to the console.

console.log(arrayToConsoleList(["help", "ping"]));
// Would print:
// ├ help
// └ ping

# (static) ownerCheck(client, user) → {Boolean}

Check if a user is an owner.

Parameters:
Name Type Description
client Object

The Discord client.

user module:discord.js~Snowflake

The user ID to check.

Source:
Returns:

True/false depending on whether the user is a dev/owner.

Type
Boolean

# (static) walk(dir, extopt) → {Array.<String>}

Loop through all subfolders of a folder and return the paths of all files with a specified file extension.

Parameters:
Name Type Attributes Default Description
dir String

The directory to scan.

ext String <optional>
js

The extension of the files to find.

Source:
Returns:

The file paths of the files found in the directory provided with the extension provided.

Type
Array.<String>