Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Event

The common class for all events.

Hierarchy

Index

Constructors

constructor

  • since

    0.0.1

    Parameters

    • store: EventStore

      The store this piece is for

    • directory: string

      The base directory to the pieces folder

    • file: keyof string[]

      The path from the pieces folder to the piece file

    • Default value options: EventOptions = {}

      The options for this piece

    Returns Event

Properties

Readonly Private #listener

#listener: Event["run"]

Stored bound on method, so it can be properly unlistened to later

since

0.0.1

Readonly client

client: Client

The client this Piece was created with.

since

0.0.1

Readonly directory

directory: string

The base directory this Piece is stored in.

since

0.0.1

Readonly emitter

emitter: EventEmitter

The emitter this event is for

since

0.0.1

enabled

enabled: boolean

Whether or not the Piece is enabled.

since

0.0.1

Readonly event

event: string

The event to listen for

since

0.0.1

Readonly file

file: keyof string[]

The file location where this Piece is stored.

since

0.0.1

name

name: string

The name of the Piece.

since

0.0.1

Readonly once

once: boolean

If this event should only be run once and then unloaded

since

0.0.1

Readonly store

store: EventStore

The store this Piece is from.

since

0.0.1

Accessors

path

  • get path(): string

type

  • get type(): string

Methods

Private _listen

  • _listen(): void

Private _run

  • _run(...args: Parameters<Event["run"]>): Promise<void>
  • A wrapper for the run method, to easily disable/enable events

    since

    0.0.1

    Parameters

    • Rest ...args: Parameters<Event["run"]>

    Returns Promise<void>

Private _runOnce

  • _runOnce(...args: Parameters<Event["run"]>): Promise<void>
  • A wrapper for the _run method for once handling

    since

    0.0.1

    Parameters

    • Rest ...args: Parameters<Event["run"]>

    Returns Promise<void>

Private _unlisten

  • _unlisten(): void

disable

  • disable(): this

enable

  • enable(): this

init

  • init(): unknown

reload

  • reload(): Promise<Piece | null>

Abstract run

  • run(...args: keyof unknown[]): unknown

toJSON

  • toJSON(): Record<string, unknown>

toString

  • toString(): string

unload

  • unload(): boolean

Generated using TypeDoc