Type Definitions


HarukaOptions

Description
The options object Haruka should be instantiated with.
Properties
Name Type Description
config Object The configuration file. See `example-config.json`
version String Haruka’s version. Defaults to `options.config.version`
prefix String Haruka’s command prefix, such as `-h`. This must be defined.
default HarukaDefault Haruka’s catch-all function. If Haruka detects that her prefix was sent but no function was called, this function can warn the sender.
Details
Object

HarukaFn

Description
Describes a Haruka function. These functions are passed to the Haruka instance via Haruka::add()
Properties
Name Type Attributes Description
name String The function name.
handler HarukaHandler The Haruka message handler
regex RegExp <optional>
The regular expression that should trigger this function. If this function is a special function, omit this property.
help Object This function's help descriptions.
Name Type Attributes Default Description
short String <optional>
This function's short help description. Can be omitted if help.hidden is set to true.
long String This function's long help description.
hidden Boolean <optional>
true Whether this function should show up in the generic help list. Defaults to true.
Details
Object

HarukaHandler( msg [, match ], H )

Description
A Haruka message handler.
Parameters
Name Type Attributes Description
msg Message A DiscordJS Discord message
match Array <optional>
The RegExp match that triggered this message. This argument is omitted if this function is a Special function.
H Haruka The Haruka instance this function is attached to.
Details
function

HarukaDefault( msg )

Description
A catchall function, called when a message starts with Haruka's prefix, but no function matched its regular expression.
Parameters
Name Type Description
msg Message A DiscordJS Discord message.
Details
function