EventHandler

export declare class EventHandler

Constructor

constructor(client: IgloClient, directory?: string): this;

Paramaters

nametypeoptionaldescription
clientIgloClientNo-
directorystringYes-

Properties

client: IgloClient

directory: string

events: Collection<string, EventListener<IgloClient>>

All the available events

Methods

loadEvent(file)

function loadEvent(file: string): Promise<boolean>

Paramaters

nametypeoptionaldescription
filestringNoThe filepath name of the EventListener (not absolute)

Description

Loads an EventListener if not yet present in the cache

returns

Boolean depending on EventListeners presence in cache (true = already present)

throws

InterActionHandlerError

loadEvents()

function loadEvents(): Promise<number>

Description

Loads all the events

returns

The amount of events that were loaded

throws

InterActionHandlerError

reloadEvent(name)

function reloadEvent(name: string): Promise<boolean>

Paramaters

nametypeoptionaldescription
namestringNoThe name of the EventListener

Description

Reloads an EventListener

returns

Boolean depending on EventListeners presence in cache

throws

InterActionHandlerError

reloadEvents()

function reloadEvents(): Promise<void>

Description

Reloads all present events

throws

InterActionHandlerError

unloadEvent(name)

function unloadEvent(name: string): boolean

Paramaters

nametypeoptionaldescription
namestringNoThe name of the EventListener

Description

Unloads an EventListener if present in the cache

returns

Boolean depending on EventListeners presence in cache