A metadata cache used by the command module for tracking internal things. Can be used for anything
Holds all argument resolvers
Holds all command module rules. Rules are run for all commands
Tells the command module to enforce usage of prefixes in commands. This will
prevent commands from running if some rule does not set MessageContext.prefixUsed
to true
(presumably because a prefix was used)
NOTE: The checkMentionPrefix
rule will call this automatically when
it is run. If you write your own prefix rule, be sure to call this somewhere
within the rule function
Finalize argument bindings for all loaded commands. Should be called at any
point after all desired commands have been loaded but before commands are
allowed to be run (e.g. before calling <Client>#login()
)
Returns the currently registered global ErrorHandler
. Will create, cache,
and return a new one if one does not already exist
Register your client instance with the command module. This will initialize
all loaded commands and register the client with the Command dispatcher once
the client emits the ready
event
Sets the global error handler that will be used for handling Rule errors and any middleware/command errors that are not handled by individual Command error handling methods.
If called without an ErrorHandler
argument, a blank error handler will
be generated and cached. You can fetch it with getGlobalErrorHandler
to append/override error matchers at a later time.
Global error handlers will be given a MessageContext
or CommandContext
object if the error being given is from Rules or Middleware respectively.
Additionally, a CommandContext
object will be given if an error is
thrown during argument parsing, resolving, or if there was an uncaught error
in a command action. You can reasonably expect the context objects to be
present for the following error types:
Generated using TypeDoc
Holds all commands