Client Utils

This is a general list of most of the added functionality to the "CDClient" client by CDCommands. This is not a complete list, but most of the properties/methods that exist on the client that aren't mentioned here don't need to be messed with.

#getLanguage()

This basic method accepts one parameter as an object with a users ID and guild ID, which will return the corresponding language to be used. If neither the guild or user have a language set, "en" is used and returned by default. This method doesn't really need to be used, as most of the place that you would need it, the language is passed to.

#databaseCache()

The database cache is a system created for the models and documents that are required for CDCommands to function correctly, this allows us to cache database information, allowing us to fetch it faster and call the database less. The database is updated every x amount of time, specified by the "cacheUpdateSpeed" property. This is not normally needed for end user use, but is there if you need it. (It is recommended to use this instead of requiring the models from the module)

#defaultResponses

This is talked about in more detail under Default Responses. This property allows you to set up a message.json file and use responses from the file, allowing you to set up a multi-lingual bot. The property allows for easy fetching and replacing of values in the response.

Note: The below methods have no functionality other than returning a MessageEmbed as a convenience method.

#load()

The load method will return a message #00DCFF color and the description set to the provided string.

#error()

The error method will return a message #C93131 color and the description set to the provided string.

#success()

The success method will return a message #2FDD2C color and the description set to the provided string.

#info()

The info method will return a message #00DCFF color and the description set to the provided string.

Note: The below methods provide no functionality other than logging messages to your terminal with adjusted colors.

#logReady()

The logReady method will log your message with an appended "[READY]" at the start of your message colored in green.

#logInfo()

The logInfo method will log your message with an appended "[INFO]" at the start of your message colored in cyan.

#logError()

The logError method will log your message with an appended "[ERROR]" at the start of your message colored in red.

#logWarn()

The logWarn method will log your message with an appended "[WARN]" at the start of your message colored in yellow.

#logDatabase()

The logDatabase method will log your message with an appended "[DATABASE]" at the start of your message colored in green.