From 1dc21880e21157cfe2806701d47fd4e3ab81ce0e Mon Sep 17 00:00:00 2001 From: Miikka Virtanen Date: Mon, 24 Jul 2017 02:23:34 +0300 Subject: [PATCH] Clarify some code comments --- src/index.js | 2 +- src/threads.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9714df3..c1d6694 100644 --- a/src/index.js +++ b/src/index.js @@ -46,7 +46,7 @@ function formatAttachment(attachment) { }); } -// "Forward all messages not starting in prefix" +// If the alwaysReply option is set to true, send all messages in modmail threads as replies, unless they start with the prefix if (config.alwaysReply) { bot.on('messageCreate', msg => { if (! msg.channel.guild) return; diff --git a/src/threads.js b/src/threads.js index 4894d8d..d8c4a29 100644 --- a/src/threads.js +++ b/src/threads.js @@ -3,6 +3,9 @@ const utils = require('./utils'); const jsonDb = require('./jsonDb'); const config = require('../config'); +// If the following messages would be used to start a thread, ignore it instead +// This is to prevent accidental threads from e.g. irrelevant replies after the thread was already closed +// or replies to the greeting message const accidentalThreadMessages = [ 'ok', 'okay',