Class: ParsedUsage

ParsedUsage

Converts usage strings into objects to compare against later

new ParsedUsage(client, command)

Parameters:
Name Type Description
client KlasaClient The klasa client
command Command The command this parsed usage is for
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L13

Properties


<readonly> client :KlasaClient

The client this CommandMessage was created with.
Type:
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L14

commands :string

The compiled string for all names/aliases in a usage string
Type:
  • string
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L35

deliminatedUsage :string

The usage string re-deliminated with the usageDelim
Type:
  • string
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L42

names :Array.<string>

All names and aliases for the command
Type:
  • Array.<string>
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L28

nearlyFullUsage :string

The concatenated string of this.commands and this.deliminatedUsage
Type:
  • string
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L63

parsedUsage :Array.<Tag>

The usage object to compare against later
Type:
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L56

usageString :string

The usage string
Type:
  • string
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L49

Methods


<static> parseUsage(usageString)

Method responsible for building the usage object to check against
Parameters:
Name Type Description
usageString string The usage string to parse
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L83
Returns:
Type
Array.<Tag>

<static> tagClose(usage, char)

Method responsible for handling tag closes
Parameters:
Name Type Description
usage Object The current usage interum object
char string The character that triggered this function
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L147
Returns:
The current usage interum object
Type
Object

<static> tagOpen(usage, char)

Method responsible for handling tag opens
Parameters:
Name Type Description
usage Object The current usage interum object
char string The character that triggered this function
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L132
Returns:
The current usage interum object
Type
Object

<static> tagSpace(usage, char)

Method responsible for handling tag spacing
Parameters:
Name Type Description
usage Object The current usage interum object
char string The character that triggered this function
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L173
Returns:
The current usage interum object
Type
Object

fullUsage(msg)

Creates a full usage string including prefix and commands/aliases for documentation/help purposes
Parameters:
Name Type Description
msg external:Message a message to check to get the current prefix
Since:
  • 0.0.1
Source:
lib/usage/ParsedUsage.js#L72
Returns:
Type
string