InteractionHandler

export declare class InteractionHandler

Constructor

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

Paramaters

nametypeoptionaldescription
clientIgloClientNo-
directorystringYes-

Properties

client: IgloClient

directory: string

interactions: Collection<string, InteractionListener<IgloClient>>

All the available interactions

Methods

loadInteraction(filepath)

function loadInteraction(filepath: string): Promise<boolean>

Paramaters

nametypeoptionaldescription
filepathstringNoThe filepath of the InteractionListener (not absolute)

Description

Loads an InteractionListener if not yet present in the cache

returns

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

throws

InterActionHandlerError

loadInteractions()

function loadInteractions(): Promise<number>

Description

Loads all the InteractionListeners

returns

The amount of InteractionListeners that were loaded

throws

InterActionHandlerError

reloadInteraction(name)

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

Paramaters

nametypeoptionaldescription
namestringNoThe name of the InteractionListener

Description

Reloads an InteractionListener

returns

Boolean depending on InteractionListeners presence in cache

throws

InterActionHandlerError

reloadInteractions()

function reloadInteractions(): Promise<void>

Description

Reloads all present InteractionListeners

throws

InterActionHandlerError

unloadInteraction(name)

function unloadInteraction(name: string): boolean

Paramaters

nametypeoptionaldescription
namestringNoThe name of the InteractionListener

Description

Unloads an InteractionListener if present in the cache

returns

Boolean depending on InteractionListener presence in cache