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