From cd17fdbaed6a7e415d494a53e8ecb6dee14a7910 Mon Sep 17 00:00:00 2001 From: DopeGhoti Date: Thu, 4 Jun 2020 20:43:01 -0700 Subject: [PATCH] Slight refactor of existing thread check --- src/main.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index c2bd4a5..8eefd26 100644 --- a/src/main.js +++ b/src/main.js @@ -235,10 +235,9 @@ function initBaseMessageHandlers() { if (await blocked.isBlocked(msg.author.id)) return; // This may not be needed as it is checked above. if (utils.isStaff(msg.member)) return; // Same. const existingThread = await threads.findOpenThreadByUserId(msg.author.id); - if (existingThread) { // Already a thread open; nothing to do - return; + if (! existingThread) { // Only open a thread if we don't already have one. + const createdThread = await threads.createNewThreadForUser(msg.author, true, true); } - const createdThread = await threads.createNewThreadForUser(msg.author, true, true); } }); }