Middleware that will be executed in order whenever the route is executed
Create a handler which matches a command
The command that must be matched in order for this route to be executed
Middleware that will be executed in order whenever the route is executed
Create an error handler which matches all commands
You can set up the handler by placing it at the bottom to catch all errors which are created by routers.
const router = new HaSeul<Message>();
router
.command('help', ({ next }) => {
next(new Error('An error occured while processing the HELP command!'))
})
.error(({ err, message }) => {
console.log(err)
message.channel.createMessage('An error occurred: ' + err)
})
Middleware that will be executed in order whenever an error is caught by the router
Create an error handler which matches a command
The command that must be matched in order for this route to be executed
Middleware that will be executed in order whenever an error is caught by the router
Obtain the current prefix of the router.
The name of the option
Obtain whether or not the router is case sensitive or not.
The name of the option
Obtain the delimiter used to generate JSON objects.
The name of the option
Returns the content of a message, if the prefix (and optional route) matches the user's message.
The message content that the user has provided
The route name that needs to be removed from the resulting content
Pass a message into the router
The content of a message from a user
The object from your client API
Set the prefixes the router will respond to.
The name of the option
The value that will be assigned to this option
Set the prefix of the router.
The name of the option
The value that will be assigned to this option
Set the case sensitivity of routing.
The name of the option
The value that will be assigned to this option
Set the white space that is used when converting an object to JSON.
The name of the option
The value that will be assigned to this option
Generated using TypeDoc
Create a handler which matches all commands