new InhibitorStore(client)
Constructs our InhibitorStore for use in Klasa
Parameters:
Name | Type | Description |
---|---|---|
client |
KlasaClient | The Klasa Client |
- Since:
-
- 0.0.1
- Implements:
- Source:
- lib/structures/InhibitorStore.js#L18
Extends
Properties
-
<readonly> client :KlasaClient
-
The client this InhibitorStore was created with.
Type:
- Since:
-
- 0.0.1
- Source:
- lib/structures/InhibitorStore.js#L21
-
coreDir :String
-
The directory of inhibitors in Klasa relative to where its installed.
Type:
- String
- Since:
-
- 0.0.1
- Source:
- lib/structures/InhibitorStore.js#L35
-
holds :Inhibitor
-
The type of structure this store holds
Type:
- Since:
-
- 0.1.1
- Source:
- lib/structures/InhibitorStore.js#L49
-
name :String
-
The name of what this holds
Type:
- String
- Since:
-
- 0.3.0
- Source:
- lib/structures/InhibitorStore.js#L56
-
userDir :String
-
The directory of local inhibitors relative to where you run Klasa from.
Type:
- String
- Since:
-
- 0.0.1
- Source:
- lib/structures/InhibitorStore.js#L42
Methods
-
delete(name)
-
Deletes a inhibitor from the store
Parameters:
Name Type Description name
Inhibitor | string The inhibitor object or a string representing the structure this store caches - Since:
-
- 0.0.1
- Source:
- lib/structures/InhibitorStore.js#L65
Returns:
whether or not the delete was successful.- Type
- boolean
-
init()
-
Initializes all pieces in this store.
- Since:
-
- 0.0.1
- Implements:
- Source:
- lib/structures/interfaces/Store.js#L22
Returns:
- Type
- Array
-
load(dir, file)
-
Loads a piece into Klasa so it can be saved in this store.
Parameters:
Name Type Description dir
string The user directory or core directory where this file is saved. file
string | Array.<string> A string or array of strings showing where the file is located. - Since:
-
- 0.0.1
- Implements:
- Source:
- lib/structures/interfaces/Store.js#L33
Returns:
- Type
- Piece
-
<async> loadAll()
-
Loads all of our pieces from both the user and core directories.
- Since:
-
- 0.0.1
- Implements:
- Source:
- lib/structures/interfaces/Store.js#L51
Returns:
The number of pieces loaded.- Type
- number
-
resolve(name)
-
Resolve a string or piece into a piece object.
Parameters:
Name Type Description name
Piece | string The piece object or a string representing a piece's name - Since:
-
- 0.0.1
- Implements:
- Source:
- lib/structures/interfaces/Store.js#L68
Returns:
- Type
- Piece
-
<async> run(msg, cmd [, selective])
-
Runs our inhibitors on the command.
Parameters:
Name Type Argument Default Description msg
external:Message The message object from Discord.js cmd
Command The command being ran. selective
boolean <optional>
false Whether or not we should ignore certain inhibitors to prevent spam. - Since:
-
- 0.0.1
- Source:
- lib/structures/InhibitorStore.js#L80
Returns:
- Type
- void
-
set(inhibitor)
-
Sets up a inhibitor in our store.
Parameters:
Name Type Description inhibitor
Inhibitor The inhibitor object we are setting up. - Since:
-
- 0.0.1
- Source:
- lib/structures/InhibitorStore.js#L95
Returns:
- Type
- Inhibitor