Constructor
new EventManager(client, options)
The constructor of the EventManager class.
Parameters:
Name | Type | Description |
---|---|---|
client | Client | The client |
options | EventManagerOptions | The options of the event manager |
- Source
Extends
- EventEmitter
Members
cache :Collection.<String, Event>
The cache with all Events
Type:
- Collection.
<String, Event>
- Source
client :Client
The client.
Type:
- Client
- Source
options :EventManagerOptions
The options of the EventManager.
Type:
- Source
Methods
load(path) → {Promise.<(Boolean|DisGroupDevError)>}
Loads an event
Parameters:
Name | Type | Description |
---|---|---|
path | String | The full path of the event |
- Source
Returns:
- Type:
- Promise.
<(Boolean| DisGroupDevError)>
loadAll() → {Promise.<(Boolean|DisGroupDevError)>}
Loads all events
- Source
Returns:
- Type:
- Promise.
<(Boolean| DisGroupDevError)>
reload(name) → {Promise.<(Boolean|DisGroupDevError)>}
Reloads an event
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the command |
- Source
Returns:
- Type:
- Promise.
<(Boolean| DisGroupDevError)>
reloadAll() → {Promise.<(Boolean|DisGroupDevError)>}
Reloads all events
- Source
Returns:
- Type:
- Promise.
<(Boolean| DisGroupDevError)>
unload(name) → {Promise.<(Boolean|DisGroupDevError)>}
Unloads an event
Parameters:
Name | Type | Description |
---|---|---|
name | String | THe name of the event |
- Source
Returns:
- Type:
- Promise.
<(Boolean| DisGroupDevError)>
unloadAll() → {Promise.<(Boolean|DisGroupDevError)>}
Unloads all loaded events
- Source
Returns:
- Type:
- Promise.
<(Boolean| DisGroupDevError)>
Events
eventLoad
Emitted when an event is loaded.
Parameters:
Name | Type | Description |
---|---|---|
eventFile | Event |
- Source
eventReload
Emitted when an event is reloaded.
Parameters:
Type | Description |
---|---|
Event |
- Source
eventUnload
Emitted when an event is unloaded.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the event |
- Source