EventListener

export declare class EventListener<Client extends IgloClient = IgloClient> extends Base<EventListener.Client> implements EventListenerOptions

Constructor

constructor(client: EventListener.Client, options: EventListenerOptions): this;

Paramaters

nametypeoptionaldescription
clientEventListener.ClientNo-
optionsEventListenerOptionsNo-

Properties

client: EventListener.Client

The Discord client to interact with Discord

emitter: EventEmitter

The emitter of the event

defaults

IgloClient

filepath: string

The name of the filepath associated with the event

name: string

The name of the event

once: boolean

Whether to run the event once or multiple times after starting the bot

default

false

Methods

_run(...args)

private
function _run(...args: readonly Array<any>): Promise<void>

Paramaters

nametypeoptionaldescription
...argsreadonly Array<any>No-

Description

load(options)

function load(options: EventListenerLoadOptions): void

Paramaters

nametypeoptionaldescription
optionsEventListenerLoadOptionsNo-

Description

Runs when the command is loaded

requires

super callback on overwrite

run(...args)

function run<K extends keyof ClientEvents>(...args: readonly Array<any> | ClientEvents[K]): Awaitable<void>

Paramaters

nametypeoptionaldescription
...argsreadonly Array<any> | ClientEvents[K]No-

Description

unload()

function unload(): void

Description

Runs when the Event is unloaded

requires

super callback on overwrite