Slight refactor of existing thread check

cshd
DopeGhoti 2020-06-04 20:43:01 -07:00
parent edd2ceb1ab
commit cd17fdbaed
1 changed files with 2 additions and 3 deletions

View File

@ -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 (await blocked.isBlocked(msg.author.id)) return; // This may not be needed as it is checked above.
if (utils.isStaff(msg.member)) return; // Same. if (utils.isStaff(msg.member)) return; // Same.
const existingThread = await threads.findOpenThreadByUserId(msg.author.id); const existingThread = await threads.findOpenThreadByUserId(msg.author.id);
if (existingThread) { // Already a thread open; nothing to do if (! existingThread) { // Only open a thread if we don't already have one.
return; const createdThread = await threads.createNewThreadForUser(msg.author, true, true);
} }
const createdThread = await threads.createNewThreadForUser(msg.author, true, true);
} }
}); });
} }