Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CoreArgument

Hierarchy

Index

Constructors

constructor

  • new CoreArgument(store: Store<Piece>, directory: string, file: keyof string[], options?: AliasPieceOptions): CoreArgument
  • since

    0.0.1

    Parameters

    • store: Store<Piece>

      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

    • Optional options: AliasPieceOptions

      The options for this piece

    Returns CoreArgument

Properties

aliases

aliases: string[]

The aliases for this piece.

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

enabled

enabled: boolean

Whether or not the Piece is enabled.

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 store

store: Store<Piece>

The store this Piece is from.

since

0.0.1

Static regex

regex: { channel: RegExp; emoji: RegExp; role: RegExp; snowflake: RegExp; userOrMember: RegExp } = MENTION_REGEX

Standard regular expressions for matching mentions and snowflake ids

since

0.5.0

Type declaration

  • channel: RegExp
  • emoji: RegExp
  • role: RegExp
  • snowflake: RegExp
  • userOrMember: RegExp

Accessors

base

date

duration

path

  • get path(): string
  • The absolute path to this piece

    since

    0.0.1

    Returns string

type

  • get type(): string
  • The type of piece this is

    since

    0.0.1

    Returns string

Methods

disable

  • disable(): this
  • Disables this piece

    since

    0.0.1

    chainable

    Returns this

enable

  • enable(): this
  • Enables this piece

    since

    0.0.1

    chainable

    Returns this

init

  • init(): unknown
  • The init method to be optionally overwritten in actual pieces

    since

    0.0.1

    Returns unknown

reload

  • reload(): Promise<Piece | null>
  • Reloads this piece

    since

    0.0.1

    Returns Promise<Piece | null>

    The newly loaded piece

run

toJSON

  • toJSON(): Record<string, unknown>
  • Defines the JSON.stringify behavior of this argument.

    since

    0.0.1

    Returns Record<string, unknown>

toString

  • toString(): string
  • Defines toString behavior for pieces

    since

    0.0.1

    Returns string

    This piece name

unload

  • unload(): boolean
  • Unloads this piece

    since

    0.0.1

    Returns boolean

Static Protected minOrMax

  • minOrMax(client: Client, value: number, min?: number | null, max?: number | null, possible: Possible, message: Message, suffix?: undefined | string): boolean
  • Checks min and max values

    since

    0.5.0

    Parameters

    • client: Client

      The client of this bot

    • value: number

      The value to check against

    • Default value min: number | null = null

      The minimum value

    • Default value max: number | null = null

      The maximum value

    • possible: Possible

      The id of the current possible usage

    • message: Message

      The message that triggered the command

    • Optional suffix: undefined | string

      An error suffix

    Returns boolean

Generated using TypeDoc