- 1 :
/**
- 2 :
* Monitor are functions that are designed to watch incoming messages. These can range from
- 3 :
* checking a message for specific words, or logging all mentions to a channel.
- 4 :
* @module Monitor
- 5 :
* @example <caption> They will always follow this structure. </caption>
- 6 :
* exports.run = (client, msg) => { // code here };
- 7 :
* exports.conf = {};
- 8 :
*/
- 9 :
- 10 :
/**
- 11 :
* The part of the monitor that will run on the message.
- 12 :
* @param {KomadaClient} client The Komada Client
- 13 :
* @param {Message} msg A Message object obtained from discord.js
- 14 :
* @example <caption> This will create a monitor that logs every message that mentions the bot. </caption>
- 15 :
* exports.run = (client, msg, cmd) => {
- 16 :
* if (msg.mentions.users.has(client.user.id)) console.log(`Message ${msg.id} contained the bots mention: ${msg.cleanContent}`);
- 17 :
* }
- 18 :
*/
- 19 :
exports.run = (client, msg) => {}; // eslint-disable-line
- 20 :
- 21 :
- 22 :
/**
- 23 :
* An Object containing configuration values that will configure a monitor.
- 24 :
* @typedef {Object} Conf
- 25 :
* @property {Boolean} enabled Whether or not this monitor should be enabled for use.
- 26 :
* @property {Boolean} ignoreBots Whether or not this monitor should ignore other bots.
- 27 :
* @property {Boolean} ignoreSelf Whether or not this monitor should ignore messages from the ClientUser.
- 28 :
*/
- 29 :
- 30 :
- 31 :
/**
- 32 :
* An object that configures the monitor.
- 33 :
* @type {Conf}
- 34 :
* @example
- 35 :
* exports.conf = {
- 36 :
enabled: true,
- 37 :
ignoreBots: true,
- 38 :
ignoreSelf: true
- 39 :
};
- 40 :
*/
- 41 :
exports.conf = {};