Options
All
  • Public
  • Public/Protected
  • All
Menu

A generic, abstract command class from which all other commands are going to derive

Hierarchy

Index

Properties

Protected aliases

aliases: string | string[]

Protected commandName

commandName: string

Protected Abstract desc

desc: string

error

error: Error

errorString

errorString: string

Protected member

member: GuildMember

Protected message

message: Message

Protected needParamValues

needParamValues: boolean = true

Protected paramValues

paramValues: string[]

Protected params

params: string

Protected reply

reply: string | object

Protected replyTo

replyTo: boolean = false

Protected server

server: string

warning

warning: Error

Methods

errorRespond

  • errorRespond(): void
  • Wrapper function which sets a generic error message to respond with and calls respond()

    Returns void

Protected Abstract exec

  • exec(): Promise<{}>
  • a base run function to be expanded upon per command, Each command should perform it's main functions within this umbrella function

    Returns Promise<{}>

Protected getParams

  • getParams(): string[]
  • Gets an an array with all the parameters passed to a command

    Returns string[]

    string[]

respond

  • respond(): void
  • A base function that returns whatever reply has been set by other base functions, the command object returns this response after the command has been successfully ran defaults to sending it as a normal message, but can send it as reply if replyTo is set to true

    Returns void

returnProperties

  • returnProperties(): { alias: string | string[]; desc: string; name: string; syntax: string }
  • Returns the commands properties, for use in the Help command

    Returns { alias: string | string[]; desc: string; name: string; syntax: string }

    object

    • alias: string | string[]
    • desc: string
    • name: string
    • syntax: string

Private returnSyntax

  • returnSyntax(): string
  • Returns the syntax of the command

    Returns string

    string

run

  • run(message: Message): Promise<{}>
  • The meat of the object, this function is called by the commander object and instantiates the object proper with all required values, then runs the encompassing function and returns the resulting promise object

    Parameters

    • message: Message

    Returns Promise<{}>

Legend

  • Class
  • Property
  • Method
  • Variable
  • Function
  • Protected property
  • Protected method
  • Interface
  • Private method

Generated using TypeDoc