Finalizer

Finalizers are functions that are ran after a Command has successfully been ran. Examples of these are cooldown setting after a command is ran and command logging.
Example

They will always follow this structure.

exports.run = (client, msg, mes) => { // code here };
exports.conf = {};

Members

static conf :Conf

An object that configures the monitor.
Example
exports.conf = {
   enabled: true,
 };

Methods

static run(client, msg, mesopt)

The part of the monitor that will run on the message.
Parameters:
Name Type Attributes Description
client KomadaClient The Komada Client
msg Message A Message object obtained from discord.js
mes ? <optional>
Something returned from the command for use in finalizers, like a message.
Example

This will create a finalizer that logs commands.

exports.run = (client, msg, cmd) => {
  console.log(`Message ${msg.id} contained the command ${cmd.help.name} and was ran with the arguments ${msg.args.join(",")}`);
}

Type Definitions

Conf

An Object containing configuration values that will configure a monitor.
Properties:
Name Type Description
enabled Boolean Whether or not this monitor should be enabled for use.