Class: SettingsManager

SettingsManager()

Handles Guild Specific Settings

Constructor

new SettingsManager()

Source:

Members

defaults :object

Default values for settings. Do not touch either.
Type:
  • object
Source:

globals :object

Global defaults. Useful to override defaults without having to change the schema.
Type:
  • object
Source:

overrides :object

Like globals, but forced.
Type:
  • object
Source:

schema :object

Settings Schema. DO NOT MODIFY THIS DIRECTLY. Use the .register() and .unregister() methods instead.
Type:
  • object
Source:

Methods

(async) getForGuild(guild)

Gets all the parameters from a guild
Parameters:
Name Type Description
guild Discord.Guild
Source:

(async) getGuildParam(guild, key)

Gets a specific parameter from a guild
Parameters:
Name Type Description
guild Discord.Guild
key string
Source:

register(key, params)

Registers a setting parameter to the schema.
Parameters:
Name Type Description
key string Key of the parameter
params object Parameters
Properties
Name Type Description
type * Type of the parameter (Boolean, String, Number, etc)
def * Default value of the parameter.
min number For numbers, it specifies the minimum value, for strings, the minimum length.
max number Same as above, but it specifies the maximum value or length.
integer boolean For the "number" type, only accept integers.
Source:

unregister(key)

Unregisters a setting parameter from the schema.
Parameters:
Name Type Description
key string Key to remove
Source:

validateType(type)

Checks if a type is valid.
Parameters:
Name Type Description
type *
Source: