-
<async> add(key, options [, force])
-
Add a new key to the schema.
Parameters:
Name |
Type |
Argument |
Default |
Description |
key |
string
|
|
|
The key to add. |
options |
AddOptions
|
|
|
Options for the key. |
force |
boolean
|
<optional>
|
true
|
Whether this change should modify all configurations or not. |
- Source:
-
lib/settings/SchemaManager.js#L86
Returns:
-
Type
-
void
Example
// Add a key called 'modlog', being a TextChannel.
SchemaManager.add('modlog', { type: 'TextChannel' });
// Add a key called 'playlist-length', being an Integer with minimum value of 5 and max 20, being 15 by default.
SchemaManager.add('playlist-length', { type: 'Integer', default: 15, min: 5, max: 20 });
-
delete(key)
-
Delete the selected data from the cache by its ID.
Parameters:
Name |
Type |
Description |
key |
string
|
The data's key. |
- Inherited From:
-
- Overrides:
- Source:
-
lib/settings/CacheManager.js#L58
Returns:
-
Type
-
any
-
get(key)
-
Get the data from the cache by its ID.
Parameters:
Name |
Type |
Description |
key |
string
|
The key to search for. |
- Inherited From:
-
- Overrides:
- Source:
-
lib/settings/CacheManager.js#L28
Returns:
-
Type
-
Object
-
getAll()
-
Get all the data from the cache as an array of objects.
- Inherited From:
-
- Overrides:
- Source:
-
lib/settings/CacheManager.js#L37
Returns:
-
Type
-
Array.<Object>
-
<async> initSchema()
-
Initialize the SchemaManager.
- Source:
-
lib/settings/SchemaManager.js#L34
Returns:
-
Type
-
void
-
<async> remove(key [, force])
-
Remove a key from the schema.
Parameters:
Name |
Type |
Argument |
Default |
Description |
key |
string
|
|
|
The key to remove. |
force |
boolean
|
<optional>
|
false
|
Whether this change should modify all configurations or not. |
- Source:
-
lib/settings/SchemaManager.js#L116
Returns:
-
Type
-
void
Example
// Remove a key called 'modlog'.
SchemaManager.remove('modlog');
-
set(key, value)
-
Save a new data to the cache.
Parameters:
Name |
Type |
Description |
key |
string
|
The data's key. |
value |
Object
|
The data's value. |
- Inherited From:
-
- Overrides:
- Source:
-
lib/settings/CacheManager.js#L48
Returns:
-
Type
-
any
-
validateSchema(schema)
-
Validate the Schema manager.
Parameters:
Name |
Type |
Description |
schema |
Object
|
The Schema object that will be used for the configuration system. |
- Source:
-
lib/settings/SchemaManager.js#L48
Returns:
-
Type
-
void