Commands: Overview

Structure

Each command is comprised of one or more tokens, each separated by a space. A command always starts with "!".

Tokens (in priority order):

  1. Literal: String that specifies the command to execute.
  2. Parameter (numeric): Number that specifies a parameter to the command.
  3. Parameter (string): String that specifies a parameter to the command. May be enclosed in quotation marks.

Example:

!vote 2

"vote" and "2" are each tokens (a literal and a numeric parameter, respectively).

Priority Order

The bot attempts to interpret each token in the above priority order; for example, if a token can be interpreted as both a literal and a string parameter, it will be interpreted as a literal. This resolves ambiguity when the command issued could be interpreted multiple ways.

Example:

!suggest unuse

This could either mean the "!suggest unuse" command or to "!suggest" "unuse" (i.e. add the suggestion "unuse"). Because "!suggest unuse" is a recognized command, "unuse" is interpreted as a literal rather than as a string parameter. To override this behavior, see Parameters: String below.

Parameters

String

Because tokens are separated by a space, generally you must surround a string parameter containing spaces with quotation marks. However, in situations where a command takes only one parameter, the quotation marks may be omitted.

Occasionally there may be situations where a token that could be interpreted as a numeric parameter or a literal is intended as a string parameter. Simply surround the text with quotation marks to ensure it is parsed as a string parameter.

Example:

!quote 1
states quotation 1.

!quote "1"
states a random quotation containing the text 1.

Numeric

Unless otherwise specified, when used as an index a numeric parameter of 1 refers to the first element.