Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Commands

The wrapper around commands provided by Velt.

Hierarchy

  • Commands

Index

Methods

create

  • create(callback: (...args: string[]) => any): CommandAddon
  • create(opts: {}): CommandAddon
  • create(name: string, callback: (sender: any, ...args: string[]) => any): CommandAddon
  • create(name: string, callback: (sender: any, ...args: string[]) => any, opts: {}): CommandAddon
  • Create a command with the given callback, name, and options.

    Parameters

    • callback: (...args: string[]) => any
        • (...args: string[]): any
        • Parameters

          • Rest ...args: string[]

          Returns any

    Returns CommandAddon

  • Parameters

    • opts: {}

    Returns CommandAddon

  • Parameters

    • name: string
    • callback: (sender: any, ...args: string[]) => any
        • (sender: any, ...args: string[]): any
        • Parameters

          • sender: any
          • Rest ...args: string[]

          Returns any

    Returns CommandAddon

  • Parameters

    • name: string
    • callback: (sender: any, ...args: string[]) => any
        • (sender: any, ...args: string[]): any
        • Parameters

          • sender: any
          • Rest ...args: string[]

          Returns any

    • opts: {}

    Returns CommandAddon

createListType

  • createListType<T>(type: string, items: T): Commands
  • A command type with a name that tab completes to a list of items and matches only them.

    Type parameters

    • T: string[]

    Parameters

    • type: string

      The name of the new list type

    • items: T

      The items in this list type

    Returns Commands

createType

  • A command type, which has a name, match (for checking if an argument matches this type) and tabComplete (for tab completing arguments of this type)

    Parameters

    • opts: {}

      The options to create this command type with

    Returns Commands

  • Parameters

    • type: string
    • opts: {}

    Returns Commands

isConsole

  • isConsole(sender: any): boolean
  • Check if any given sender is the console.

    Parameters

    • sender: any

      The sender to check

    Returns boolean

runCommand

  • runCommand(sender: any, command: string): void
  • Make a specific sender run the command

    Parameters

    • sender: any

      The player (or console) to run the command

    • command: string

      The command to run

    Returns void

runConsoleCommand

  • runConsoleCommand(command: string): void
  • Run a command from console.

    Parameters

    • command: string

      The command to run

    Returns void

Generated using TypeDoc