Skip to main content

Class: Listener<E, O>

Type parameters

NameType
Eextends keyof ClientEvents | symbol = ""
Oextends Options = Options

Hierarchy

Constructors

constructor

new Listener<E, O>(context, options?)

Type parameters

NameType
Eextends symbol | keyof ClientEvents = ""
Oextends ListenerOptions<O> = ListenerOptions

Parameters

NameType
contextPieceContext
optionsO

Overrides

Piece.constructor

Defined in

projects/framework/src/lib/structures/Listener.ts:67

Properties

_listener

Private _listener: null | (...args: any[]) => void

Defined in

projects/framework/src/lib/structures/Listener.ts:65


emitter

Readonly emitter: null | EventEmitter

Defined in

projects/framework/src/lib/structures/Listener.ts:51


enabled

enabled: boolean

Inherited from

Piece.enabled

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:450


event

Readonly event: string | symbol

Defined in

projects/framework/src/lib/structures/Listener.ts:57


location

Readonly location: PieceLocation

Inherited from

Piece.location

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:442


name

Readonly name: string

Inherited from

Piece.name

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:446


once

Readonly once: boolean

Defined in

projects/framework/src/lib/structures/Listener.ts:63


options

Readonly options: O

Inherited from

Piece.options

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:454


store

Readonly store: Store<Piece<PieceOptions>>

Inherited from

Piece.store

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:438

Accessors

container

get container(): Container

Returns

Container

Inherited from

Piece.container

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:460

Methods

_run

Private _run(...args): Promise<void>

Parameters

NameType
...argsunknown[]

Returns

Promise<void>

Defined in

projects/framework/src/lib/structures/Listener.ts:122


_runOnce

Private _runOnce(...args): Promise<void>

Parameters

NameType
...argsunknown[]

Returns

Promise<void>

Defined in

projects/framework/src/lib/structures/Listener.ts:128


onLoad

onLoad(): unknown

Returns

unknown

Overrides

Piece.onLoad

Defined in

projects/framework/src/lib/structures/Listener.ts:86


onUnload

onUnload(): unknown

Returns

unknown

Overrides

Piece.onUnload

Defined in

projects/framework/src/lib/structures/Listener.ts:99


reload

reload(): Promise<void>

Returns

Promise<void>

Inherited from

Piece.reload

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:478


run

Abstract run(...args): unknown

Parameters

NameType
...argsE extends keyof ClientEvents ? ClientEvents[E] : unknown[]

Returns

unknown

Defined in

projects/framework/src/lib/structures/Listener.ts:84


toJSON

toJSON(): ListenerJSON

Returns

ListenerJSON

Overrides

Piece.toJSON

Defined in

projects/framework/src/lib/structures/Listener.ts:114


unload

unload(): Promise<void>

Returns

Promise<void>

Inherited from

Piece.unload

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:474