EventManager

The event manager.

Constructor

new EventManager(client, options)

The constructor of the EventManager class.

Parameters:
NameTypeDescription
clientClient

The client

optionsEventManagerOptions

The options of the event manager

Extends

  • EventEmitter

Members

cache :Collection.<String, Event>

The cache with all Events

Type:
  • Collection.<String, Event>

client :Client

The client.

Type:
  • Client

options :EventManagerOptions

The options of the EventManager.

Methods

load(path) → {Promise.<(Boolean|DisGroupDevError)>}

Loads an event

Parameters:
NameTypeDescription
pathString

The full path of the event

Returns:
Type: 
Promise.<(Boolean|DisGroupDevError)>

loadAll() → {Promise.<(Boolean|DisGroupDevError)>}

Loads all events

Returns:
Type: 
Promise.<(Boolean|DisGroupDevError)>

reload(name) → {Promise.<(Boolean|DisGroupDevError)>}

Reloads an event

Parameters:
NameTypeDescription
nameString

The name of the command

Returns:
Type: 
Promise.<(Boolean|DisGroupDevError)>

reloadAll() → {Promise.<(Boolean|DisGroupDevError)>}

Reloads all events

Returns:
Type: 
Promise.<(Boolean|DisGroupDevError)>

unload(name) → {Promise.<(Boolean|DisGroupDevError)>}

Unloads an event

Parameters:
NameTypeDescription
nameString

THe name of the event

Returns:
Type: 
Promise.<(Boolean|DisGroupDevError)>

unloadAll() → {Promise.<(Boolean|DisGroupDevError)>}

Unloads all loaded events

Returns:
Type: 
Promise.<(Boolean|DisGroupDevError)>

Events

eventLoad

Emitted when an event is loaded.

Parameters:
NameTypeDescription
eventFileEvent

eventReload

Emitted when an event is reloaded.

Parameters:
TypeDescription
Event

eventUnload

Emitted when an event is unloaded.

Parameters:
NameTypeDescription
nameString

The name of the event