Slight refactor of existing thread check
parent
edd2ceb1ab
commit
cd17fdbaed
|
@ -235,11 +235,10 @@ 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);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue