Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Command<ParsedArgsFinished>

Command itself Command flow is ratelimit check -> permission check -> onBefore -> arg parse -> onBeforeRun -> run -> onSuccess | onRunError

Type parameters

  • ParsedArgsFinished

Hierarchy

  • Command

Index

Constructors

constructor

Properties

Optional _file

_file: undefined | string

arg

args

commandClient

commandClient: CommandClient

disableDm

disableDm: boolean = false

disableDmReply

disableDmReply: boolean = false

metadata

metadata: object

Type declaration

  • [key: string]: any

Optional permissions

permissions: Array<Permissions>

Optional permissionsClient

permissionsClient: Array<Permissions>

Optional permissionsIgnoreClientOwner

permissionsIgnoreClientOwner: undefined | false | true = false

priority

priority: number = 0

ratelimits

ratelimits: Array<CommandRatelimit> = []

responseOptional

responseOptional: boolean = false

triggerTypingAfter

triggerTypingAfter: number = -1

Accessors

aliases

  • get aliases(): Array<string>
  • set aliases(value: Array<string>): void
  • Returns Array<string>

  • Parameters

    • value: Array<string>

    Returns void

default

  • Parameters

    Returns void

label

  • get label(): string
  • set label(value: string): void
  • Returns string

  • Parameters

    • value: string

    Returns void

name

  • get name(): string
  • set name(value: string): void
  • Returns string

  • Parameters

    • value: string

    Returns void

names

  • get names(): Array<string>
  • Returns Array<string>

type

  • Parameters

    Returns void

Methods

check

  • check(name: string): boolean
  • Parameters

    • name: string

    Returns boolean

getArgs

  • Parameters

    Returns Promise<object>

getName

  • getName(content: string): null | string
  • Parameters

    • content: string

    Returns null | string

Optional onBefore

  • onBefore(context: Context): Promise<boolean> | boolean
  • Parameters

    Returns Promise<boolean> | boolean

Optional onBeforeRun

  • Parameters

    Returns Promise<boolean> | boolean

Optional onCancel

  • Parameters

    Returns Promise<any | Message> | any | Message

Optional onCancelRun

Optional onError

  • Parameters

    Returns Promise<any> | any

Optional onPermissionsFail

  • Parameters

    Returns Promise<any> | any

Optional onPermissionsFailClient

  • Parameters

    Returns Promise<any> | any

Optional onRatelimit

  • onRatelimit(context: Context, ratelimits: Array<object>, metadata: object): Promise<any> | any
  • Parameters

    • context: Context
    • ratelimits: Array<object>
    • metadata: object
      • global: boolean
      • now: number

    Returns Promise<any> | any

Optional onRunError

  • onRunError(context: Context, args: ParsedArgsFinished, error: any): Promise<any> | any
  • Parameters

    • context: Context
    • args: ParsedArgsFinished
    • error: any

    Returns Promise<any> | any

Optional onSuccess

  • onSuccess(context: Context, args: ParsedArgsFinished): Promise<any> | any
  • Parameters

    • context: Context
    • args: ParsedArgsFinished

    Returns Promise<any> | any

Optional onTypeError

Optional run

  • Parameters

    • context: Context
    • args: ParsedArgsFinished

    Returns Promise<any | Message> | any | Message

Generated using TypeDoc