Skip to main content

ICommand

Index

Properties

optionalAction

Action?: (this: Optional<ICommand, Tag>, argumentsString: string, message: string, arguments: string[]) => void

The function that handles the command


Type declaration

    • (this: Optional<ICommand, Tag>, argumentsString: string, message: string, arguments: string[]): void
    • Parameters

      • this: Optional<ICommand, Tag>
      • argumentsString: string
      • message: string
      • arguments: string[]

      Returns void

optionalArguments

Arguments?: ArgumentDef[]

Array of arguments that the command accepts. Can be a function to generate arguments at runtime. Typically used to provide additional context for users

optionalAutoComplete

AutoComplete?: (this: Optional<ICommand, Tag>, arguments: string[], lowercaseMessage: string, message: string) => void

Function to execute on autocomplete key (Tab default) press if chat input matches tag


Type declaration

    • (this: Optional<ICommand, Tag>, arguments: string[], lowercaseMessage: string, message: string): void
    • Parameters

      • this: Optional<ICommand, Tag>
      • arguments: string[]
      • lowercaseMessage: string
      • message: string

      Returns void

optionalClear

Clear?: false

Whether chat input should be cleared after execution of command. True if omitted

optionalDescription

Description?: string | Record<ServerChatRoomLanguage | TW, string>

Description of the command

optionalPrerequisite

Prerequisite?: (this: Optional<ICommand, Tag>) => boolean

Function that returns whether the command can be executed


Type declaration

optionalPreserveCase

PreserveCase?: boolean

Whether the case of the command should be preserved. False if omitted

optionalReference

Reference?: string

Reference to another command, used for aliases

optionalSubcommands

Subcommands?: Subcommand[]

Array of commands that can be used as subcommands.

Tag

Tag: string

Name of the command