When creating a new thread from a mention, include a note and the initial message in the thread

cshd
Dragory 2020-08-16 18:41:58 +03:00
parent 78a1cc34be
commit c7bf059220
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 3 additions and 1 deletions

View File

@ -239,7 +239,9 @@ function initBaseMessageHandlers() {
const existingThread = await threads.findOpenThreadByUserId(msg.author.id);
if (! existingThread) {
// Only open a thread if we don't already have one
await threads.createNewThreadForUser(msg.author, { quiet: true });
const createdThread = await threads.createNewThreadForUser(msg.author, { quiet: true });
await createdThread.postSystemMessage(`This thread was opened from a bot mention in <#${msg.channel.id}>`);
await createdThread.receiveUserReply(msg);
}
}
});